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

Changeset 245854 in webkit


Ignore:
Timestamp:
May 29, 2019, 10:41:28 AM (7 years ago)
Author:
Antti Koivisto
Message:

Scrolling node ordering wrong when a layer has both positioning and fixed/sticky node
https://bugs.webkit.org/show_bug.cgi?id=198329

Reviewed by Darin Adler.

Source/WebCore:

Test: scrollingcoordinator/scrolling-tree/sticky-in-overflow.html

With sticky positioning in non-stacking context overflow you currently get structure like

FrameScrollingNode

OverflowScrollingNode
StickyNode

PositionedNode

where StickyNode and PositionedNode reference the same layer. Sticky doesn't get applied at all when the overflow moves.

This patch reverses the order of sticky and positioned. It doesn't fix sticky positioning during scrolling yet,
but it does make it less jumpy. It is a prerequisite for the full fix.

  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):

LayoutTests:

  • platform/ios-wk2/scrollingcoordinator/scrolling-tree/sticky-in-overflow-expected.txt: Added.
  • scrollingcoordinator/scrolling-tree/sticky-in-overflow-expected.txt: Added.
  • scrollingcoordinator/scrolling-tree/sticky-in-overflow.html: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r245848 r245854  
     12019-05-29  Antti Koivisto  <antti@apple.com>
     2
     3        Scrolling node ordering wrong when a layer has both positioning and fixed/sticky node
     4        https://bugs.webkit.org/show_bug.cgi?id=198329
     5
     6        Reviewed by Darin Adler.
     7
     8        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/sticky-in-overflow-expected.txt: Added.
     9        * scrollingcoordinator/scrolling-tree/sticky-in-overflow-expected.txt: Added.
     10        * scrollingcoordinator/scrolling-tree/sticky-in-overflow.html: Added.
     11
    1122019-05-28  Yacine Bandou  <yacine.bandou@softathome.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r245853 r245854  
     12019-05-29  Antti Koivisto  <antti@apple.com>
     2
     3        Scrolling node ordering wrong when a layer has both positioning and fixed/sticky node
     4        https://bugs.webkit.org/show_bug.cgi?id=198329
     5
     6        Reviewed by Darin Adler.
     7
     8        Test: scrollingcoordinator/scrolling-tree/sticky-in-overflow.html
     9
     10        With sticky positioning in non-stacking context overflow you currently get structure like
     11
     12        FrameScrollingNode
     13          OverflowScrollingNode
     14          StickyNode
     15            PositionedNode
     16
     17        where StickyNode and PositionedNode reference the same layer. Sticky doesn't get applied at all when the overflow moves.
     18
     19        This patch reverses the order of sticky and positioned. It doesn't fix sticky positioning during scrolling yet,
     20        but it does make it less jumpy. It is a prerequisite for the full fix.
     21
     22        * rendering/RenderLayerCompositor.cpp:
     23        (WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
     24
    1252019-05-29  Ludovico de Nittis  <ludovico.denittis@collabora.com>
    226
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r245786 r245854  
    42124212    ScrollingTreeState* currentTreeState = &treeState;
    42134213
     4214    // If there's a positioning node, it's the parent scrolling node for fixed/sticky/scrolling/frame hosting.
     4215    if (roles.contains(ScrollCoordinationRole::Positioning)) {
     4216        newNodeID = updateScrollingNodeForPositioningRole(layer, *currentTreeState, changes);
     4217        childTreeState.parentNodeID = newNodeID;
     4218        currentTreeState = &childTreeState;
     4219    } else
     4220        detachScrollCoordinatedLayer(layer, ScrollCoordinationRole::Positioning);
     4221
    42144222    // If is fixed or sticky, it's the parent scrolling node for scrolling/frame hosting.
    42154223    if (roles.contains(ScrollCoordinationRole::ViewportConstrained)) {
     
    42204228    } else
    42214229        detachScrollCoordinatedLayer(layer, ScrollCoordinationRole::ViewportConstrained);
    4222 
    4223     // If there's a positioning node, it's the parent scrolling node for scrolling/frame hosting.
    4224     if (roles.contains(ScrollCoordinationRole::Positioning)) {
    4225         newNodeID = updateScrollingNodeForPositioningRole(layer, *currentTreeState, changes);
    4226         childTreeState.parentNodeID = newNodeID;
    4227         currentTreeState = &childTreeState;
    4228     } else
    4229         detachScrollCoordinatedLayer(layer, ScrollCoordinationRole::Positioning);
    42304230
    42314231    if (roles.contains(ScrollCoordinationRole::Scrolling))
Note: See TracChangeset for help on using the changeset viewer.