Changeset 237754 in webkit


Ignore:
Timestamp:
Nov 2, 2018 3:07:18 PM (5 years ago)
Author:
ajuma@chromium.org
Message:

requestAnimationFrame causes bad location of position:fixed inside overflow:auto and iframe
https://bugs.webkit.org/show_bug.cgi?id=176243

Reviewed by Simon Fraser.

When a new layer tree is committed to the UIProcess, the positions of layers for fixed
or sticky nodes in the newly-committed tree can be stale, because of scrolling that has
happened in the UIProcess since the tree was updated in the WebProcess. To handle this,
RemoteLayerTreeDrawingAreaProxy::commitLayerTree updates the positions of these layers
by calling RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling, which
leads to a recursive traversal of the ScrollingTree to update each such layer. However,
since ScrollingTreeFrameScrollingNodeIOS didn't implement updateLayersAfterAncestorChange,
this traversal never descended into scrolling nodes within an iframe, so the layers for
these nodes were left with stale positions.

Implement ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterAncestorChange so that
fixed and sticky layers within an iframe do get their positions updated when a new layer
tree is committed.

  • page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
  • page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:

(WebCore::ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterAncestorChange):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r237743 r237754  
     12018-11-02  Ali Juma  <ajuma@chromium.org>
     2
     3        requestAnimationFrame causes bad location of position:fixed inside overflow:auto and iframe
     4        https://bugs.webkit.org/show_bug.cgi?id=176243
     5
     6        Reviewed by Simon Fraser.
     7
     8        When a new layer tree is committed to the UIProcess, the positions of layers for fixed
     9        or sticky nodes in the newly-committed tree can be stale, because of scrolling that has
     10        happened in the UIProcess since the tree was updated in the WebProcess. To handle this,
     11        RemoteLayerTreeDrawingAreaProxy::commitLayerTree updates the positions of these layers
     12        by calling RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling, which
     13        leads to a recursive traversal of the ScrollingTree to update each such layer. However,
     14        since ScrollingTreeFrameScrollingNodeIOS didn't implement updateLayersAfterAncestorChange,
     15        this traversal never descended into scrolling nodes within an iframe, so the layers for
     16        these nodes were left with stale positions.
     17
     18        Implement ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterAncestorChange so that
     19        fixed and sticky layers within an iframe do get their positions updated when a new layer
     20        tree is committed.
     21
     22        * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
     23        * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
     24        (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterAncestorChange):
     25
    1262018-11-02  Wenson Hsieh  <wenson_hsieh@apple.com>
    227
  • trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h

    r237266 r237754  
    5454    void updateLayersAfterViewportChange(const FloatRect& fixedPositionRect, double scale) override;
    5555    void updateLayersAfterDelegatedScroll(const FloatPoint&) override;
     56    void updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta) override;
    5657
    5758    void setScrollLayerPosition(const FloatPoint&, const FloatRect& layoutViewport) override;
  • trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm

    r237266 r237754  
    137137}
    138138
     139void ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect&, const FloatSize&)
     140{
     141    if (!m_children)
     142        return;
     143
     144    FloatRect fixedPositionRect(scrollPosition(), scrollableAreaSize());
     145    for (auto& child : *m_children)
     146        child->updateLayersAfterAncestorChange(changedNode, fixedPositionRect, FloatSize());
     147}
     148
    139149void ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterDelegatedScroll(const FloatPoint& scrollPosition)
    140150{
Note: See TracChangeset for help on using the changeset viewer.