<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - REGRESSION (r206247): Painting milestones can be delayed until the next layer flush"
   href="https://bugs.webkit.org/show_bug.cgi?id=164340#c8">Comment # 8</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - REGRESSION (r206247): Painting milestones can be delayed until the next layer flush"
   href="https://bugs.webkit.org/show_bug.cgi?id=164340">bug 164340</a>
              from <span class="vcard"><a class="email" href="mailto:mitz&#64;webkit.org" title="mitz&#64;webkit.org &lt;mitz&#64;webkit.org&gt;"> <span class="fn">mitz&#64;webkit.org</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=293734&amp;action=diff" name="attach_293734" title="Have WebKit, not WebCore, defer sending the milestones until after the commit">attachment 293734</a> <a href="attachment.cgi?id=293734&amp;action=edit" title="Have WebKit, not WebCore, defer sending the milestones until after the commit">[details]</a></span>
Have WebKit, not WebCore, defer sending the milestones until after the commit

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=293734&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=293734&amp;action=review</a>

<span class="quote">&gt;&gt; Source/WebCore/ChangeLog:11
&gt;&gt; +        the call to firePaintRelatedMilestonesIfNeeded until after the commit.
&gt; 
&gt; Was it deferred for a good reason, like coalescing?</span >

It was deferred in order to make sure that WebKit client gets notified only after the commit (see <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Still possible to fire paint-related LayoutMilestones before CA has committed the changes"
   href="show_bug.cgi?id=115753">bug 115753</a>). That bug was probably reintroduced when &lt;<a href="https://trac.webkit.org/r166015">https://trac.webkit.org/r166015</a>&gt; (the fix for <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - FrameView::paintContents() is not called for composited content"
   href="show_bug.cgi?id=130541">bug 130541</a>) made RenderLayerBacking::paintIntoLayer() call FrameView::didPaintContents(), which fires the paint-related milestones synchronously. That is, until &lt;<a href="https://trac.webkit.org/r206247">https://trac.webkit.org/r206247</a>&gt; introduced a completely different way for the milestones to be deferred, which happened to defer them too much in some cases.

<span class="quote">&gt;&gt; Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:428
&gt;&gt; +            if (TiledCoreAnimationDrawingArea* drawingArea = static_cast&lt;TiledCoreAnimationDrawingArea*&gt;(retainedPage-&gt;drawingArea())) {
&gt; 
&gt; auto foo = downcast&lt;TiledCoreAnimationDrawingArea&gt;() ?
&gt; 
&gt; When is drawingArea != this? Very confusing to fetch it here again.</span >

drawingArea is null if in the mean while WebPage::close has been called.

<span class="quote">&gt;&gt; Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:439
&gt;&gt; +                drawingArea-&gt;m_pendingNewlyReachedLayoutMilestones = 0;
&gt; 
&gt; ...which you could also call here.</span >

I waffled on this. It will be a similar number of lines of code, and once 10.10 support is gone, it will be even more silly for it to be a function.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>