⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 245682 in webkit


Ignore:
Timestamp:
May 23, 2019, 8:48:52 AM (7 years ago)
Author:
Simon Fraser
Message:

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:
Location:
trunk
Files:
1 added
5 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r245680 r245682  
     12019-05-23  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Create scrolling tree nodes for descendants of position:absolute inside stacking-context overflow
     4        https://bugs.webkit.org/show_bug.cgi?id=198154
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * 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.
     9        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt:
     10        * 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.
     11        * scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow.html: Added.
     12        * scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt:
     13
    1142019-05-23  Myles C. Maxfield  <mmaxfield@apple.com>
    215
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt

    r245681 r245682  
    1 abs
    2 abs
    31
    42(Frame scrolling node
     
    1816    (Overflow scrolling node
    1917      (scrollable area size 300 300)
    20       (contents size 300 530)
     18      (contents size 300 1000)
    2119      (parent relative scrollable rect at (30,22) size 300x300)
    2220      (scrollable area parameters
     
    3533        (Positioned node
    3634          (layout constraints
    37             (layer-position-at-last-layout (47,55))
     35            (layer-position-at-last-layout (40,48))
    3836            (positioning-behavior stationary))
    3937          (related overflow nodes 1)
  • trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt

    r245170 r245682  
    2626        (vertical scrollbar mode 0)
    2727        (has enabled vertical scrollbar 1))
    28       (children 2
     28      (children 3
    2929        (Positioned node
    3030          (layout constraints
    3131            (layer-position-at-last-layout (20,28))
     32            (positioning-behavior stationary))
     33          (related overflow nodes 1)
     34        )
     35        (Positioned node
     36          (layout constraints
     37            (layer-position-at-last-layout (32,60))
    3238            (positioning-behavior stationary))
    3339          (related overflow nodes 1)
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt

    r245681 r245682  
    1 abs
    2 abs
    31
    42(Frame scrolling node
     
    1816    (Overflow scrolling node
    1917      (scrollable area size 285 285)
    20       (contents size 285 530)
     18      (contents size 285 1000)
    2119      (parent relative scrollable rect at (30,22) size 285x285)
    2220      (scrollable area parameters
     
    3533        (Positioned node
    3634          (layout constraints
    37             (layer-position-at-last-layout (47,55))
     35            (layer-position-at-last-layout (40,48))
    3836            (positioning-behavior stationary))
    3937          (related overflow nodes 1)
  • trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt

    r245170 r245682  
    2626        (vertical scrollbar mode 0)
    2727        (has enabled vertical scrollbar 1))
    28       (children 2
     28      (children 3
    2929        (Positioned node
    3030          (layout constraints
    3131            (layer-position-at-last-layout (20,28))
     32            (positioning-behavior stationary))
     33          (related overflow nodes 1)
     34        )
     35        (Positioned node
     36          (layout constraints
     37            (layer-position-at-last-layout (32,58))
    3238            (positioning-behavior stationary))
    3339          (related overflow nodes 1)
  • trunk/Source/WebCore/ChangeLog

    r245681 r245682  
     12019-05-23  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Create scrolling tree nodes for descendants of position:absolute inside stacking-context overflow
     4        https://bugs.webkit.org/show_bug.cgi?id=198154
     5
     6        Reviewed by Antti Koivisto.
     7       
     8        There exists code that creates scrolling tree nodes for position:absolute when the containing block
     9        chain skips an enclosing scroller, but the compositing ancestor tree includes the scroller. However
     10        this code explicitly checked that the layer was position:absolute.
     11
     12        This needed to be generalized for any layer whose containing block ancestor chain includes
     13        a position:absolute that skips the scroller, for example a transformed inside a position:absolute,
     14        so remove an explicit isAbsolutelyPositioned() check and some similar assertions.
     15
     16        Test: scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow.html
     17
     18        * rendering/RenderLayerCompositor.cpp:
     19        (WebCore::collectStationaryLayerRelatedOverflowNodes):
     20        (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
     21        (WebCore::collectRelatedCoordinatedScrollingNodes):
     22
    1232019-05-23  Adrian Perez de Castro  <aperez@igalia.com>
    224
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r245656 r245682  
    31113111    };
    31123112
    3113     ASSERT(layer.renderer().isAbsolutelyPositioned());
    3114 
    31153113    // 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).
    31163114    bool seenPaintOrderAncestor = false;
     
    31483146    }
    31493147
    3150     bool compositedAncestorIsInsideScroller = false;
    3151     auto* scrollingAncestor = enclosingCompositedScrollingLayer(layer, *compositedAncestor, compositedAncestorIsInsideScroller);
     3148    bool compositedAncestorIsScrolling = false;
     3149    auto* scrollingAncestor = enclosingCompositedScrollingLayer(layer, *compositedAncestor, compositedAncestorIsScrolling);
    31523150    if (!scrollingAncestor) {
    31533151        ASSERT_NOT_REACHED(); // layer.hasCompositedScrollingAncestor() should guarantee we have one.
     
    31583156    // 1. There's a composited overflow:scroll in the parent chain between the renderer and its containing block, and the layer's
    31593157    //    composited (z-order) ancestor is inside the scroller or is the scroller. In this case, we have to compensate for scroll position
    3160     //    changes to make the positioned layer stay in the same place. This only applies to position:absolute (since we handle fixed elsewhere).
    3161     if (layer.renderer().isAbsolutelyPositioned()) {
    3162         if (compositedAncestorIsInsideScroller && isNonScrolledLayerInsideScrolledCompositedAncestor(layer, *compositedAncestor, *scrollingAncestor))
    3163             return ScrollPositioningBehavior::Stationary;
    3164     }
     3158    //    changes to make the positioned layer stay in the same place. This only applies to position:absolute or descendants of position:absolute.
     3159    if (compositedAncestorIsScrolling && isNonScrolledLayerInsideScrolledCompositedAncestor(layer, *compositedAncestor, *scrollingAncestor))
     3160        return ScrollPositioningBehavior::Stationary;
    31653161
    31663162    // 2. The layer's containing block is the overflow or inside the overflow:scroll, but its z-order ancestor is
    31673163    //    outside the overflow:scroll. In that case, we have to move the layer via the scrolling tree to make
    31683164    //    it move along with the overflow scrolling.
    3169     if (!compositedAncestorIsInsideScroller && isScrolledByOverflowScrollLayer(layer, *scrollingAncestor))
     3165    if (!compositedAncestorIsScrolling && isScrolledByOverflowScrollLayer(layer, *scrollingAncestor))
    31703166        return ScrollPositioningBehavior::Moves;
    31713167
     
    31933189    }
    31943190    case ScrollPositioningBehavior::Stationary: {
    3195         ASSERT(layer.renderer().isAbsolutelyPositioned());
    31963191        auto* compositedAncestor = layer.ancestorCompositingLayer();
    31973192        if (!compositedAncestor)
Note: See TracChangeset for help on using the changeset viewer.