<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[244291] trunk/Source/WebKit</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/244291">244291</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2019-04-15 14:34:10 -0700 (Mon, 15 Apr 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>DrawingArea should only capture painting related milestones
https://bugs.webkit.org/show_bug.cgi?id=196926
<rdar://problem/48003845>

Reviewed by Tim Horton.

While dispatching layout milestones (mixture of layout and painting items), the associated drawing areas should only capture the painting related milestones.
These captured milestones get dispatched later in the commit handler to ensure that they are not forwarded prematurely.
However the truly layout related milestones (e.g. DidFirstVisuallyNonEmptyLayout) should be dispatched right away with no delay.

* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
(WebKit::RemoteLayerTreeTransaction::newlyReachedPaintingMilestones const):
(WebKit::RemoteLayerTreeTransaction::setNewlyReachedPaintingMilestones):
(WebKit::RemoteLayerTreeTransaction::newlyReachedLayoutMilestones const): Deleted.
(WebKit::RemoteLayerTreeTransaction::setNewlyReachedLayoutMilestones): Deleted.
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::encode const):
(WebKit::RemoteLayerTreeTransaction::decode):
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::addMilestonesToDispatch):
(WebKit::DrawingArea::dispatchDidReachLayoutMilestone): Deleted.
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
(WebKit::RemoteLayerTreeDrawingArea::addMilestonesToDispatch):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::dispatchDidReachLayoutMilestone): Deleted.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::dispatchDidReachLayoutMilestone):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
(WebKit::TiledCoreAnimationDrawingArea::addMilestonesToDispatch):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedPaintingMilestones):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedLayoutMilestones): Deleted.
(WebKit::TiledCoreAnimationDrawingArea::dispatchDidReachLayoutMilestone): Deleted.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitSharedRemoteLayerTreeRemoteLayerTreeTransactionh">trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h</a></li>
<li><a href="#trunkSourceWebKitSharedRemoteLayerTreeRemoteLayerTreeTransactionmm">trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessRemoteLayerTreeRemoteLayerTreeDrawingAreaProxymm">trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageDrawingAreah">trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageRemoteLayerTreeRemoteLayerTreeDrawingAreah">trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageRemoteLayerTreeRemoteLayerTreeDrawingAreamm">trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageWebPagecpp">trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPagemacTiledCoreAnimationDrawingAreah">trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPagemacTiledCoreAnimationDrawingAreamm">trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (244290 => 244291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2019-04-15 21:33:58 UTC (rev 244290)
+++ trunk/Source/WebKit/ChangeLog       2019-04-15 21:34:10 UTC (rev 244291)
</span><span class="lines">@@ -1,3 +1,43 @@
</span><ins>+2019-04-15  Zalan Bujtas  <zalan@apple.com>
+
+        DrawingArea should only capture painting related milestones
+        https://bugs.webkit.org/show_bug.cgi?id=196926
+        <rdar://problem/48003845>
+
+        Reviewed by Tim Horton.
+
+        While dispatching layout milestones (mixture of layout and painting items), the associated drawing areas should only capture the painting related milestones.
+        These captured milestones get dispatched later in the commit handler to ensure that they are not forwarded prematurely.
+        However the truly layout related milestones (e.g. DidFirstVisuallyNonEmptyLayout) should be dispatched right away with no delay.
+
+        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
+        (WebKit::RemoteLayerTreeTransaction::newlyReachedPaintingMilestones const):
+        (WebKit::RemoteLayerTreeTransaction::setNewlyReachedPaintingMilestones):
+        (WebKit::RemoteLayerTreeTransaction::newlyReachedLayoutMilestones const): Deleted.
+        (WebKit::RemoteLayerTreeTransaction::setNewlyReachedLayoutMilestones): Deleted.
+        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
+        (WebKit::RemoteLayerTreeTransaction::encode const):
+        (WebKit::RemoteLayerTreeTransaction::decode):
+        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
+        (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
+        * WebProcess/WebPage/DrawingArea.h:
+        (WebKit::DrawingArea::addMilestonesToDispatch):
+        (WebKit::DrawingArea::dispatchDidReachLayoutMilestone): Deleted.
+        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
+        (WebKit::RemoteLayerTreeDrawingArea::addMilestonesToDispatch):
+        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
+        (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
+        (WebKit::RemoteLayerTreeDrawingArea::dispatchDidReachLayoutMilestone): Deleted.
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::dispatchDidReachLayoutMilestone):
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
+        (WebKit::TiledCoreAnimationDrawingArea::addMilestonesToDispatch):
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedPaintingMilestones):
+        (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
+        (WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedLayoutMilestones): Deleted.
+        (WebKit::TiledCoreAnimationDrawingArea::dispatchDidReachLayoutMilestone): Deleted.
+
</ins><span class="cx"> 2019-04-15  John Wilander  <wilander@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Send delayed Ad Click Attribution conversion requests to the click source
</span></span></pre></div>
<a id="trunkSourceWebKitSharedRemoteLayerTreeRemoteLayerTreeTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h (244290 => 244291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h  2019-04-15 21:33:58 UTC (rev 244290)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h     2019-04-15 21:34:10 UTC (rev 244291)
</span><span class="lines">@@ -271,8 +271,8 @@
</span><span class="cx">     const Vector<TransactionCallbackID>& callbackIDs() const { return m_callbackIDs; }
</span><span class="cx">     void setCallbackIDs(Vector<TransactionCallbackID>&& callbackIDs) { m_callbackIDs = WTFMove(callbackIDs); }
</span><span class="cx"> 
</span><del>-    OptionSet<WebCore::LayoutMilestone> newlyReachedLayoutMilestones() const { return m_newlyReachedLayoutMilestones; }
-    void setNewlyReachedLayoutMilestones(OptionSet<WebCore::LayoutMilestone> milestones) { m_newlyReachedLayoutMilestones = milestones; }
</del><ins>+    OptionSet<WebCore::LayoutMilestone> newlyReachedPaintingMilestones() const { return m_newlyReachedPaintingMilestones; }
+    void setNewlyReachedPaintingMilestones(OptionSet<WebCore::LayoutMilestone> milestones) { m_newlyReachedPaintingMilestones = milestones; }
</ins><span class="cx"> 
</span><span class="cx">     bool hasEditorState() const { return !!m_editorState; }
</span><span class="cx">     const EditorState& editorState() const { return m_editorState.value(); }
</span><span class="lines">@@ -308,7 +308,7 @@
</span><span class="cx">     uint64_t m_renderTreeSize { 0 };
</span><span class="cx">     uint64_t m_transactionID { 0 };
</span><span class="cx">     ActivityStateChangeID m_activityStateChangeID { ActivityStateChangeAsynchronous };
</span><del>-    OptionSet<WebCore::LayoutMilestone> m_newlyReachedLayoutMilestones;
</del><ins>+    OptionSet<WebCore::LayoutMilestone> m_newlyReachedPaintingMilestones;
</ins><span class="cx">     bool m_scaleWasSetByUIProcess { false };
</span><span class="cx">     bool m_allowsUserScaling { false };
</span><span class="cx">     bool m_avoidsUnsafeArea { true };
</span></span></pre></div>
<a id="trunkSourceWebKitSharedRemoteLayerTreeRemoteLayerTreeTransactionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm (244290 => 244291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm 2019-04-15 21:33:58 UTC (rev 244290)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm    2019-04-15 21:34:10 UTC (rev 244291)
</span><span class="lines">@@ -562,7 +562,7 @@
</span><span class="cx">     encoder << m_transactionID;
</span><span class="cx">     encoder << m_activityStateChangeID;
</span><span class="cx"> 
</span><del>-    encoder << m_newlyReachedLayoutMilestones;
</del><ins>+    encoder << m_newlyReachedPaintingMilestones;
</ins><span class="cx"> 
</span><span class="cx">     encoder << m_scaleWasSetByUIProcess;
</span><span class="cx">     encoder << m_allowsUserScaling;
</span><span class="lines">@@ -673,7 +673,7 @@
</span><span class="cx">     if (!decoder.decode(result.m_activityStateChangeID))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (!decoder.decode(result.m_newlyReachedLayoutMilestones))
</del><ins>+    if (!decoder.decode(result.m_newlyReachedPaintingMilestones))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (!decoder.decode(result.m_scaleWasSetByUIProcess))
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessRemoteLayerTreeRemoteLayerTreeDrawingAreaProxymm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm (244290 => 244291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm 2019-04-15 21:33:58 UTC (rev 244290)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm    2019-04-15 21:34:10 UTC (rev 244291)
</span><span class="lines">@@ -255,7 +255,7 @@
</span><span class="cx">     didRefreshDisplay();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    if (auto milestones = layerTreeTransaction.newlyReachedLayoutMilestones())
</del><ins>+    if (auto milestones = layerTreeTransaction.newlyReachedPaintingMilestones())
</ins><span class="cx">         m_webPageProxy.didReachLayoutMilestone(milestones);
</span><span class="cx"> 
</span><span class="cx">     for (auto& callbackID : layerTreeTransaction.callbackIDs()) {
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageDrawingAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h (244290 => 244291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h     2019-04-15 21:33:58 UTC (rev 244290)
+++ trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h        2019-04-15 21:34:10 UTC (rev 244291)
</span><span class="lines">@@ -132,7 +132,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void setShouldScaleViewToFitDocument(bool) { }
</span><span class="cx"> 
</span><del>-    virtual bool dispatchDidReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone>) { return false; }
</del><ins>+    virtual bool addMilestonesToDispatch(OptionSet<WebCore::LayoutMilestone>) { return false; }
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     // Used by TiledCoreAnimationDrawingArea.
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageRemoteLayerTreeRemoteLayerTreeDrawingAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h (244290 => 244291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h      2019-04-15 21:33:58 UTC (rev 244290)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h 2019-04-15 21:34:10 UTC (rev 244291)
</span><span class="lines">@@ -109,7 +109,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool adjustLayerFlushThrottling(WebCore::LayerFlushThrottleState::Flags) override;
</span><span class="cx"> 
</span><del>-    bool dispatchDidReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone>) override;
</del><ins>+    bool addMilestonesToDispatch(OptionSet<WebCore::LayoutMilestone>) override;
</ins><span class="cx"> 
</span><span class="cx">     void updateScrolledExposedRect();
</span><span class="cx">     void updateRootLayers();
</span><span class="lines">@@ -173,12 +173,18 @@
</span><span class="cx">     Vector<RemoteLayerTreeTransaction::TransactionCallbackID> m_pendingCallbackIDs;
</span><span class="cx">     ActivityStateChangeID m_activityStateChangeID { ActivityStateChangeAsynchronous };
</span><span class="cx"> 
</span><del>-    OptionSet<WebCore::LayoutMilestone> m_pendingNewlyReachedLayoutMilestones;
</del><ins>+    OptionSet<WebCore::LayoutMilestone> m_pendingNewlyReachedPaintingMilestones;
</ins><span class="cx"> 
</span><span class="cx">     RefPtr<WebCore::GraphicsLayer> m_contentLayer;
</span><span class="cx">     RefPtr<WebCore::GraphicsLayer> m_viewOverlayRootLayer;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+inline bool RemoteLayerTreeDrawingArea::addMilestonesToDispatch(OptionSet<WebCore::LayoutMilestone> paintMilestones)
+{
+    m_pendingNewlyReachedPaintingMilestones.add(paintMilestones);
+    return true;
+}
+
</ins><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_DRAWING_AREA(RemoteLayerTreeDrawingArea, DrawingAreaTypeRemoteLayerTree)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageRemoteLayerTreeRemoteLayerTreeDrawingAreamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm (244290 => 244291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm     2019-04-15 21:33:58 UTC (rev 244290)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm        2019-04-15 21:34:10 UTC (rev 244291)
</span><span class="lines">@@ -390,8 +390,8 @@
</span><span class="cx">     backingStoreCollection.willCommitLayerTree(layerTransaction);
</span><span class="cx">     m_webPage.willCommitLayerTree(layerTransaction);
</span><span class="cx"> 
</span><del>-    layerTransaction.setNewlyReachedLayoutMilestones(m_pendingNewlyReachedLayoutMilestones);
-    m_pendingNewlyReachedLayoutMilestones = { };
</del><ins>+    layerTransaction.setNewlyReachedPaintingMilestones(m_pendingNewlyReachedPaintingMilestones);
+    m_pendingNewlyReachedPaintingMilestones = { };
</ins><span class="cx"> 
</span><span class="cx">     layerTransaction.setActivityStateChangeID(m_activityStateChangeID);
</span><span class="cx">     m_activityStateChangeID = ActivityStateChangeAsynchronous;
</span><span class="lines">@@ -532,12 +532,6 @@
</span><span class="cx">     scheduleCompositingLayerFlush();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RemoteLayerTreeDrawingArea::dispatchDidReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone> layoutMilestones)
-{
-    m_pendingNewlyReachedLayoutMilestones.add(layoutMilestones);
-    return true;
-}
-
</del><span class="cx"> void RemoteLayerTreeDrawingArea::adoptLayersFromDrawingArea(DrawingArea& oldDrawingArea)
</span><span class="cx"> {
</span><span class="cx">     RELEASE_ASSERT(oldDrawingArea.type() == type());
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (244290 => 244291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp       2019-04-15 21:33:58 UTC (rev 244290)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp  2019-04-15 21:34:10 UTC (rev 244291)
</span><span class="lines">@@ -6225,8 +6225,12 @@
</span><span class="cx">     ASSERT(!userData);
</span><span class="cx"> 
</span><span class="cx">     // The drawing area might want to defer dispatch of didLayout to the UI process.
</span><del>-    if (m_drawingArea && m_drawingArea->dispatchDidReachLayoutMilestone(milestones))
-        return;
</del><ins>+    if (m_drawingArea) {
+        static auto paintMilestones = OptionSet<WebCore::LayoutMilestone> { DidHitRelevantRepaintedObjectsAreaThreshold, DidFirstFlushForHeaderLayer, DidFirstPaintAfterSuppressedIncrementalRendering, DidRenderSignificantAmountOfText, DidFirstMeaningfulPaint };   
+        auto drawingAreaRelatedMilestones = milestones & paintMilestones;
+        if (drawingAreaRelatedMilestones && m_drawingArea->addMilestonesToDispatch(drawingAreaRelatedMilestones))
+            milestones.remove(drawingAreaRelatedMilestones);
+    }
</ins><span class="cx"> 
</span><span class="cx">     send(Messages::WebPageProxy::DidReachLayoutMilestone(milestones));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPagemacTiledCoreAnimationDrawingAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h (244290 => 244291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h       2019-04-15 21:33:58 UTC (rev 244290)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h  2019-04-15 21:34:10 UTC (rev 244291)
</span><span class="lines">@@ -86,7 +86,7 @@
</span><span class="cx"> 
</span><span class="cx">     void attachViewOverlayGraphicsLayer(WebCore::GraphicsLayer*) override;
</span><span class="cx"> 
</span><del>-    bool dispatchDidReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone>) override;
</del><ins>+    bool addMilestonesToDispatch(OptionSet<WebCore::LayoutMilestone> paintMilestones) override;
</ins><span class="cx"> 
</span><span class="cx">     enum class FlushType { Normal, TransientZoom };
</span><span class="cx">     void flushLayers(FlushType = FlushType::Normal);
</span><span class="lines">@@ -125,7 +125,7 @@
</span><span class="cx">     void updateScrolledExposedRect();
</span><span class="cx">     void scaleViewToFitDocumentIfNeeded();
</span><span class="cx"> 
</span><del>-    void sendPendingNewlyReachedLayoutMilestones();
</del><ins>+    void sendPendingNewlyReachedPaintingMilestones();
</ins><span class="cx"> 
</span><span class="cx">     void layerFlushRunLoopCallback();
</span><span class="cx">     void invalidateLayerFlushRunLoopObserver();
</span><span class="lines">@@ -163,7 +163,7 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr<WebCore::GraphicsLayer> m_viewOverlayRootLayer;
</span><span class="cx"> 
</span><del>-    OptionSet<WebCore::LayoutMilestone> m_pendingNewlyReachedLayoutMilestones;
</del><ins>+    OptionSet<WebCore::LayoutMilestone> m_pendingNewlyReachedPaintingMilestones;
</ins><span class="cx">     Vector<CallbackID> m_pendingCallbackIDs;
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr<WebCore::RunLoopObserver> m_layerFlushRunLoopObserver;
</span><span class="lines">@@ -178,6 +178,12 @@
</span><span class="cx">     bool m_needsSendEnterAcceleratedCompositingMode { true };
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+inline bool TiledCoreAnimationDrawingArea::addMilestonesToDispatch(OptionSet<WebCore::LayoutMilestone> paintMilestones)
+{
+    m_pendingNewlyReachedPaintingMilestones.add(paintMilestones);
+    return true;
+}
+
</ins><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_DRAWING_AREA(TiledCoreAnimationDrawingArea, DrawingAreaTypeTiledCoreAnimation)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPagemacTiledCoreAnimationDrawingAreamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (244290 => 244291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm      2019-04-15 21:33:58 UTC (rev 244290)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2019-04-15 21:34:10 UTC (rev 244291)
</span><span class="lines">@@ -436,13 +436,13 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TiledCoreAnimationDrawingArea::sendPendingNewlyReachedLayoutMilestones()
</del><ins>+void TiledCoreAnimationDrawingArea::sendPendingNewlyReachedPaintingMilestones()
</ins><span class="cx"> {
</span><del>-    if (!m_pendingNewlyReachedLayoutMilestones)
</del><ins>+    if (!m_pendingNewlyReachedPaintingMilestones)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_webPage.send(Messages::WebPageProxy::DidReachLayoutMilestone(m_pendingNewlyReachedLayoutMilestones));
-    m_pendingNewlyReachedLayoutMilestones = { };
</del><ins>+    m_webPage.send(Messages::WebPageProxy::DidReachLayoutMilestone(m_pendingNewlyReachedPaintingMilestones));
+    m_pendingNewlyReachedPaintingMilestones = { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TiledCoreAnimationDrawingArea::addTransactionCallbackID(CallbackID callbackID)
</span><span class="lines">@@ -484,7 +484,7 @@
</span><span class="cx">                     corePage->inspectorController().didComposite(*coreFrame);
</span><span class="cx">             }
</span><span class="cx">             if (auto drawingArea = static_cast<TiledCoreAnimationDrawingArea*>(retainedPage->drawingArea()))
</span><del>-                drawingArea->sendPendingNewlyReachedLayoutMilestones();
</del><ins>+                drawingArea->sendPendingNewlyReachedPaintingMilestones();
</ins><span class="cx">         } forPhase:kCATransactionPhasePostCommit];
</span><span class="cx"> 
</span><span class="cx">         bool didFlushAllFrames = m_webPage.mainFrameView()->flushCompositingStateIncludingSubframes();
</span><span class="lines">@@ -931,12 +931,6 @@
</span><span class="cx">     m_layerHostingContext->setFencePort(fencePort.sendRight());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool TiledCoreAnimationDrawingArea::dispatchDidReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone> layoutMilestones)
-{
-    m_pendingNewlyReachedLayoutMilestones.add(layoutMilestones);
-    return true;
-}
-
</del><span class="cx"> void TiledCoreAnimationDrawingArea::layerFlushRunLoopCallback()
</span><span class="cx"> {
</span><span class="cx">     flushLayers();
</span></span></pre>
</div>
</div>

</body>
</html>