WebKit Bugzilla
Attachment 370482 Details for
Bug 198154
: Create scrolling tree nodes for descendants of position:absolute inside stacking-context overflow
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198154-20190522211514.patch (text/plain), 14.93 KB, created by
Simon Fraser (smfr)
on 2019-05-22 21:15:15 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2019-05-22 21:15:15 PDT
Size:
14.93 KB
patch
obsolete
>Subversion Revision: 245659 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index bcfc865013f732576f3f54674e56355a5777e82d..d493976dae96c5ce12d37e790911e8885649d513 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,25 @@ >+2019-05-22 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 NOBODY (OOPS!). >+ >+ 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): >+ > 2019-05-22 Simon Fraser <simon.fraser@apple.com> > > Fix scrolling tree state for more obscure combinations of positioning and paint order >diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp >index 1c61b49115dc8f209fa36cb43fdb5495c54e39de..cae45f83982e7ad6d0d980307fe5d8307adc00a5 100644 >--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp >+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp >@@ -3110,8 +3110,6 @@ static void collectStationaryLayerRelatedOverflowNodes(const RenderLayer& layer, > LOG(Scrolling, "Layer %p doesn't have scrolling node ID yet", &overflowLayer); > }; > >- ASSERT(layer.renderer().isAbsolutelyPositioned()); >- > // 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). > bool seenPaintOrderAncestor = false; > traverseAncestorLayers(layer, [&](const RenderLayer& ancestorLayer, bool isContainingBlockChain, bool isPaintOrderAncestor) { >@@ -3147,8 +3145,8 @@ ScrollPositioningBehavior RenderLayerCompositor::computeCoordinatedPositioningFo > return ScrollPositioningBehavior::None; > } > >- bool compositedAncestorIsInsideScroller = false; >- auto* scrollingAncestor = enclosingCompositedScrollingLayer(layer, *compositedAncestor, compositedAncestorIsInsideScroller); >+ bool compositedAncestorIsScrolling = false; >+ auto* scrollingAncestor = enclosingCompositedScrollingLayer(layer, *compositedAncestor, compositedAncestorIsScrolling); > if (!scrollingAncestor) { > ASSERT_NOT_REACHED(); // layer.hasCompositedScrollingAncestor() should guarantee we have one. > return ScrollPositioningBehavior::None; >@@ -3157,16 +3155,14 @@ ScrollPositioningBehavior RenderLayerCompositor::computeCoordinatedPositioningFo > // There are two cases we have to deal with here: > // 1. There's a composited overflow:scroll in the parent chain between the renderer and its containing block, and the layer's > // composited (z-order) ancestor is inside the scroller or is the scroller. In this case, we have to compensate for scroll position >- // 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; >- } >+ // 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; > > // 2. The layer's containing block is the overflow or inside the overflow:scroll, but its z-order ancestor is > // outside the overflow:scroll. In that case, we have to move the layer via the scrolling tree to make > // it move along with the overflow scrolling. >- if (!compositedAncestorIsInsideScroller && isScrolledByOverflowScrollLayer(layer, *scrollingAncestor)) >+ if (!compositedAncestorIsScrolling && isScrolledByOverflowScrollLayer(layer, *scrollingAncestor)) > return ScrollPositioningBehavior::Moves; > > return ScrollPositioningBehavior::None; >@@ -3192,7 +3188,6 @@ static Vector<ScrollingNodeID> collectRelatedCoordinatedScrollingNodes(const Ren > break; > } > case ScrollPositioningBehavior::Stationary: { >- ASSERT(layer.renderer().isAbsolutelyPositioned()); > auto* compositedAncestor = layer.ancestorCompositingLayer(); > if (!compositedAncestor) > return overflowNodeData; >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 1df60b48c2f4e004360becf96b1d7a07da931a3a..c493086d8890995c6b4f156b6fb6dc35eeca6a8d 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2019-05-22 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 NOBODY (OOPS!). >+ >+ * 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: >+ > 2019-05-22 Simon Fraser <simon.fraser@apple.com> > > <rdar://problem/50058173> REGRESSION (r243347) Layout tests fast/events/touch/ios/drag-block-without-overflow-scroll-and-passive-observer-on* are failing >diff --git a/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt b/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..14f4bfc8db96cab54d9c4eb1438a2132687eca94 >--- /dev/null >+++ b/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt >@@ -0,0 +1,43 @@ >+ >+(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) >+ ) >+ ) >+ ) >+ ) >+) >+ >diff --git a/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt b/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt >index 45cb0eb0664ec4c56dc420219e6c330f0e0e104d..208a7bd5966ffa94bfbbaea98acd4e5fda3afdb6 100644 >--- a/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt >+++ b/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt >@@ -25,13 +25,19 @@ abs > (horizontal scrollbar mode 0) > (vertical scrollbar mode 0) > (has enabled vertical scrollbar 1)) >- (children 2 >+ (children 3 > (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 (32,60)) >+ (positioning-behavior stationary)) >+ (related overflow nodes 1) >+ ) > (Positioned node > (layout constraints > (layer-position-at-last-layout (47,55)) >diff --git a/LayoutTests/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt b/LayoutTests/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..b11f860dfb3f5ca2d68f0b0c9d5e1827da61e4ca >--- /dev/null >+++ b/LayoutTests/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt >@@ -0,0 +1,43 @@ >+ >+(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) >+ ) >+ ) >+ ) >+ ) >+) >+ >diff --git a/LayoutTests/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow.html b/LayoutTests/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow.html >new file mode 100644 >index 0000000000000000000000000000000000000000..49f48a8dc7e0324ef7cea575397ce84370e768cd >--- /dev/null >+++ b/LayoutTests/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow.html >@@ -0,0 +1,58 @@ >+<!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> >diff --git a/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt b/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt >index 80aeb63a12db389e0a9d42dfdcaa454ba59ebe22..f5913a72d66897b9a0975ff70d25e59442794a1a 100644 >--- a/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt >+++ b/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt >@@ -25,13 +25,19 @@ abs > (horizontal scrollbar mode 0) > (vertical scrollbar mode 0) > (has enabled vertical scrollbar 1)) >- (children 2 >+ (children 3 > (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 (32,58)) >+ (positioning-behavior stationary)) >+ (related overflow nodes 1) >+ ) > (Positioned node > (layout constraints > (layer-position-at-last-layout (47,55))
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198154
: 370482