Changeset 182799 in webkit


Ignore:
Timestamp:
Apr 14, 2015 10:25:31 AM (9 years ago)
Author:
Simon Fraser
Message:

[iOS WK2] Interactive elements of developer.apple.com are broken
https://bugs.webkit.org/show_bug.cgi?id=143692
Source/WebCore:

rdar://problem/19320087

Reviewed by Sam Weinig.

When a composited RenderLayer had nodes in the scrolling tree by virtue of
both position and overflow:scroll, and one of those reasons disappeared,
we'd fail to remove the corresponding node from the scrolling tree. This
could leave an overflow:scroll element behaving as if it were position:fixed.

Fix by having RenderLayerCompositor::updateScrollCoordinationForThisFrame()
detach the layer on a per-role basis.

Test: platform/ios-simulator-wk2/scrolling/remove-scrolling-role.html

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::detachFromScrollingCoordinatorForRole):

  • rendering/RenderLayerBacking.h:
  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerForRole):
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer): Just moved.
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Call detachScrollCoordinatedLayerForRole()
if the layer doesn't have the relevant scrolling reasons.

  • rendering/RenderLayerCompositor.h:

LayoutTests:

Reviewed by Sam Weinig.

  • platform/ios-simulator-wk2/scrolling/remove-scrolling-role-expected.txt: Added.
  • platform/ios-simulator-wk2/scrolling/remove-scrolling-role.html: Added.
Location:
trunk
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r182797 r182799  
     12015-04-13  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS WK2] Interactive elements of developer.apple.com are broken
     4        https://bugs.webkit.org/show_bug.cgi?id=143692
     5
     6        Reviewed by Sam Weinig.
     7
     8        * platform/ios-simulator-wk2/scrolling/remove-scrolling-role-expected.txt: Added.
     9        * platform/ios-simulator-wk2/scrolling/remove-scrolling-role.html: Added.
     10
    1112015-04-14  Commit Queue  <commit-queue@webkit.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r182797 r182799  
     12015-04-13  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS WK2] Interactive elements of developer.apple.com are broken
     4        https://bugs.webkit.org/show_bug.cgi?id=143692
     5        rdar://problem/19320087
     6
     7        Reviewed by Sam Weinig.
     8       
     9        When a composited RenderLayer had nodes in the scrolling tree by virtue of
     10        both position and overflow:scroll, and one of those reasons disappeared,
     11        we'd fail to remove the corresponding node from the scrolling tree. This
     12        could leave an overflow:scroll element behaving as if it were position:fixed.
     13       
     14        Fix by having RenderLayerCompositor::updateScrollCoordinationForThisFrame()
     15        detach the layer on a per-role basis.
     16
     17        Test: platform/ios-simulator-wk2/scrolling/remove-scrolling-role.html
     18
     19        * rendering/RenderLayerBacking.cpp:
     20        (WebCore::RenderLayerBacking::detachFromScrollingCoordinatorForRole):
     21        * rendering/RenderLayerBacking.h:
     22        * rendering/RenderLayerCompositor.cpp:
     23        (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerForRole):
     24        (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer): Just moved.
     25        (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Call detachScrollCoordinatedLayerForRole()
     26        if the layer doesn't have the relevant scrolling reasons.
     27        * rendering/RenderLayerCompositor.h:
     28
    1292015-04-14  Commit Queue  <commit-queue@webkit.org>
    230
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r182132 r182799  
    15711571}
    15721572
     1573void RenderLayerBacking::detachFromScrollingCoordinatorForRole(ScrollingNodeType role)
     1574{
     1575    ScrollingNodeID nodeID = scrollingNodeIDForRole(role);
     1576    if (!nodeID)
     1577        return;
     1578
     1579    ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLayer(m_owningLayer);
     1580    if (!scrollingCoordinator)
     1581        return;
     1582
     1583    scrollingCoordinator->detachFromStateTree(nodeID);
     1584    setScrollingNodeIDForRole(0, role);
     1585}
     1586
    15731587GraphicsLayerPaintingPhase RenderLayerBacking::paintingPhaseForPrimaryLayer() const
    15741588{
  • trunk/Source/WebCore/rendering/RenderLayerBacking.h

    r180965 r182799  
    109109
    110110    void detachFromScrollingCoordinator();
     111    void detachFromScrollingCoordinatorForRole(ScrollingNodeType);
    111112   
    112113    ScrollingNodeID scrollingNodeIDForRole(ScrollingNodeType nodeType) const
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r182132 r182799  
    38143814}
    38153815
     3816void RenderLayerCompositor::detachScrollCoordinatedLayerForRole(RenderLayer& layer, ScrollingNodeType role)
     3817{
     3818    RenderLayerBacking* backing = layer.backing();
     3819    if (!backing)
     3820        return;
     3821
     3822    if (ScrollingNodeID nodeID = backing->scrollingNodeIDForRole(role))
     3823        m_scrollingNodeToLayerMap.remove(nodeID);
     3824
     3825    backing->detachFromScrollingCoordinatorForRole(role);
     3826}
     3827
     3828void RenderLayerCompositor::detachScrollCoordinatedLayer(RenderLayer& layer)
     3829{
     3830    RenderLayerBacking* backing = layer.backing();
     3831    if (!backing)
     3832        return;
     3833
     3834    if (ScrollingNodeID nodeID = backing->scrollingNodeIDForRole(FrameScrollingNode))
     3835        m_scrollingNodeToLayerMap.remove(nodeID);
     3836
     3837    if (ScrollingNodeID nodeID = backing->scrollingNodeIDForRole(FixedNode))
     3838        m_scrollingNodeToLayerMap.remove(nodeID);
     3839
     3840    backing->detachFromScrollingCoordinator();
     3841}
     3842
    38163843void RenderLayerCompositor::updateScrollCoordinationForThisFrame(ScrollingNodeID parentNodeID)
    38173844{
     
    38843911       
    38853912        parentNodeID = nodeID;
    3886     }
     3913    } else
     3914        detachScrollCoordinatedLayerForRole(layer, FixedNode);
    38873915
    38883916    if (reasons & Scrolling) {
     
    39093937            scrollingCoordinator->updateOverflowScrollingNode(nodeID, backing->scrollingLayer(), backing->scrollingContentsLayer(), &scrollingGeometry);
    39103938        }
    3911     }
    3912 }
    3913 
    3914 void RenderLayerCompositor::detachScrollCoordinatedLayer(RenderLayer& layer)
    3915 {
    3916     RenderLayerBacking* backing = layer.backing();
    3917     if (!backing)
    3918         return;
    3919 
    3920     if (ScrollingNodeID nodeID = backing->scrollingNodeIDForRole(FrameScrollingNode))
    3921         m_scrollingNodeToLayerMap.remove(nodeID);
    3922 
    3923     if (ScrollingNodeID nodeID = backing->scrollingNodeIDForRole(FixedNode))
    3924         m_scrollingNodeToLayerMap.remove(nodeID);
    3925 
    3926     backing->detachFromScrollingCoordinator();
     3939    } else
     3940        detachScrollCoordinatedLayerForRole(layer, OverflowScrollingNode);
    39273941}
    39283942
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.h

    r181656 r182799  
    435435    void updateScrollCoordinatedLayer(RenderLayer&, ScrollCoordinationReasons);
    436436    void detachScrollCoordinatedLayer(RenderLayer&);
     437    void detachScrollCoordinatedLayerForRole(RenderLayer&, ScrollingNodeType);
    437438    void reattachSubframeScrollLayers();
    438439   
Note: See TracChangeset for help on using the changeset viewer.