Changeset 243926 in webkit


Ignore:
Timestamp:
Apr 4, 2019 10:18:17 PM (5 years ago)
Author:
Simon Fraser
Message:

[iOS WK2] REGRESSION (r242687): Programmatic scroll of overflow scroll results in bad rendering
https://bugs.webkit.org/show_bug.cgi?id=195584

Reviewed by Zalan Bujtas.

Source/WebCore:

Push data to the scrolling tree about whether an overflow:scroll scroll was programmatic, by having
RenderLayer::scrollToOffset() call into AsyncScrollingCoordinator::requestScrollPositionUpdate(),
just as we do for frames.

AsyncScrollingCoordinator::requestScrollPositionUpdate() is generalized to take any ScrollableArea.

Fix an assumption in the ScrollingTree that we only care about programmatic scrolls on the root node.
ScrollingTree::commitTreeState() no longer sets isHandlingProgrammaticScroll; instead,
callers of ScrollingTreeScrollingNode::scrollTo() pass a ScrollType. Commit functions pass
ScrollType::Programmatic when handling RequestedScrollPosition changes as necessary.

Programmatic scrolls need to get to the scrolling tree in the UI process so that we update
the tree's notion of scroll position, and trigger actual UIScrollView scrolls (layers may have
already been put in the right locations, but the UI process needs to know that a scroll happened).
However, we need to prevent notifications from programmatic scrolls getting back to the
web process, because this causes jumpiness. This is done via an early return in
RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll().

Tests: scrollingcoordinator/ios/programmatic-overflow-scroll.html

scrollingcoordinator/ios/programmatic-page-scroll.html

  • page/scrolling/AsyncScrollingCoordinator.cpp:

(WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):

  • page/scrolling/AsyncScrollingCoordinator.h:
  • page/scrolling/ScrollingCoordinator.h:

(WebCore::ScrollingCoordinator::requestScrollPositionUpdate):

  • page/scrolling/ScrollingTree.cpp:

(WebCore::ScrollingTree::commitTreeState):
(WebCore::ScrollingTree::isHandlingProgrammaticScroll): Deleted.

  • page/scrolling/ScrollingTree.h:

(WebCore::ScrollingTree::isHandlingProgrammaticScroll const):
(WebCore::ScrollingTree::setIsHandlingProgrammaticScroll):

  • page/scrolling/ScrollingTreeScrollingNode.cpp:

(WebCore::ScrollingTreeScrollingNode::scrollBy):
(WebCore::ScrollingTreeScrollingNode::scrollTo):

  • page/scrolling/ScrollingTreeScrollingNode.h:
  • page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:

(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::scrollToOffset):
(WebCore::RenderLayer::scrollingNodeID const):

  • rendering/RenderLayer.h:
  • rendering/RenderMarquee.cpp:

(WebCore::RenderMarquee::timerFired):

Source/WebKit:

Push data to the scrolling tree about whether an overflow:scroll scroll was programmatic, by having
RenderLayer::scrollToOffset() call into AsyncScrollingCoordinator::requestScrollPositionUpdate(),
just as we do for frames.

AsyncScrollingCoordinator::requestScrollPositionUpdate() is generalized to take any ScrollableArea.

Fix an assumption in the ScrollingTree that we only care about programmatic scrolls on the root node.
ScrollingTree::commitTreeState() no longer sets isHandlingProgrammaticScroll; instead,
callers of ScrollingTreeScrollingNode::scrollTo() pass a ScrollType. Commit functions pass
ScrollType::Programmatic when handling RequestedScrollPosition changes as necessary.

Programmatic scrolls need to get to the scrolling tree in the UI process so that we update
the tree's notion of scroll position, and trigger actual UIScrollView scrolls (layers may have
already been put in the right locations, but the UI process needs to know that a scroll happened).
However, we need to prevent notifications from programmatic scrolls getting back to the
web process, because this causes jumpiness. This is done via an early return in
RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll().

  • UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:

(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):

  • UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:

(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren): Subframe nodes have
a delegate, and that will take care of the requestedScrollPosition update.

  • UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
  • UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:

(WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren):

  • UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:

(WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):

LayoutTests:

Testing of programmatic scrolls in frames is prevented by webkit.org/b/196635.

  • scrollingcoordinator/ios/programmatic-overflow-scroll-expected.html: Added.
  • scrollingcoordinator/ios/programmatic-overflow-scroll.html: Added.
  • scrollingcoordinator/ios/programmatic-page-scroll-expected.html: Added.
  • scrollingcoordinator/ios/programmatic-page-scroll.html: Added.
Location:
trunk
Files:
4 added
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r243917 r243926  
     12019-04-04  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS WK2] REGRESSION (r242687): Programmatic scroll of overflow scroll results in bad rendering
     4        https://bugs.webkit.org/show_bug.cgi?id=195584
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        Testing of programmatic scrolls in frames is prevented by webkit.org/b/196635.
     9
     10        * scrollingcoordinator/ios/programmatic-overflow-scroll-expected.html: Added.
     11        * scrollingcoordinator/ios/programmatic-overflow-scroll.html: Added.
     12        * scrollingcoordinator/ios/programmatic-page-scroll-expected.html: Added.
     13        * scrollingcoordinator/ios/programmatic-page-scroll.html: Added.
     14
    1152019-04-04  Shawn Roberts  <sroberts@apple.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r243924 r243926  
     12019-04-04  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS WK2] REGRESSION (r242687): Programmatic scroll of overflow scroll results in bad rendering
     4        https://bugs.webkit.org/show_bug.cgi?id=195584
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        Push data to the scrolling tree about whether an overflow:scroll scroll was programmatic, by having
     9        RenderLayer::scrollToOffset() call into AsyncScrollingCoordinator::requestScrollPositionUpdate(),
     10        just as we do for frames.
     11
     12        AsyncScrollingCoordinator::requestScrollPositionUpdate() is generalized to take any ScrollableArea.
     13
     14        Fix an assumption in the ScrollingTree that we only care about programmatic scrolls on the root node.
     15        ScrollingTree::commitTreeState() no longer sets isHandlingProgrammaticScroll; instead,
     16        callers of ScrollingTreeScrollingNode::scrollTo() pass a ScrollType. Commit functions pass
     17        ScrollType::Programmatic when handling RequestedScrollPosition changes as necessary.
     18
     19        Programmatic scrolls need to get to the scrolling tree in the UI process so that we update
     20        the tree's notion of scroll position, and trigger actual UIScrollView scrolls (layers may have
     21        already been put in the right locations, but the UI process needs to know that a scroll happened).
     22        However, we need to prevent notifications from programmatic scrolls getting back to the
     23        web process, because this causes jumpiness. This is done via an early return in
     24        RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll().
     25
     26        Tests: scrollingcoordinator/ios/programmatic-overflow-scroll.html
     27               scrollingcoordinator/ios/programmatic-page-scroll.html
     28
     29        * page/scrolling/AsyncScrollingCoordinator.cpp:
     30        (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
     31        * page/scrolling/AsyncScrollingCoordinator.h:
     32        * page/scrolling/ScrollingCoordinator.h:
     33        (WebCore::ScrollingCoordinator::requestScrollPositionUpdate):
     34        * page/scrolling/ScrollingTree.cpp:
     35        (WebCore::ScrollingTree::commitTreeState):
     36        (WebCore::ScrollingTree::isHandlingProgrammaticScroll): Deleted.
     37        * page/scrolling/ScrollingTree.h:
     38        (WebCore::ScrollingTree::isHandlingProgrammaticScroll const):
     39        (WebCore::ScrollingTree::setIsHandlingProgrammaticScroll):
     40        * page/scrolling/ScrollingTreeScrollingNode.cpp:
     41        (WebCore::ScrollingTreeScrollingNode::scrollBy):
     42        (WebCore::ScrollingTreeScrollingNode::scrollTo):
     43        * page/scrolling/ScrollingTreeScrollingNode.h:
     44        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
     45        (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
     46        * rendering/RenderLayer.cpp:
     47        (WebCore::RenderLayer::scrollToOffset):
     48        (WebCore::RenderLayer::scrollingNodeID const):
     49        * rendering/RenderLayer.h:
     50        * rendering/RenderMarquee.cpp:
     51        (WebCore::RenderMarquee::timerFired):
     52
    1532019-04-04  Yusuke Suzuki  <ysuzuki@apple.com>
    254
  • trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp

    r243919 r243926  
    205205}
    206206
    207 bool AsyncScrollingCoordinator::requestScrollPositionUpdate(FrameView& frameView, const IntPoint& scrollPosition)
     207bool AsyncScrollingCoordinator::requestScrollPositionUpdate(ScrollableArea& scrollableArea, const IntPoint& scrollPosition)
    208208{
    209209    ASSERT(isMainThread());
    210210    ASSERT(m_page);
    211211
    212     if (!coordinatesScrollingForFrameView(frameView))
     212    auto scrollingNodeID = scrollableArea.scrollingNodeID();
     213    if (!scrollingNodeID)
    213214        return false;
    214215
    215     bool inPageCache = frameView.frame().document()->pageCacheState() != Document::NotInPageCache;
    216     bool inProgrammaticScroll = frameView.currentScrollType() == ScrollType::Programmatic;
     216    auto* frameView = frameViewForScrollingNode(scrollingNodeID);
     217    if (!frameView)
     218        return false;
     219
     220    if (!coordinatesScrollingForFrameView(*frameView))
     221        return false;
     222
     223    bool inPageCache = frameView->frame().document()->pageCacheState() != Document::NotInPageCache;
     224    bool inProgrammaticScroll = scrollableArea.currentScrollType() == ScrollType::Programmatic;
    217225    if (inProgrammaticScroll || inPageCache)
    218         updateScrollPositionAfterAsyncScroll(frameView.scrollingNodeID(), scrollPosition, { }, ScrollType::Programmatic, ScrollingLayerPositionAction::Set);
     226        updateScrollPositionAfterAsyncScroll(scrollingNodeID, scrollPosition, { }, ScrollType::Programmatic, ScrollingLayerPositionAction::Set);
    219227
    220228    // If this frame view's document is being put into the page cache, we don't want to update our
     
    223231        return true;
    224232
    225     auto* stateNode = downcast<ScrollingStateScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView.scrollingNodeID()));
     233    auto* stateNode = downcast<ScrollingStateScrollingNode>(m_scrollingStateTree->stateNodeForID(scrollingNodeID));
    226234    if (!stateNode)
    227235        return false;
  • trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h

    r243855 r243926  
    9696    WEBCORE_EXPORT void frameViewEventTrackingRegionsChanged(FrameView&) override;
    9797
    98     WEBCORE_EXPORT bool requestScrollPositionUpdate(FrameView&, const IntPoint&) override;
     98    WEBCORE_EXPORT bool requestScrollPositionUpdate(ScrollableArea&, const IntPoint&) override;
    9999
    100100    WEBCORE_EXPORT void applyScrollingTreeLayerPositions() override;
  • trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h

    r243855 r243926  
    115115    // These virtual functions are currently unique to the threaded scrolling architecture.
    116116    virtual void commitTreeStateIfNeeded() { }
    117     virtual bool requestScrollPositionUpdate(FrameView&, const IntPoint&) { return false; }
     117    virtual bool requestScrollPositionUpdate(ScrollableArea&, const IntPoint&) { return false; }
    118118    virtual ScrollingEventResult handleWheelEvent(FrameView&, const PlatformWheelEvent&) { return ScrollingEventResult::DidNotHandleEvent; }
    119119
  • trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp

    r243607 r243926  
    167167    }
    168168   
    169     bool scrollRequestIsProgammatic = rootNode ? rootNode->requestedScrollPositionRepresentsProgrammaticScroll() : false;
    170     SetForScope<bool> changeHandlingProgrammaticScroll(m_isHandlingProgrammaticScroll, scrollRequestIsProgammatic);
    171 
    172169    // unvisitedNodes starts with all nodes in the map; we remove nodes as we visit them. At the end, it's the unvisited nodes.
    173170    // We can't use orphanNodes for this, because orphanNodes won't contain descendants of removed nodes.
     
    403400    m_swipeState.rubberBandsAtTop = canRubberBandAtTop;
    404401    m_swipeState.rubberBandsAtBottom = canRubberBandAtBottom;
    405 }
    406 
    407 bool ScrollingTree::isHandlingProgrammaticScroll()
    408 {
    409     return m_isHandlingProgrammaticScroll;
    410402}
    411403
  • trunk/Source/WebCore/page/scrolling/ScrollingTree.h

    r243607 r243926  
    119119    WEBCORE_EXPORT void setCanRubberBandState(bool canRubberBandAtLeft, bool canRubberBandAtRight, bool canRubberBandAtTop, bool canRubberBandAtBottom);
    120120
    121     bool isHandlingProgrammaticScroll();
     121    bool isHandlingProgrammaticScroll() const { return m_isHandlingProgrammaticScroll; }
     122    void setIsHandlingProgrammaticScroll(bool isHandlingProgrammaticScroll) { m_isHandlingProgrammaticScroll = isHandlingProgrammaticScroll; }
    122123   
    123124    void setScrollPinningBehavior(ScrollPinningBehavior);
     
    205206
    206207    unsigned m_fixedOrStickyNodeCount { 0 };
     208    bool m_isHandlingProgrammaticScroll { false };
    207209    bool m_scrollingPerformanceLoggingEnabled { false };
    208     bool m_isHandlingProgrammaticScroll { false };
    209210    bool m_asyncFrameOrOverflowScrollingEnabled { false };
    210211};
  • trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp

    r243309 r243926  
    153153void ScrollingTreeScrollingNode::scrollBy(const FloatSize& delta, ScrollPositionClamp clamp)
    154154{
    155     scrollTo(currentScrollPosition() + delta, clamp);
    156 }
    157 
    158 void ScrollingTreeScrollingNode::scrollTo(const FloatPoint& position, ScrollPositionClamp clamp)
     155    scrollTo(currentScrollPosition() + delta, ScrollType::User, clamp);
     156}
     157
     158void ScrollingTreeScrollingNode::scrollTo(const FloatPoint& position, ScrollType scrollType, ScrollPositionClamp clamp)
    159159{
    160160    if (position == m_currentScrollPosition)
    161161        return;
    162162
     163    scrollingTree().setIsHandlingProgrammaticScroll(scrollType == ScrollType::Programmatic);
     164   
    163165    m_currentScrollPosition = adjustedScrollPosition(position, clamp);
    164166   
     
    167169    updateViewportForCurrentScrollPosition();
    168170    currentScrollPositionChanged();
     171
     172    scrollingTree().setIsHandlingProgrammaticScroll(false);
    169173}
    170174
  • trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h

    r243416 r243926  
    5858
    5959    // These are imperative; they adjust the scrolling layers.
    60     void scrollTo(const FloatPoint&, ScrollPositionClamp = ScrollPositionClamp::ToContentEdges);
     60    void scrollTo(const FloatPoint&, ScrollType = ScrollType::User, ScrollPositionClamp = ScrollPositionClamp::ToContentEdges);
    6161    void scrollBy(const FloatSize&, ScrollPositionClamp = ScrollPositionClamp::ToContentEdges);
    6262
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm

    r243550 r243926  
    138138
    139139    // Update the scroll position after child nodes have been updated, because they need to have updated their constraints before any scrolling happens.
    140     if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition))
    141         scrollTo(scrollingStateNode.requestedScrollPosition());
     140    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition)) {
     141        auto scrollType = scrollingStateNode.requestedScrollPositionRepresentsProgrammaticScroll() ? ScrollType::Programmatic : ScrollType::User;
     142        scrollTo(scrollingStateNode.requestedScrollPosition(), scrollType);
     143    }
    142144
    143145    if (isRootNode()
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r243919 r243926  
    23472347    setCurrentScrollType(scrollType);
    23482348
    2349     scrollToOffsetWithoutAnimation(newScrollOffset, clamping);
     2349    bool handled = false;
     2350#if ENABLE(ASYNC_SCROLLING)
     2351    if (ScrollingCoordinator* scrollingCoordinator = page().scrollingCoordinator())
     2352        handled = scrollingCoordinator->requestScrollPositionUpdate(*this, scrollPositionFromOffset(scrollOffset));
     2353#endif
     2354
     2355    if (!handled)
     2356        scrollToOffsetWithoutAnimation(newScrollOffset, clamping);
    23502357
    23512358    setCurrentScrollType(previousScrollType);
     
    28032810
    28042811    return 0;
     2812}
     2813
     2814ScrollingNodeID RenderLayer::scrollingNodeID() const
     2815{
     2816    if (!isComposited())
     2817        return 0;
     2818
     2819    return backing()->scrollingNodeIDForRole(ScrollCoordinationRole::Scrolling);
    28052820}
    28062821
  • trunk/Source/WebCore/rendering/RenderLayer.h

    r243919 r243926  
    421421
    422422    // These are only used by marquee.
    423     void scrollToXOffset(int x, ScrollClamping clamping = ScrollClamping::Clamped) { scrollToOffset(ScrollOffset(x, scrollOffset().y()), ScrollType::Programmatic, clamping); }
    424     void scrollToYOffset(int y, ScrollClamping clamping = ScrollClamping::Clamped) { scrollToOffset(ScrollOffset(scrollOffset().x(), y), ScrollType::Programmatic, clamping); }
     423    void scrollToXOffset(int x) { scrollToOffset(ScrollOffset(x, scrollOffset().y()), ScrollType::Programmatic, ScrollClamping::Unclamped); }
     424    void scrollToYOffset(int y) { scrollToOffset(ScrollOffset(scrollOffset().x(), y), ScrollType::Programmatic, ScrollClamping::Unclamped); }
    425425
    426426    void setPostLayoutScrollPosition(Optional<ScrollPosition>);
     
    10511051    int scrollSize(ScrollbarOrientation) const override;
    10521052    void setScrollOffset(const ScrollOffset&) override;
     1053    ScrollingNodeID scrollingNodeID() const override;
    10531054
    10541055    IntRect visibleContentRectInternal(VisibleContentRectIncludesScrollbars, VisibleContentRectBehavior) const override;
  • trunk/Source/WebCore/rendering/RenderMarquee.cpp

    r243919 r243926  
    248248        m_reset = false;
    249249        if (isHorizontal())
    250             m_layer->scrollToXOffset(m_start, ScrollClamping::Unclamped);
     250            m_layer->scrollToXOffset(m_start);
    251251        else
    252             m_layer->scrollToYOffset(m_start, ScrollClamping::Unclamped);
     252            m_layer->scrollToYOffset(m_start);
    253253        return;
    254254    }
     
    290290   
    291291    if (isHorizontal())
    292         m_layer->scrollToXOffset(newPos, ScrollClamping::Unclamped);
     292        m_layer->scrollToXOffset(newPos);
    293293    else
    294         m_layer->scrollToYOffset(newPos, ScrollClamping::Unclamped);
     294        m_layer->scrollToYOffset(newPos);
    295295}
    296296
  • trunk/Source/WebKit/ChangeLog

    r243916 r243926  
     12019-04-04  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS WK2] REGRESSION (r242687): Programmatic scroll of overflow scroll results in bad rendering
     4        https://bugs.webkit.org/show_bug.cgi?id=195584
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        Push data to the scrolling tree about whether an overflow:scroll scroll was programmatic, by having
     9        RenderLayer::scrollToOffset() call into AsyncScrollingCoordinator::requestScrollPositionUpdate(),
     10        just as we do for frames.
     11
     12        AsyncScrollingCoordinator::requestScrollPositionUpdate() is generalized to take any ScrollableArea.
     13
     14        Fix an assumption in the ScrollingTree that we only care about programmatic scrolls on the root node.
     15        ScrollingTree::commitTreeState() no longer sets isHandlingProgrammaticScroll; instead,
     16        callers of ScrollingTreeScrollingNode::scrollTo() pass a ScrollType. Commit functions pass
     17        ScrollType::Programmatic when handling RequestedScrollPosition changes as necessary.
     18
     19        Programmatic scrolls need to get to the scrolling tree in the UI process so that we update
     20        the tree's notion of scroll position, and trigger actual UIScrollView scrolls (layers may have
     21        already been put in the right locations, but the UI process needs to know that a scroll happened).
     22        However, we need to prevent notifications from programmatic scrolls getting back to the
     23        web process, because this causes jumpiness. This is done via an early return in
     24        RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll().
     25
     26        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
     27        (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
     28        * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
     29        (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren): Subframe nodes have
     30        a delegate, and that will take care of the requestedScrollPosition update.
     31        * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
     32        * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
     33        (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren):
     34        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
     35        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
     36
    1372019-04-04  Ryan Haddad  <ryanhaddad@apple.com>
    238
  • trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp

    r243316 r243926  
    217217    m_webPageProxy.scrollingNodeScrollViewDidScroll();
    218218#endif
     219
     220    if (m_scrollingTree->isHandlingProgrammaticScroll())
     221        return;
     222
    219223    m_webPageProxy.send(Messages::RemoteScrollingCoordinator::ScrollPositionChangedForNode(scrolledNodeID, newScrollPosition, scrollingLayerPositionAction == ScrollingLayerPositionAction::Sync));
    220224}
  • trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm

    r242356 r243926  
    8383    const auto& scrollingStateNode = downcast<ScrollingStateFrameScrollingNode>(stateNode);
    8484
     85    if (m_scrollingNodeDelegate) {
     86        m_scrollingNodeDelegate->commitStateAfterChildren(scrollingStateNode);
     87        return;
     88    }
     89
    8590    // Update the scroll position after child nodes have been updated, because they need to have updated their constraints before any scrolling happens.
    86     if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition))
    87         scrollTo(scrollingStateNode.requestedScrollPosition());
    88 
    89     if (m_scrollingNodeDelegate)
    90         m_scrollingNodeDelegate->commitStateAfterChildren(downcast<ScrollingStateScrollingNode>(stateNode));
     91    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition)) {
     92        auto scrollType = scrollingStateNode.requestedScrollPositionRepresentsProgrammaticScroll() ? ScrollType::Programmatic : ScrollType::User;
     93        scrollTo(scrollingStateNode.requestedScrollPosition(), scrollType);
     94    }
    9195}
    9296
  • trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h

    r242132 r243926  
    4747    void repositionScrollingLayers() override;
    4848
     49    // The delegate is non-null for subframes.
    4950    std::unique_ptr<ScrollingTreeScrollingNodeDelegateIOS> m_scrollingNodeDelegate;
    5051};
  • trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm

    r242132 r243926  
    6464{
    6565    ScrollingTreeOverflowScrollingNode::commitStateAfterChildren(stateNode);
    66     m_scrollingNodeDelegate->commitStateAfterChildren(downcast<ScrollingStateScrollingNode>(stateNode));
     66
     67    const auto& scrollingStateNode = downcast<ScrollingStateScrollingNode>(stateNode);
     68    m_scrollingNodeDelegate->commitStateAfterChildren(scrollingStateNode);
    6769}
    6870
  • trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm

    r243416 r243926  
    226226{
    227227    SetForScope<bool> updatingChange(m_updatingFromStateNode, true);
     228
    228229    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollContainerLayer)
    229230        || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize)
     
    288289        END_BLOCK_OBJC_EXCEPTIONS
    289290    }
     291
     292    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition)) {
     293        auto scrollType = scrollingStateNode.requestedScrollPositionRepresentsProgrammaticScroll() ? ScrollType::Programmatic : ScrollType::User;
     294        scrollingNode().scrollTo(scrollingStateNode.requestedScrollPosition(), scrollType);
     295    }
    290296}
    291297
Note: See TracChangeset for help on using the changeset viewer.