<!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>[243209] trunk</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/243209">243209</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2019-03-20 09:32:32 -0700 (Wed, 20 Mar 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>Explicitly trigger compositing for layers that need to be moved by ScrollingTreePositionedNodes
https://bugs.webkit.org/show_bug.cgi?id=195710
Source/WebCore:

<rdar://problem/48867502>

Reviewed by Zalan Bujtas.

A position:absolute layer whose containing block is outside an enclosing overflow:scroll, but
whose compositing ancestor is the overflow or is inside it, needs to be composited so that
we can make a Positioning scrolling tree node for it.

Handle this case as a "OverflowScrollPositioning" indirect compositing reason.

Test: compositing/layer-creation/absolute-in-async-overflow-scroll.html

* inspector/agents/InspectorLayerTreeAgent.cpp:
(WebCore::InspectorLayerTreeAgent::reasonsForCompositingLayer):
* rendering/RenderLayer.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
(WebCore::RenderLayerCompositor::reasonsForCompositing const):
(WebCore::RenderLayerCompositor::logReasonsForCompositing):
(WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
(WebCore::RenderLayerCompositor::layerContainingBlockCrossesCoordinatedScrollingBoundary):
(WebCore::layerContainingBlockCrossesCoordinatedScrollingBoundary): Deleted.
* rendering/RenderLayerCompositor.h: Generalize OverflowScrollingTouch to OverflowScrolling.

LayoutTests:

Reviewed by Zalan Bujtas.

* compositing/layer-creation/absolute-in-async-overflow-scroll-expected.txt: Added.
* compositing/layer-creation/absolute-in-async-overflow-scroll.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformioswk2scrollingcoordinatorscrollingtreepositionednodesexpectedtxt">trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/positioned-nodes-expected.txt</a></li>
<li><a href="#trunkLayoutTestsscrollingcoordinatorscrollingtreepositionednodesexpectedtxt">trunk/LayoutTests/scrollingcoordinator/scrolling-tree/positioned-nodes-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorLayerTreeAgentcpp">trunk/Source/WebCore/inspector/agents/InspectorLayerTreeAgent.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerh">trunk/Source/WebCore/rendering/RenderLayer.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerCompositorcpp">trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerCompositorh">trunk/Source/WebCore/rendering/RenderLayerCompositor.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestscompositinglayercreationabsoluteinasyncoverflowscrollexpectedtxt">trunk/LayoutTests/compositing/layer-creation/absolute-in-async-overflow-scroll-expected.txt</a></li>
<li><a href="#trunkLayoutTestscompositinglayercreationabsoluteinasyncoverflowscrollhtml">trunk/LayoutTests/compositing/layer-creation/absolute-in-async-overflow-scroll.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (243208 => 243209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2019-03-20 16:28:16 UTC (rev 243208)
+++ trunk/LayoutTests/ChangeLog 2019-03-20 16:32:32 UTC (rev 243209)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2019-03-20  Simon Fraser  <simon.fraser@apple.com>
+
+        Explicitly trigger compositing for layers that need to be moved by ScrollingTreePositionedNodes
+        https://bugs.webkit.org/show_bug.cgi?id=195710
+
+        Reviewed by Zalan Bujtas.
+
+        * compositing/layer-creation/absolute-in-async-overflow-scroll-expected.txt: Added.
+        * compositing/layer-creation/absolute-in-async-overflow-scroll.html: Added.
+
</ins><span class="cx"> 2019-03-20  Devin Rousso  <drousso@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Search: allow DOM searches to be case sensitive
</span></span></pre></div>
<a id="trunkLayoutTestscompositinglayercreationabsoluteinasyncoverflowscrollexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/compositing/layer-creation/absolute-in-async-overflow-scroll-expected.txt (0 => 243209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/compositing/layer-creation/absolute-in-async-overflow-scroll-expected.txt                              (rev 0)
+++ trunk/LayoutTests/compositing/layer-creation/absolute-in-async-overflow-scroll-expected.txt 2019-03-20 16:32:32 UTC (rev 243209)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+This layer should be composited.
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (children 1
+        (GraphicsLayer
+          (position 18.00 10.00)
+          (bounds 202.00 202.00)
+          (opacity 0.80)
+          (drawsContent 1)
+          (children 1
+            (GraphicsLayer
+              (offsetFromRenderer width=1 height=1)
+              (position 1.00 1.00)
+              (bounds 200.00 200.00)
+              (children 1
+                (GraphicsLayer
+                  (offsetFromRenderer width=1 height=1)
+                  (anchor 0.00 0.00)
+                  (bounds 200.00 840.00)
+                  (drawsContent 1)
+                  (children 1
+                    (GraphicsLayer
+                      (position 0.00 89.00)
+                      (bounds 320.00 40.00)
+                      (contentsOpaque 1)
+                      (drawsContent 1)
+                    )
+                  )
+                )
+              )
+            )
+          )
+        )
+      )
+    )
+  )
+)
+
</ins></span></pre></div>
<a id="trunkLayoutTestscompositinglayercreationabsoluteinasyncoverflowscrollhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/compositing/layer-creation/absolute-in-async-overflow-scroll.html (0 => 243209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/compositing/layer-creation/absolute-in-async-overflow-scroll.html                              (rev 0)
+++ trunk/LayoutTests/compositing/layer-creation/absolute-in-async-overflow-scroll.html 2019-03-20 16:32:32 UTC (rev 243209)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+    <meta name="viewport" content="width=device-width">
+    <title></title>
+    <style>
+        .scroller {
+            margin: 10px;
+            overflow: scroll;
+            width: 200px;
+            height: 200px;
+            border: 1px solid black;
+            opacity: 0.8;
+        }
+        
+        .absolute {
+            position: absolute;
+            top: 100px;
+            width: 300px;
+            height: 20px;
+            background-color: green;
+            padding: 10px;
+        }
+        
+        .spacer {
+            height: 800px;
+        }
+        
+    </style>
+    <script>
+        if (window.internals)
+            window.internals.settings.setAsyncOverflowScrollingEnabled(true);
+
+        if (window.testRunner)
+            testRunner.dumpAsText();
+
+        window.addEventListener("load", () => {
+            if (window.internals)
+                document.getElementById("layers").innerText = window.internals.layerTreeAsText(document);
+        }, false);
+    </script>
+<body>
+    <div class='scroller'>
+        <div class="spacer">
+        <div class='absolute'>This layer should be composited.</div>
+    </div>
+<pre id="layers">Layer tree goes here</pre>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformioswk2scrollingcoordinatorscrollingtreepositionednodesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/positioned-nodes-expected.txt (243208 => 243209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/positioned-nodes-expected.txt     2019-03-20 16:28:16 UTC (rev 243208)
+++ trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/positioned-nodes-expected.txt        2019-03-20 16:32:32 UTC (rev 243209)
</span><span class="lines">@@ -81,6 +81,14 @@
</span><span class="cx">         (horizontal scrollbar mode 0)
</span><span class="cx">         (vertical scrollbar mode 0)
</span><span class="cx">         (has enabled vertical scrollbar 1))
</span><ins>+      (children 1
+        (Positioned node
+          (layout constraints 
+            (layer-position-at-last-layout (81,30))
+            (positioning-behavior stationary))
+          (related overflow nodes 1)
+        )
+      )
</ins><span class="cx">     )
</span><span class="cx">   )
</span><span class="cx"> )
</span></span></pre></div>
<a id="trunkLayoutTestsscrollingcoordinatorscrollingtreepositionednodesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/scrollingcoordinator/scrolling-tree/positioned-nodes-expected.txt (243208 => 243209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/scrollingcoordinator/scrolling-tree/positioned-nodes-expected.txt      2019-03-20 16:28:16 UTC (rev 243208)
+++ trunk/LayoutTests/scrollingcoordinator/scrolling-tree/positioned-nodes-expected.txt 2019-03-20 16:32:32 UTC (rev 243209)
</span><span class="lines">@@ -82,6 +82,14 @@
</span><span class="cx">         (horizontal scrollbar mode 0)
</span><span class="cx">         (vertical scrollbar mode 0)
</span><span class="cx">         (has enabled vertical scrollbar 1))
</span><ins>+      (children 1
+        (Positioned node
+          (layout constraints 
+            (layer-position-at-last-layout (81,28))
+            (positioning-behavior stationary))
+          (related overflow nodes 1)
+        )
+      )
</ins><span class="cx">     )
</span><span class="cx">   )
</span><span class="cx"> )
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (243208 => 243209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2019-03-20 16:28:16 UTC (rev 243208)
+++ trunk/Source/WebCore/ChangeLog      2019-03-20 16:32:32 UTC (rev 243209)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2019-03-20  Simon Fraser  <simon.fraser@apple.com>
+
+        Explicitly trigger compositing for layers that need to be moved by ScrollingTreePositionedNodes
+        https://bugs.webkit.org/show_bug.cgi?id=195710
+        <rdar://problem/48867502>
+
+        Reviewed by Zalan Bujtas.
+
+        A position:absolute layer whose containing block is outside an enclosing overflow:scroll, but
+        whose compositing ancestor is the overflow or is inside it, needs to be composited so that
+        we can make a Positioning scrolling tree node for it.
+
+        Handle this case as a "OverflowScrollPositioning" indirect compositing reason.
+
+        Test: compositing/layer-creation/absolute-in-async-overflow-scroll.html
+
+        * inspector/agents/InspectorLayerTreeAgent.cpp:
+        (WebCore::InspectorLayerTreeAgent::reasonsForCompositingLayer):
+        * rendering/RenderLayer.h:
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::computeCompositingRequirements):
+        (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
+        (WebCore::RenderLayerCompositor::reasonsForCompositing const):
+        (WebCore::RenderLayerCompositor::logReasonsForCompositing):
+        (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
+        (WebCore::RenderLayerCompositor::layerContainingBlockCrossesCoordinatedScrollingBoundary):
+        (WebCore::layerContainingBlockCrossesCoordinatedScrollingBoundary): Deleted.
+        * rendering/RenderLayerCompositor.h: Generalize OverflowScrollingTouch to OverflowScrolling.
+
</ins><span class="cx"> 2019-03-20  Devin Rousso  <drousso@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Search: allow DOM searches to be case sensitive
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectoragentsInspectorLayerTreeAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/agents/InspectorLayerTreeAgent.cpp (243208 => 243209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/agents/InspectorLayerTreeAgent.cpp        2019-03-20 16:28:16 UTC (rev 243208)
+++ trunk/Source/WebCore/inspector/agents/InspectorLayerTreeAgent.cpp   2019-03-20 16:32:32 UTC (rev 243209)
</span><span class="lines">@@ -276,9 +276,11 @@
</span><span class="cx">     if (reasons.contains(CompositingReason::PositionSticky))
</span><span class="cx">         compositingReasons->setPositionSticky(true);
</span><span class="cx"> 
</span><del>-    if (reasons.contains(CompositingReason::OverflowScrollingTouch))
</del><ins>+    if (reasons.contains(CompositingReason::OverflowScrolling))
</ins><span class="cx">         compositingReasons->setOverflowScrollingTouch(true);
</span><span class="cx"> 
</span><ins>+    // FIXME: handle OverflowScrollPositioning (webkit.org/b/195985).
+
</ins><span class="cx">     if (reasons.contains(CompositingReason::Stacking))
</span><span class="cx">         compositingReasons->setStacking(true);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.h (243208 => 243209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.h     2019-03-20 16:28:16 UTC (rev 243208)
+++ trunk/Source/WebCore/rendering/RenderLayer.h        2019-03-20 16:32:32 UTC (rev 243209)
</span><span class="lines">@@ -1123,6 +1123,7 @@
</span><span class="cx">     enum class IndirectCompositingReason {
</span><span class="cx">         None,
</span><span class="cx">         Stacking,
</span><ins>+        OverflowScrollPositioning,
</ins><span class="cx">         Overlap,
</span><span class="cx">         BackgroundLayer,
</span><span class="cx">         GraphicalEffect, // opacity, mask, filter, transform etc.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerCompositorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (243208 => 243209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2019-03-20 16:28:16 UTC (rev 243208)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp    2019-03-20 16:32:32 UTC (rev 243209)
</span><span class="lines">@@ -955,7 +955,7 @@
</span><span class="cx">     // Now check for reasons to become composited that depend on the state of descendant layers.
</span><span class="cx">     RenderLayer::IndirectCompositingReason indirectCompositingReason;
</span><span class="cx">     if (!willBeComposited && canBeComposited(layer)
</span><del>-        && requiresCompositingForIndirectReason(layer.renderer(), childState.subtreeIsCompositing, anyDescendantHas3DTransform, indirectCompositingReason)) {
</del><ins>+        && requiresCompositingForIndirectReason(layer.renderer(), compositingState.compositingAncestor, childState.subtreeIsCompositing, anyDescendantHas3DTransform, indirectCompositingReason)) {
</ins><span class="cx">         layer.setIndirectCompositingReason(indirectCompositingReason);
</span><span class="cx">         childState.compositingAncestor = &layer;
</span><span class="cx">         overlapMap.pushCompositingContainer();
</span><span class="lines">@@ -2228,6 +2228,7 @@
</span><span class="cx">     if (layer.mustCompositeForIndirectReasons()) {
</span><span class="cx">         RenderLayer::IndirectCompositingReason reason = layer.indirectCompositingReason();
</span><span class="cx">         return reason == RenderLayer::IndirectCompositingReason::Overlap
</span><ins>+            || reason == RenderLayer::IndirectCompositingReason::OverflowScrollPositioning
</ins><span class="cx">             || reason == RenderLayer::IndirectCompositingReason::Stacking
</span><span class="cx">             || reason == RenderLayer::IndirectCompositingReason::BackgroundLayer
</span><span class="cx">             || reason == RenderLayer::IndirectCompositingReason::GraphicalEffect
</span><span class="lines">@@ -2284,7 +2285,7 @@
</span><span class="cx">         reasons.add(renderer.isFixedPositioned() ? CompositingReason::PositionFixed : CompositingReason::PositionSticky);
</span><span class="cx"> 
</span><span class="cx">     if (requiresCompositingForOverflowScrolling(*renderer.layer(), queryData))
</span><del>-        reasons.add(CompositingReason::OverflowScrollingTouch);
</del><ins>+        reasons.add(CompositingReason::OverflowScrolling);
</ins><span class="cx"> 
</span><span class="cx">     switch (renderer.layer()->indirectCompositingReason()) {
</span><span class="cx">     case RenderLayer::IndirectCompositingReason::None:
</span><span class="lines">@@ -2292,6 +2293,9 @@
</span><span class="cx">     case RenderLayer::IndirectCompositingReason::Stacking:
</span><span class="cx">         reasons.add(CompositingReason::Stacking);
</span><span class="cx">         break;
</span><ins>+    case RenderLayer::IndirectCompositingReason::OverflowScrollPositioning:
+        reasons.add(CompositingReason::OverflowScrollPositioning);
+        break;
</ins><span class="cx">     case RenderLayer::IndirectCompositingReason::Overlap:
</span><span class="cx">         reasons.add(CompositingReason::Overlap);
</span><span class="cx">         break;
</span><span class="lines">@@ -2374,8 +2378,8 @@
</span><span class="cx">     if (reasons & CompositingReason::PositionSticky)
</span><span class="cx">         return "position: sticky";
</span><span class="cx"> 
</span><del>-    if (reasons & CompositingReason::OverflowScrollingTouch)
-        return "-webkit-overflow-scrolling: touch";
</del><ins>+    if (reasons & CompositingReason::OverflowScrolling)
+        return "async overflow scrolling";
</ins><span class="cx"> 
</span><span class="cx">     if (reasons & CompositingReason::Stacking)
</span><span class="cx">         return "stacking";
</span><span class="lines">@@ -2766,9 +2770,9 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // FIXME: why doesn't this handle the clipping cases?
</span><del>-bool RenderLayerCompositor::requiresCompositingForIndirectReason(RenderLayerModelObject& renderer, bool hasCompositedDescendants, bool has3DTransformedDescendants, RenderLayer::IndirectCompositingReason& reason) const
</del><ins>+bool RenderLayerCompositor::requiresCompositingForIndirectReason(RenderLayerModelObject& renderer, const RenderLayer* compositingAncestor, bool hasCompositedDescendants, bool has3DTransformedDescendants, RenderLayer::IndirectCompositingReason& reason) const
</ins><span class="cx"> {
</span><del>-    auto& layer = *downcast<RenderBoxModelObject>(renderer).layer();
</del><ins>+    auto& layer = *renderer.layer();
</ins><span class="cx"> 
</span><span class="cx">     // When a layer has composited descendants, some effects, like 2d transforms, filters, masks etc must be implemented
</span><span class="cx">     // via compositing so that they also apply to those composited descendants.
</span><span class="lines">@@ -2791,6 +2795,13 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if (renderer.isAbsolutelyPositioned() && compositingAncestor) {
+        if (layerContainingBlockCrossesCoordinatedScrollingBoundary(layer, *compositingAncestor)) {
+            reason = RenderLayer::IndirectCompositingReason::OverflowScrollPositioning;
+            return true;
+        }
+    }
+
</ins><span class="cx">     reason = RenderLayer::IndirectCompositingReason::None;
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="lines">@@ -2892,10 +2903,9 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Is this layer's containingBlock an ancestor of scrollable overflow, and is the layer's compositing ancestor inside that overflow?
</span><del>-static bool layerContainingBlockCrossesCoordinatedScrollingBoundary(const RenderLayer& layer, const RenderLayer& compositedAncestor)
</del><ins>+bool RenderLayerCompositor::layerContainingBlockCrossesCoordinatedScrollingBoundary(const RenderLayer& layer, const RenderLayer& compositedAncestor)
</ins><span class="cx"> {
</span><del>-    ASSERT(layer.isComposited());
-    ASSERT(layer.renderer().style().position() == PositionType::Absolute);
</del><ins>+    ASSERT(layer.renderer().isAbsolutelyPositioned());
</ins><span class="cx"> 
</span><span class="cx">     bool sawCompositingAncestor = false;
</span><span class="cx">     for (const auto* currLayer = layer.parent(); currLayer; currLayer = currLayer->parent()) {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerCompositorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.h (243208 => 243209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerCompositor.h   2019-03-20 16:28:16 UTC (rev 243208)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.h      2019-03-20 16:32:32 UTC (rev 243209)
</span><span class="lines">@@ -65,22 +65,23 @@
</span><span class="cx">     Filters                                = 1 << 8,
</span><span class="cx">     PositionFixed                          = 1 << 9,
</span><span class="cx">     PositionSticky                         = 1 << 10,
</span><del>-    OverflowScrollingTouch                 = 1 << 11,
</del><ins>+    OverflowScrolling                      = 1 << 11,
</ins><span class="cx">     Stacking                               = 1 << 12,
</span><span class="cx">     Overlap                                = 1 << 13,
</span><del>-    NegativeZIndexChildren                 = 1 << 14,
-    TransformWithCompositedDescendants     = 1 << 15,
-    OpacityWithCompositedDescendants       = 1 << 16,
-    MaskWithCompositedDescendants          = 1 << 17,
-    ReflectionWithCompositedDescendants    = 1 << 18,
-    FilterWithCompositedDescendants        = 1 << 19,
-    BlendingWithCompositedDescendants      = 1 << 20,
-    Perspective                            = 1 << 21,
-    Preserve3D                             = 1 << 22,
-    WillChange                             = 1 << 23,
-    Root                                   = 1 << 24,
-    IsolatesCompositedBlendingDescendants  = 1 << 25,
-    EmbeddedView                           = 1 << 26,
</del><ins>+    OverflowScrollPositioning              = 1 << 14,
+    NegativeZIndexChildren                 = 1 << 15,
+    TransformWithCompositedDescendants     = 1 << 16,
+    OpacityWithCompositedDescendants       = 1 << 17,
+    MaskWithCompositedDescendants          = 1 << 18,
+    ReflectionWithCompositedDescendants    = 1 << 19,
+    FilterWithCompositedDescendants        = 1 << 20,
+    BlendingWithCompositedDescendants      = 1 << 21,
+    Perspective                            = 1 << 22,
+    Preserve3D                             = 1 << 23,
+    WillChange                             = 1 << 24,
+    Root                                   = 1 << 25,
+    IsolatesCompositedBlendingDescendants  = 1 << 26,
+    EmbeddedView                           = 1 << 27,
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> enum class ScrollCoordinationRole {
</span><span class="lines">@@ -475,8 +476,10 @@
</span><span class="cx">     bool requiresCompositingForPosition(RenderLayerModelObject&, const RenderLayer&, RequiresCompositingData&) const;
</span><span class="cx">     bool requiresCompositingForOverflowScrolling(const RenderLayer&, RequiresCompositingData&) const;
</span><span class="cx">     bool requiresCompositingForEditableImage(RenderLayerModelObject&) const;
</span><del>-    bool requiresCompositingForIndirectReason(RenderLayerModelObject&, bool hasCompositedDescendants, bool has3DTransformedDescendants, RenderLayer::IndirectCompositingReason&) const;
</del><ins>+    bool requiresCompositingForIndirectReason(RenderLayerModelObject&, const RenderLayer* compositingAncestor, bool hasCompositedDescendants, bool has3DTransformedDescendants, RenderLayer::IndirectCompositingReason&) const;
</ins><span class="cx"> 
</span><ins>+    static bool layerContainingBlockCrossesCoordinatedScrollingBoundary(const RenderLayer&, const RenderLayer& compositedAncestor);
+
</ins><span class="cx">     static bool styleChangeMayAffectIndirectCompositingReasons(const RenderStyle& oldStyle, const RenderStyle& newStyle);
</span><span class="cx"> 
</span><span class="cx">     enum class ScrollingNodeChangeFlags {
</span></span></pre>
</div>
</div>

</body>
</html>