<!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>[245682] 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/245682">245682</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2019-05-23 08:48:52 -0700 (Thu, 23 May 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>Create scrolling tree nodes for descendants of position:absolute inside stacking-context overflow
https://bugs.webkit.org/show_bug.cgi?id=198154

Reviewed by Antti Koivisto.
Source/WebCore:

There exists code that creates scrolling tree nodes for position:absolute when the containing block
chain skips an enclosing scroller, but the compositing ancestor tree includes the scroller. However
this code explicitly checked that the layer was position:absolute.

This needed to be generalized for any layer whose containing block ancestor chain includes
a position:absolute that skips the scroller, for example a transformed inside a position:absolute,
so remove an explicit isAbsolutelyPositioned() check and some similar assertions.

Test: scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow.html

* rendering/RenderLayerCompositor.cpp:
(WebCore::collectStationaryLayerRelatedOverflowNodes):
(WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
(WebCore::collectRelatedCoordinatedScrollingNodes):

LayoutTests:

* platform/ios-wk2/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt: Copied from LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt.
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt:
* scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt: Copied from LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt.
* scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow.html: Added.
* scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformioswk2scrollingcoordinatorscrollingtreenestedabsoluteinscoverflowexpectedtxt">trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt</a></li>
<li><a href="#trunkLayoutTestsscrollingcoordinatorscrollingtreenestedabsoluteinscoverflowexpectedtxt">trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerCompositorcpp">trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsplatformioswk2scrollingcoordinatorscrollingtreecompositedinabsoluteinstackingcontextoverflowexpectedtxt">trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt</a></li>
<li><a href="#trunkLayoutTestsscrollingcoordinatorscrollingtreecompositedinabsoluteinstackingcontextoverflowexpectedtxt">trunk/LayoutTests/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt</a></li>
<li><a href="#trunkLayoutTestsscrollingcoordinatorscrollingtreecompositedinabsoluteinstackingcontextoverflowhtml">trunk/LayoutTests/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (245681 => 245682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2019-05-23 15:47:10 UTC (rev 245681)
+++ trunk/LayoutTests/ChangeLog 2019-05-23 15:48:52 UTC (rev 245682)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2019-05-23  Simon Fraser  <simon.fraser@apple.com>
+
+        Create scrolling tree nodes for descendants of position:absolute inside stacking-context overflow
+        https://bugs.webkit.org/show_bug.cgi?id=198154
+
+        Reviewed by Antti Koivisto.
+
+        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt: Copied from LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt.
+        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt:
+        * scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt: Copied from LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt.
+        * scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow.html: Added.
+        * scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt:
+
</ins><span class="cx"> 2019-05-23  Myles C. Maxfield  <mmaxfield@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [WHLSL] Implement property resolver
</span></span></pre></div>
<a id="trunkLayoutTestsplatformioswk2scrollingcoordinatorscrollingtreecompositedinabsoluteinstackingcontextoverflowexpectedtxtfromrev245681trunkLayoutTestsplatformioswk2scrollingcoordinatorscrollingtreenestedabsoluteinscoverflowexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt (from rev 245681, trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt) (0 => 245682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt                          (rev 0)
+++ trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt     2019-05-23 15:48:52 UTC (rev 245682)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+
+(Frame scrolling node
+  (scrollable area size 800 600)
+  (contents size 800 600)
+  (parent relative scrollable rect at (0,0) size 800x600)
+  (scrollable area parameters 
+    (horizontal scroll elasticity 1)
+    (vertical scroll elasticity 1)
+    (horizontal scrollbar mode 0)
+    (vertical scrollbar mode 0))
+  (layout viewport at (0,0) size 800x600)
+  (min layout viewport origin (0,0))
+  (max layout viewport origin (0,0))
+  (behavior for fixed 0)
+  (children 1
+    (Overflow scrolling node
+      (scrollable area size 300 300)
+      (contents size 300 1000)
+      (parent relative scrollable rect at (30,22) size 300x300)
+      (scrollable area parameters 
+        (horizontal scroll elasticity 1)
+        (vertical scroll elasticity 1)
+        (horizontal scrollbar mode 0)
+        (vertical scrollbar mode 0)
+        (has enabled vertical scrollbar 1))
+      (children 2
+        (Positioned node
+          (layout constraints 
+            (layer-position-at-last-layout (20,28))
+            (positioning-behavior stationary))
+          (related overflow nodes 1)
+        )
+        (Positioned node
+          (layout constraints 
+            (layer-position-at-last-layout (40,48))
+            (positioning-behavior stationary))
+          (related overflow nodes 1)
+        )
+      )
+    )
+  )
+)
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformioswk2scrollingcoordinatorscrollingtreenestedabsoluteinscoverflowexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt (245681 => 245682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt       2019-05-23 15:47:10 UTC (rev 245681)
+++ trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt  2019-05-23 15:48:52 UTC (rev 245682)
</span><span class="lines">@@ -25,7 +25,7 @@
</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><del>-      (children 2
</del><ins>+      (children 3
</ins><span class="cx">         (Positioned node
</span><span class="cx">           (layout constraints 
</span><span class="cx">             (layer-position-at-last-layout (20,28))
</span><span class="lines">@@ -34,6 +34,12 @@
</span><span class="cx">         )
</span><span class="cx">         (Positioned node
</span><span class="cx">           (layout constraints 
</span><ins>+            (layer-position-at-last-layout (32,60))
+            (positioning-behavior stationary))
+          (related overflow nodes 1)
+        )
+        (Positioned node
+          (layout constraints 
</ins><span class="cx">             (layer-position-at-last-layout (47,55))
</span><span class="cx">             (positioning-behavior stationary))
</span><span class="cx">           (related overflow nodes 1)
</span></span></pre></div>
<a id="trunkLayoutTestsscrollingcoordinatorscrollingtreecompositedinabsoluteinstackingcontextoverflowexpectedtxtfromrev245681trunkLayoutTestsscrollingcoordinatorscrollingtreenestedabsoluteinscoverflowexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt (from rev 245681, trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt) (0 => 245682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt                           (rev 0)
+++ trunk/LayoutTests/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt      2019-05-23 15:48:52 UTC (rev 245682)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+
+(Frame scrolling node
+  (scrollable area size 800 600)
+  (contents size 800 600)
+  (parent relative scrollable rect at (0,0) size 800x600)
+  (scrollable area parameters 
+    (horizontal scroll elasticity 2)
+    (vertical scroll elasticity 2)
+    (horizontal scrollbar mode 0)
+    (vertical scrollbar mode 0))
+  (layout viewport at (0,0) size 800x600)
+  (min layout viewport origin (0,0))
+  (max layout viewport origin (0,0))
+  (behavior for fixed 0)
+  (children 1
+    (Overflow scrolling node
+      (scrollable area size 285 285)
+      (contents size 285 1000)
+      (parent relative scrollable rect at (30,22) size 285x285)
+      (scrollable area parameters 
+        (horizontal scroll elasticity 0)
+        (vertical scroll elasticity 0)
+        (horizontal scrollbar mode 0)
+        (vertical scrollbar mode 0)
+        (has enabled vertical scrollbar 1))
+      (children 2
+        (Positioned node
+          (layout constraints 
+            (layer-position-at-last-layout (20,28))
+            (positioning-behavior stationary))
+          (related overflow nodes 1)
+        )
+        (Positioned node
+          (layout constraints 
+            (layer-position-at-last-layout (40,48))
+            (positioning-behavior stationary))
+          (related overflow nodes 1)
+        )
+      )
+    )
+  )
+)
+
</ins></span></pre></div>
<a id="trunkLayoutTestsscrollingcoordinatorscrollingtreecompositedinabsoluteinstackingcontextoverflowhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow.html (0 => 245682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow.html                           (rev 0)
+++ trunk/LayoutTests/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow.html      2019-05-23 15:48:52 UTC (rev 245682)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true ] -->
+<html>
+<head>
+    <title>Tests that we make a scrolling tree node for composited layers nested inside position:absolute in a stacking-context scroller</title>
+    <style>
+        .scroller {
+            overflow: scroll;
+            margin: 20px;
+            height: 300px;
+            width: 300px;
+            border: 2px solid black;
+            opacity: 0.9;
+        }
+
+        .absolute {
+            position:absolute;
+            left: 50px;
+            top: 50px;
+            width: 200px;
+            height: 120px;
+            padding: 20px;
+            background: gray;
+        }
+        
+        .composited {
+            transform: translateZ(0);
+            width: 100px;
+            height: 100px;
+            background-color: green;
+        }
+        
+        .spacer {
+            height: 500px;
+            width: 10px;
+            background-image: repeating-linear-gradient(to bottom, white, silver 200px);
+        }
+    </style>
+    <script>
+        if (window.testRunner)
+            testRunner.dumpAsText();
+
+        window.addEventListener('load', () => {
+            if (window.internals)
+                document.getElementById('tree').innerText = internals.scrollingStateTreeAsText();
+        }, false);
+    </script>
+</head>
+<body>
+    <div class="scroller">
+        <div class="spacer"></div>
+        <div class="absolute">
+            <div class="composited box"></div>
+        </div>
+        <div class="spacer"></div>
+    </div>
+<pre id="tree"></pre>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsscrollingcoordinatorscrollingtreenestedabsoluteinscoverflowexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt (245681 => 245682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt        2019-05-23 15:47:10 UTC (rev 245681)
+++ trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt   2019-05-23 15:48:52 UTC (rev 245682)
</span><span class="lines">@@ -25,7 +25,7 @@
</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><del>-      (children 2
</del><ins>+      (children 3
</ins><span class="cx">         (Positioned node
</span><span class="cx">           (layout constraints 
</span><span class="cx">             (layer-position-at-last-layout (20,28))
</span><span class="lines">@@ -34,6 +34,12 @@
</span><span class="cx">         )
</span><span class="cx">         (Positioned node
</span><span class="cx">           (layout constraints 
</span><ins>+            (layer-position-at-last-layout (32,58))
+            (positioning-behavior stationary))
+          (related overflow nodes 1)
+        )
+        (Positioned node
+          (layout constraints 
</ins><span class="cx">             (layer-position-at-last-layout (47,55))
</span><span class="cx">             (positioning-behavior stationary))
</span><span class="cx">           (related overflow nodes 1)
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (245681 => 245682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2019-05-23 15:47:10 UTC (rev 245681)
+++ trunk/Source/WebCore/ChangeLog      2019-05-23 15:48:52 UTC (rev 245682)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2019-05-23  Simon Fraser  <simon.fraser@apple.com>
+
+        Create scrolling tree nodes for descendants of position:absolute inside stacking-context overflow
+        https://bugs.webkit.org/show_bug.cgi?id=198154
+
+        Reviewed by Antti Koivisto.
+        
+        There exists code that creates scrolling tree nodes for position:absolute when the containing block
+        chain skips an enclosing scroller, but the compositing ancestor tree includes the scroller. However
+        this code explicitly checked that the layer was position:absolute.
+
+        This needed to be generalized for any layer whose containing block ancestor chain includes
+        a position:absolute that skips the scroller, for example a transformed inside a position:absolute,
+        so remove an explicit isAbsolutelyPositioned() check and some similar assertions.
+
+        Test: scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow.html
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::collectStationaryLayerRelatedOverflowNodes):
+        (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
+        (WebCore::collectRelatedCoordinatedScrollingNodes):
+
</ins><span class="cx"> 2019-05-23  Adrian Perez de Castro  <aperez@igalia.com>
</span><span class="cx"> 
</span><span class="cx">         Fix a few missing header inclusions often masked by by unified sources
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerCompositorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (245681 => 245682)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2019-05-23 15:47:10 UTC (rev 245681)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp    2019-05-23 15:48:52 UTC (rev 245682)
</span><span class="lines">@@ -3110,8 +3110,6 @@
</span><span class="cx">             LOG(Scrolling, "Layer %p doesn't have scrolling node ID yet", &overflowLayer);
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    ASSERT(layer.renderer().isAbsolutelyPositioned());
-
</del><span class="cx">     // Collect all the composited scrollers which affect the position of this layer relative to its compositing ancestor (which might be inside the scroller or the scroller itself).
</span><span class="cx">     bool seenPaintOrderAncestor = false;
</span><span class="cx">     traverseAncestorLayers(layer, [&](const RenderLayer& ancestorLayer, bool isContainingBlockChain, bool isPaintOrderAncestor) {
</span><span class="lines">@@ -3147,8 +3145,8 @@
</span><span class="cx">         return ScrollPositioningBehavior::None;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    bool compositedAncestorIsInsideScroller = false;
-    auto* scrollingAncestor = enclosingCompositedScrollingLayer(layer, *compositedAncestor, compositedAncestorIsInsideScroller);
</del><ins>+    bool compositedAncestorIsScrolling = false;
+    auto* scrollingAncestor = enclosingCompositedScrollingLayer(layer, *compositedAncestor, compositedAncestorIsScrolling);
</ins><span class="cx">     if (!scrollingAncestor) {
</span><span class="cx">         ASSERT_NOT_REACHED(); // layer.hasCompositedScrollingAncestor() should guarantee we have one.
</span><span class="cx">         return ScrollPositioningBehavior::None;
</span><span class="lines">@@ -3157,16 +3155,14 @@
</span><span class="cx">     // There are two cases we have to deal with here:
</span><span class="cx">     // 1. There's a composited overflow:scroll in the parent chain between the renderer and its containing block, and the layer's
</span><span class="cx">     //    composited (z-order) ancestor is inside the scroller or is the scroller. In this case, we have to compensate for scroll position
</span><del>-    //    changes to make the positioned layer stay in the same place. This only applies to position:absolute (since we handle fixed elsewhere).
-    if (layer.renderer().isAbsolutelyPositioned()) {
-        if (compositedAncestorIsInsideScroller && isNonScrolledLayerInsideScrolledCompositedAncestor(layer, *compositedAncestor, *scrollingAncestor))
-            return ScrollPositioningBehavior::Stationary;
-    }
</del><ins>+    //    changes to make the positioned layer stay in the same place. This only applies to position:absolute or descendants of position:absolute.
+    if (compositedAncestorIsScrolling && isNonScrolledLayerInsideScrolledCompositedAncestor(layer, *compositedAncestor, *scrollingAncestor))
+        return ScrollPositioningBehavior::Stationary;
</ins><span class="cx"> 
</span><span class="cx">     // 2. The layer's containing block is the overflow or inside the overflow:scroll, but its z-order ancestor is
</span><span class="cx">     //    outside the overflow:scroll. In that case, we have to move the layer via the scrolling tree to make
</span><span class="cx">     //    it move along with the overflow scrolling.
</span><del>-    if (!compositedAncestorIsInsideScroller && isScrolledByOverflowScrollLayer(layer, *scrollingAncestor))
</del><ins>+    if (!compositedAncestorIsScrolling && isScrolledByOverflowScrollLayer(layer, *scrollingAncestor))
</ins><span class="cx">         return ScrollPositioningBehavior::Moves;
</span><span class="cx"> 
</span><span class="cx">     return ScrollPositioningBehavior::None;
</span><span class="lines">@@ -3192,7 +3188,6 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx">     case ScrollPositioningBehavior::Stationary: {
</span><del>-        ASSERT(layer.renderer().isAbsolutelyPositioned());
</del><span class="cx">         auto* compositedAncestor = layer.ancestorCompositingLayer();
</span><span class="cx">         if (!compositedAncestor)
</span><span class="cx">             return overflowNodeData;
</span></span></pre>
</div>
</div>

</body>
</html>