Changeset 292812 in webkit


Ignore:
Timestamp:
Apr 13, 2022 9:41:00 AM (3 months ago)
Author:
Simon Fraser
Message:

[css-scroll-snap] scrollIntoView fails with scroll-snap-type on :root
https://bugs.webkit.org/show_bug.cgi?id=239063
<rdar://problem/91603363>

Reviewed by Dean Jackson.

Source/WebCore:

Programmatic smooth scrolls on iframe documents were broken because
ScrollingTreeFrameScrollingNodeRemoteIOS was overlooked when adding support (easily done
since the main frame's scrolling is controlled via the WKWebView; some unification here
would be beneficial). Implementing startAnimatedScrollToPosition() and stopAnimatedScroll()
on ScrollingTreeFrameScrollingNodeRemoteIOS fixes this.

However, this revealed an additional bug; RenderLayer::scrollRectToVisible() failed to clamp
the target scroll position correctly, and nothing in the iOS-smooth scrolling code path
clamped, so the scroll would go too far.

Testing required getting UIHelper.waitForScrollCompletion() to work. This is based on the
uiController.didEndScrollingCallback, but that was only hooked up for the main scroller. So
make it work for all scrollers by plumbing ScrollingNodeIDs through
scrollingNodeScrollViewDidScroll() and friends so that everything ends up in -[WKWebViewIOS
_didFinishScrolling:] with a UIScrollView argument; to avoid any behavior change, this bails
for non-main scroll views, but TestRunnerWKWebView overrides it to make testing work.

Test: fast/scrolling/ios/constrain-scrollintoview-position.html

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::scrollRectToVisible):

Source/WebKit:

Programmatic smooth scrolls on iframe documents were broken because
ScrollingTreeFrameScrollingNodeRemoteIOS was overlooked when adding support (easily done
since the main frame's scrolling is controlled via the WKWebView; some unification here
would be beneficial). Implementing startAnimatedScrollToPosition() and stopAnimatedScroll()
on ScrollingTreeFrameScrollingNodeRemoteIOS fixes this.

However, this revealed an additional bug; RenderLayer::scrollRectToVisible() failed to clamp
the target scroll position correctly, and nothing in the iOS-smooth scrolling code path
clamped, so the scroll would go too far.

Testing required getting UIHelper.waitForScrollCompletion() to work. This is based on the
uiController.didEndScrollingCallback, but that was only hooked up for the main scroller. So
make it work for all scrollers by plumbing ScrollingNodeIDs through
scrollingNodeScrollViewDidScroll() and friends so that everything ends up in -[WKWebViewIOS
_didFinishScrolling:] with a UIScrollView argument; to avoid any behavior change, this bails
for non-main scroll views, but TestRunnerWKWebView overrides it to make testing work.

Test: fast/scrolling/ios/constrain-scrollintoview-position.html

  • UIProcess/API/ios/WKWebViewIOS.h:
  • UIProcess/API/ios/WKWebViewIOS.mm:

(-[WKWebView _didFinishScrolling:]):
(-[WKWebView scrollViewDidEndDragging:willDecelerate:]):
(-[WKWebView scrollViewDidEndDecelerating:]):
(-[WKWebView scrollViewDidScrollToTop:]):
(-[WKWebView scrollViewDidEndScrollingAnimation:]):
(-[WKWebView _didFinishScrolling]): Deleted.

  • UIProcess/PageClient.h:
  • UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:

(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):

  • UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:

(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartPanGesture):
(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartScroll):
(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidEndScroll):

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

(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::startAnimatedScrollToPosition):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::stopAnimatedScroll):

  • UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:

(-[WKScrollingNodeScrollViewDelegate scrollViewDidEndScrollingAnimation:]):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers):

  • UIProcess/WebPageProxy.h:
  • UIProcess/WebPageProxy.messages.in:
  • UIProcess/ios/PageClientImplIOS.h:
  • UIProcess/ios/PageClientImplIOS.mm:

(WebKit::PageClientImpl::scrollingNodeScrollViewWillStartPanGesture):
(WebKit::PageClientImpl::scrollingNodeScrollViewDidScroll):
(WebKit::PageClientImpl::scrollingNodeScrollWillStartScroll):
(WebKit::PageClientImpl::scrollingNodeScrollDidEndScroll):

  • UIProcess/ios/WKContentViewInteraction.h:
  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView _scrollingNodeScrollingWillBegin:]):
(-[WKContentView _scrollingNodeScrollingDidEnd:]):
(-[WKContentView keyboardScrollViewAnimatorDidFinishScrolling:]):
(-[WKContentView _scrollingNodeScrollingWillBegin]): Deleted.
(-[WKContentView _scrollingNodeScrollingDidEnd]): Deleted.

  • UIProcess/ios/WebPageProxyIOS.mm:

(WebKit::WebPageProxy::scrollingNodeScrollViewWillStartPanGesture):
(WebKit::WebPageProxy::scrollingNodeScrollViewDidScroll):
(WebKit::WebPageProxy::scrollingNodeScrollWillStartScroll):
(WebKit::WebPageProxy::scrollingNodeScrollDidEndScroll):

  • WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:

(WebKit::WebChromeClient::didStartOverflowScroll):
(WebKit::WebChromeClient::didEndOverflowScroll):

Tools:

_didFinishScrolling: now works for subscrollers too.

  • WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:

(-[TestRunnerWKWebView _didFinishScrolling:]):
(-[TestRunnerWKWebView _didFinishScrolling]): Deleted.

LayoutTests:

Make UIHelper.waitForScrollCompletion() work on iOS.

  • fast/scrolling/ios/constrain-scrollintoview-position-expected.txt: Added.
  • fast/scrolling/ios/constrain-scrollintoview-position.html: Added.
  • resources/ui-helper.js:

(window.UIHelper.async waitForScrollCompletion.await.new.Promise.):
(window.UIHelper.async waitForScrollCompletion.await.new.Promise):
(window.UIHelper.async waitForScrollCompletion):

Location:
trunk
Files:
2 added
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r292800 r292812  
     12022-04-13  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [css-scroll-snap] scrollIntoView fails with scroll-snap-type on :root
     4        https://bugs.webkit.org/show_bug.cgi?id=239063
     5        <rdar://problem/91603363>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Make UIHelper.waitForScrollCompletion() work on iOS.
     10
     11        * fast/scrolling/ios/constrain-scrollintoview-position-expected.txt: Added.
     12        * fast/scrolling/ios/constrain-scrollintoview-position.html: Added.
     13        * resources/ui-helper.js:
     14        (window.UIHelper.async waitForScrollCompletion.await.new.Promise.):
     15        (window.UIHelper.async waitForScrollCompletion.await.new.Promise):
     16        (window.UIHelper.async waitForScrollCompletion):
     17
    1182022-04-12  Wenson Hsieh  <wenson_hsieh@apple.com>
    219
  • trunk/LayoutTests/resources/ui-helper.js

    r290646 r292812  
    142142    static async waitForScrollCompletion()
    143143    {
     144        if (this.isIOSFamily()) {
     145            await new Promise(resolve => {
     146                testRunner.runUIScript(`
     147                    (function() {
     148                        uiController.didEndScrollingCallback = function() {
     149                            uiController.uiScriptComplete();
     150                        }
     151                    })()`, resolve);
     152            });
     153            // Wait for the new scroll position to get back to the web process.
     154            return UIHelper.renderingUpdate();
     155        }
     156
    144157        return new Promise(resolve => {
    145158            eventSender.callAfterScrollingCompletes(() => {
  • trunk/Source/WebCore/ChangeLog

    r292810 r292812  
     12022-04-13  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [css-scroll-snap] scrollIntoView fails with scroll-snap-type on :root
     4        https://bugs.webkit.org/show_bug.cgi?id=239063
     5        <rdar://problem/91603363>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Programmatic smooth scrolls on iframe documents were broken because
     10        ScrollingTreeFrameScrollingNodeRemoteIOS was overlooked when adding support (easily done
     11        since the main frame's scrolling is controlled via the WKWebView; some unification here
     12        would be beneficial). Implementing startAnimatedScrollToPosition() and stopAnimatedScroll()
     13        on ScrollingTreeFrameScrollingNodeRemoteIOS fixes this.
     14
     15        However, this revealed an additional bug; RenderLayer::scrollRectToVisible() failed to clamp
     16        the target scroll position correctly, and nothing in the iOS-smooth scrolling code path
     17        clamped, so the scroll would go too far.
     18
     19        Testing required getting UIHelper.waitForScrollCompletion() to work. This is based on the
     20        uiController.didEndScrollingCallback, but that was only hooked up for the main scroller. So
     21        make it work for all scrollers by plumbing ScrollingNodeIDs through
     22        scrollingNodeScrollViewDidScroll() and friends so that everything ends up in -[WKWebViewIOS
     23        _didFinishScrolling:] with a UIScrollView argument; to avoid any behavior change, this bails
     24        for non-main scroll views, but TestRunnerWKWebView overrides it to make testing work.
     25
     26        Test: fast/scrolling/ios/constrain-scrollintoview-position.html
     27
     28        * rendering/RenderLayer.cpp:
     29        (WebCore::RenderLayer::scrollRectToVisible):
     30
    1312022-04-13  Chris Dumez  <cdumez@apple.com>
    232
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r292706 r292812  
    25502550
    25512551                LayoutRect exposeRect = getRectToExpose(viewRect, newRect, insideFixed, options.alignX, options.alignY);
    2552                 IntPoint scrollPosition(roundedIntPoint(exposeRect.location()));
    2553 
    2554                 // Adjust offsets if they're outside of the allowable range.
    2555                 scrollPosition = scrollPosition.constrainedBetween(IntPoint(), IntPoint(frameView.contentsSize()));
     2552                auto scrollPosition = roundedIntPoint(exposeRect.location());
     2553
     2554                scrollPosition = frameView.constrainedScrollPosition(scrollPosition);
    25562555
    25572556                // FIXME: Should we use contentDocument()->scrollingElement()?
  • trunk/Source/WebKit/ChangeLog

    r292810 r292812  
     12022-04-13  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [css-scroll-snap] scrollIntoView fails with scroll-snap-type on :root
     4        https://bugs.webkit.org/show_bug.cgi?id=239063
     5        <rdar://problem/91603363>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Programmatic smooth scrolls on iframe documents were broken because
     10        ScrollingTreeFrameScrollingNodeRemoteIOS was overlooked when adding support (easily done
     11        since the main frame's scrolling is controlled via the WKWebView; some unification here
     12        would be beneficial). Implementing startAnimatedScrollToPosition() and stopAnimatedScroll()
     13        on ScrollingTreeFrameScrollingNodeRemoteIOS fixes this.
     14
     15        However, this revealed an additional bug; RenderLayer::scrollRectToVisible() failed to clamp
     16        the target scroll position correctly, and nothing in the iOS-smooth scrolling code path
     17        clamped, so the scroll would go too far.
     18
     19        Testing required getting UIHelper.waitForScrollCompletion() to work. This is based on the
     20        uiController.didEndScrollingCallback, but that was only hooked up for the main scroller. So
     21        make it work for all scrollers by plumbing ScrollingNodeIDs through
     22        scrollingNodeScrollViewDidScroll() and friends so that everything ends up in -[WKWebViewIOS
     23        _didFinishScrolling:] with a UIScrollView argument; to avoid any behavior change, this bails
     24        for non-main scroll views, but TestRunnerWKWebView overrides it to make testing work.
     25
     26        Test: fast/scrolling/ios/constrain-scrollintoview-position.html
     27
     28        * UIProcess/API/ios/WKWebViewIOS.h:
     29        * UIProcess/API/ios/WKWebViewIOS.mm:
     30        (-[WKWebView _didFinishScrolling:]):
     31        (-[WKWebView scrollViewDidEndDragging:willDecelerate:]):
     32        (-[WKWebView scrollViewDidEndDecelerating:]):
     33        (-[WKWebView scrollViewDidScrollToTop:]):
     34        (-[WKWebView scrollViewDidEndScrollingAnimation:]):
     35        (-[WKWebView _didFinishScrolling]): Deleted.
     36        * UIProcess/PageClient.h:
     37        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
     38        (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
     39        * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
     40        (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartPanGesture):
     41        (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartScroll):
     42        (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidEndScroll):
     43        * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
     44        * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
     45        (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::startAnimatedScrollToPosition):
     46        (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::stopAnimatedScroll):
     47        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
     48        (-[WKScrollingNodeScrollViewDelegate scrollViewDidEndScrollingAnimation:]):
     49        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers):
     50        * UIProcess/WebPageProxy.h:
     51        * UIProcess/WebPageProxy.messages.in:
     52        * UIProcess/ios/PageClientImplIOS.h:
     53        * UIProcess/ios/PageClientImplIOS.mm:
     54        (WebKit::PageClientImpl::scrollingNodeScrollViewWillStartPanGesture):
     55        (WebKit::PageClientImpl::scrollingNodeScrollViewDidScroll):
     56        (WebKit::PageClientImpl::scrollingNodeScrollWillStartScroll):
     57        (WebKit::PageClientImpl::scrollingNodeScrollDidEndScroll):
     58        * UIProcess/ios/WKContentViewInteraction.h:
     59        * UIProcess/ios/WKContentViewInteraction.mm:
     60        (-[WKContentView _scrollingNodeScrollingWillBegin:]):
     61        (-[WKContentView _scrollingNodeScrollingDidEnd:]):
     62        (-[WKContentView keyboardScrollViewAnimatorDidFinishScrolling:]):
     63        (-[WKContentView _scrollingNodeScrollingWillBegin]): Deleted.
     64        (-[WKContentView _scrollingNodeScrollingDidEnd]): Deleted.
     65        * UIProcess/ios/WebPageProxyIOS.mm:
     66        (WebKit::WebPageProxy::scrollingNodeScrollViewWillStartPanGesture):
     67        (WebKit::WebPageProxy::scrollingNodeScrollViewDidScroll):
     68        (WebKit::WebPageProxy::scrollingNodeScrollWillStartScroll):
     69        (WebKit::WebPageProxy::scrollingNodeScrollDidEndScroll):
     70        * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
     71        (WebKit::WebChromeClient::didStartOverflowScroll):
     72        (WebKit::WebChromeClient::didEndOverflowScroll):
     73
    1742022-04-13  Chris Dumez  <cdumez@apple.com>
    275
  • trunk/Source/WebKit/UIProcess/API/ios/WKWebViewIOS.h

    r292065 r292812  
    8686- (void)_zoomOutWithOrigin:(WebCore::FloatPoint)origin animated:(BOOL)animated;
    8787- (void)_zoomToInitialScaleWithOrigin:(WebCore::FloatPoint)origin animated:(BOOL)animated;
    88 - (void)_didFinishScrolling;
     88- (void)_didFinishScrolling:(UIScrollView *)scrollView;
    8989
    9090- (void)_setHasCustomContentView:(BOOL)hasCustomContentView loadedMIMEType:(const WTF::String&)mimeType;
  • trunk/Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm

    r292793 r292812  
    16771677}
    16781678
    1679 - (void)_didFinishScrolling
    1680 {
     1679- (void)_didFinishScrolling:(UIScrollView *)scrollView
     1680{
     1681    if (scrollView != _scrollView.get())
     1682        return;
     1683
    16811684    if (![self usesStandardContentView])
    16821685        return;
     
    17261729    // If we're decelerating, scroll offset will be updated when scrollViewDidFinishDecelerating: is called.
    17271730    if (!decelerate)
    1728         [self _didFinishScrolling];
     1731        [self _didFinishScrolling:scrollView];
    17291732}
    17301733
    17311734- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
    17321735{
    1733     [self _didFinishScrolling];
     1736    [self _didFinishScrolling:scrollView];
    17341737}
    17351738
    17361739- (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView
    17371740{
    1738     [self _didFinishScrolling];
     1741    [self _didFinishScrolling:scrollView];
    17391742}
    17401743
     
    18591862- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView
    18601863{
    1861     [self _didFinishScrolling];
     1864    [self _didFinishScrolling:scrollView];
    18621865}
    18631866
  • trunk/Source/WebKit/UIProcess/PageClient.h

    r292252 r292812  
    481481    virtual double minimumZoomScale() const = 0;
    482482    virtual WebCore::FloatRect documentRect() const = 0;
    483     virtual void scrollingNodeScrollViewWillStartPanGesture() = 0;
    484     virtual void scrollingNodeScrollViewDidScroll() = 0;
    485     virtual void scrollingNodeScrollWillStartScroll() = 0;
    486     virtual void scrollingNodeScrollDidEndScroll() = 0;
     483    virtual void scrollingNodeScrollViewWillStartPanGesture(WebCore::ScrollingNodeID) = 0;
     484    virtual void scrollingNodeScrollViewDidScroll(WebCore::ScrollingNodeID) = 0;
     485    virtual void scrollingNodeScrollWillStartScroll(WebCore::ScrollingNodeID) = 0;
     486    virtual void scrollingNodeScrollDidEndScroll(WebCore::ScrollingNodeID) = 0;
    487487    virtual Vector<String> mimeTypesWithCustomContentProviders() = 0;
    488488
  • trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp

    r292793 r292812  
    228228
    229229#if PLATFORM(IOS_FAMILY)
    230     m_webPageProxy.scrollingNodeScrollViewDidScroll();
     230    m_webPageProxy.scrollingNodeScrollViewDidScroll(scrolledNodeID);
    231231#endif
    232232
  • trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm

    r284448 r292812  
    130130}
    131131
    132 void RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartPanGesture(ScrollingNodeID)
    133 {
    134     m_webPageProxy.scrollingNodeScrollViewWillStartPanGesture();
     132void RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartPanGesture(ScrollingNodeID nodeID)
     133{
     134    m_webPageProxy.scrollingNodeScrollViewWillStartPanGesture(nodeID);
    135135}
    136136
     
    138138void RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartScroll(ScrollingNodeID nodeID)
    139139{
    140     m_webPageProxy.scrollingNodeScrollWillStartScroll();
     140    m_webPageProxy.scrollingNodeScrollWillStartScroll(nodeID);
    141141
    142142    m_uiState.addNodeWithActiveUserScroll(nodeID);
     
    147147void RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidEndScroll(ScrollingNodeID nodeID)
    148148{
    149     m_webPageProxy.scrollingNodeScrollDidEndScroll();
     149    m_webPageProxy.scrollingNodeScrollDidEndScroll(nodeID);
    150150
    151151    m_uiState.removeNodeWithActiveUserScroll(nodeID);
  • trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h

    r279133 r292812  
    5555    void repositionRelatedLayers() override;
    5656
     57    bool startAnimatedScrollToPosition(WebCore::FloatPoint) final;
     58    void stopAnimatedScroll() final;
     59
    5760    std::unique_ptr<ScrollingTreeScrollingNodeDelegateIOS> m_scrollingNodeDelegate;
    5861
  • trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm

    r283911 r292812  
    144144}
    145145
     146bool ScrollingTreeFrameScrollingNodeRemoteIOS::startAnimatedScrollToPosition(FloatPoint destinationPosition)
     147{
     148    // Main frame animated scrolls are handled via PageClientImpl::requestScroll().
     149    if (!m_scrollingNodeDelegate)
     150        return false;
     151
     152    bool started = m_scrollingNodeDelegate->startAnimatedScrollToPosition(destinationPosition);
     153    if (started)
     154        willStartAnimatedScroll();
     155    return started;
     156}
     157
     158void ScrollingTreeFrameScrollingNodeRemoteIOS::stopAnimatedScroll()
     159{
     160    // Main frame animated scrolls are handled via PageClientImpl::requestScroll().
     161    if (!m_scrollingNodeDelegate)
     162        return;
     163
     164    m_scrollingNodeDelegate->stopAnimatedScroll();
     165}
     166
    146167}
    147168#endif
  • trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm

    r291501 r292812  
    133133}
    134134
     135- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView
     136{
     137    _scrollingTreeNodeDelegate->scrollDidEnd();
     138}
     139
    135140- (CGPoint)_scrollView:(UIScrollView *)scrollView adjustedOffsetForOffset:(CGPoint)offset translation:(CGPoint)translation startPoint:(CGPoint)start locationInView:(CGPoint)locationInView horizontalVelocity:(inout double *)hv verticalVelocity:(inout double *)vv
    136141{
     
    332337{
    333338    BEGIN_BLOCK_OBJC_EXCEPTIONS
     339
     340    if ([scrollView() _isAnimatingScroll])
     341        return;
     342
    334343    [scrollView() setContentOffset:scrollingNode().currentScrollOffset()];
    335344    END_BLOCK_OBJC_EXCEPTIONS
  • trunk/Source/WebKit/UIProcess/WebPageProxy.h

    r292800 r292812  
    845845    void adjustLayersForLayoutViewport(const WebCore::FloatRect& layoutViewport);
    846846
    847     void scrollingNodeScrollViewWillStartPanGesture();
    848     void scrollingNodeScrollViewDidScroll();
    849     void scrollingNodeScrollWillStartScroll();
    850     void scrollingNodeScrollDidEndScroll();
     847    void scrollingNodeScrollViewWillStartPanGesture(WebCore::ScrollingNodeID);
     848    void scrollingNodeScrollViewDidScroll(WebCore::ScrollingNodeID);
     849    void scrollingNodeScrollWillStartScroll(WebCore::ScrollingNodeID);
     850    void scrollingNodeScrollDidEndScroll(WebCore::ScrollingNodeID);
    851851
    852852    void dynamicViewportSizeUpdate(const WebCore::FloatSize& viewLayoutSize, const WebCore::FloatSize& minimumUnobscuredSize, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, const WebCore::FloatBoxExtent& unobscuredSafeAreaInsets, double targetScale, int32_t deviceOrientation, double minimumEffectiveDeviceWidth, DynamicViewportSizeUpdateID);
  • trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in

    r292252 r292812  
    392392    UpdateInputContextAfterBlurringAndRefocusingElement()
    393393    FocusedElementDidChangeInputMode(enum:uint8_t WebCore::InputMode mode)
    394     ScrollingNodeScrollWillStartScroll()
    395     ScrollingNodeScrollDidEndScroll()
     394    ScrollingNodeScrollWillStartScroll(uint64_t nodeID)
     395    ScrollingNodeScrollDidEndScroll(uint64_t nodeID)
    396396    ShowInspectorHighlight(struct WebCore::InspectorOverlay::Highlight highlight)
    397397    HideInspectorHighlight()
  • trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h

    r292252 r292812  
    212212    void disableInspectorNodeSearch() override;
    213213
    214     void scrollingNodeScrollViewWillStartPanGesture() override;
    215     void scrollingNodeScrollViewDidScroll() override;
    216     void scrollingNodeScrollWillStartScroll() override;
    217     void scrollingNodeScrollDidEndScroll() override;
     214    void scrollingNodeScrollViewWillStartPanGesture(WebCore::ScrollingNodeID) override;
     215    void scrollingNodeScrollViewDidScroll(WebCore::ScrollingNodeID) override;
     216    void scrollingNodeScrollWillStartScroll(WebCore::ScrollingNodeID) override;
     217    void scrollingNodeScrollDidEndScroll(WebCore::ScrollingNodeID) override;
    218218       
    219219    void requestScrollToRect(const WebCore::FloatRect& targetRect, const WebCore::FloatPoint& origin) override;
  • trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm

    r292252 r292812  
    761761}
    762762
    763 void PageClientImpl::scrollingNodeScrollViewWillStartPanGesture()
     763void PageClientImpl::scrollingNodeScrollViewWillStartPanGesture(ScrollingNodeID)
    764764{
    765765    [m_contentView scrollViewWillStartPanOrPinchGesture];
    766766}
    767767
    768 void PageClientImpl::scrollingNodeScrollViewDidScroll()
     768void PageClientImpl::scrollingNodeScrollViewDidScroll(ScrollingNodeID)
    769769{
    770770    [m_contentView _didScroll];
    771771}
    772772
    773 void PageClientImpl::scrollingNodeScrollWillStartScroll()
    774 {
    775     [m_contentView _scrollingNodeScrollingWillBegin];
    776 }
    777 
    778 void PageClientImpl::scrollingNodeScrollDidEndScroll()
    779 {
    780     [m_contentView _scrollingNodeScrollingDidEnd];
     773void PageClientImpl::scrollingNodeScrollWillStartScroll(ScrollingNodeID nodeID)
     774{
     775    [m_contentView _scrollingNodeScrollingWillBegin:nodeID];
     776}
     777
     778void PageClientImpl::scrollingNodeScrollDidEndScroll(ScrollingNodeID nodeID)
     779{
     780    [m_contentView _scrollingNodeScrollingDidEnd:nodeID];
    781781}
    782782
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h

    r292252 r292812  
    662662- (void)_didScroll;
    663663- (void)_didEndScrollingOrZooming;
    664 - (void)_scrollingNodeScrollingWillBegin;
    665 - (void)_scrollingNodeScrollingDidEnd;
     664- (void)_scrollingNodeScrollingWillBegin:(WebCore::ScrollingNodeID)nodeID;
     665- (void)_scrollingNodeScrollingDidEnd:(WebCore::ScrollingNodeID)nodeID;
    666666- (void)_showPlaybackTargetPicker:(BOOL)hasVideo fromRect:(const WebCore::IntRect&)elementRect routeSharingPolicy:(WebCore::RouteSharingPolicy)policy routingContextUID:(NSString *)contextUID;
    667667- (void)_showRunOpenPanel:(API::OpenPanelParameters*)parameters frameInfo:(const WebKit::FrameInfoData&)frameInfo resultListener:(WebKit::WebOpenPanelResultListenerProxy*)listener;
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r292793 r292812  
    22872287}
    22882288
    2289 - (void)_scrollingNodeScrollingWillBegin
     2289- (void)_scrollingNodeScrollingWillBegin:(WebCore::ScrollingNodeID)scrollingNodeID
    22902290{
    22912291    [_textInteractionAssistant willStartScrollingOverflow];
    22922292}
    22932293
    2294 - (void)_scrollingNodeScrollingDidEnd
     2294- (void)_scrollingNodeScrollingDidEnd:(WebCore::ScrollingNodeID)scrollingNodeID
    22952295{
    22962296    // If scrolling ends before we've received a selection update,
     
    23022302    [self _updateChangedSelection];
    23032303    [_textInteractionAssistant didEndScrollingOverflow];
     2304
     2305    UIScrollView *targetScrollView = nil;
     2306    if (auto* scrollingCoordinator = _page->scrollingCoordinatorProxy())
     2307        targetScrollView = scrollingCoordinator->scrollViewForScrollingNodeID(scrollingNodeID);
     2308
     2309    [_webView _didFinishScrolling:targetScrollView];
    23042310}
    23052311
     
    63416347- (void)keyboardScrollViewAnimatorDidFinishScrolling:(WKKeyboardScrollViewAnimator *)animator
    63426348{
    6343     [_webView _didFinishScrolling];
     6349    [_webView _didFinishScrolling:self.webView.scrollView];
    63446350}
    63456351
  • trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm

    r292793 r292812  
    246246}
    247247
    248 void WebPageProxy::scrollingNodeScrollViewWillStartPanGesture()
    249 {
    250     pageClient().scrollingNodeScrollViewWillStartPanGesture();
    251 }
    252 
    253 void WebPageProxy::scrollingNodeScrollViewDidScroll()
    254 {
    255     pageClient().scrollingNodeScrollViewDidScroll();
    256 }
    257 
    258 void WebPageProxy::scrollingNodeScrollWillStartScroll()
    259 {
    260     pageClient().scrollingNodeScrollWillStartScroll();
    261 }
    262 
    263 void WebPageProxy::scrollingNodeScrollDidEndScroll()
    264 {
    265     pageClient().scrollingNodeScrollDidEndScroll();
     248void WebPageProxy::scrollingNodeScrollViewWillStartPanGesture(ScrollingNodeID nodeID)
     249{
     250    pageClient().scrollingNodeScrollViewWillStartPanGesture(nodeID);
     251}
     252
     253void WebPageProxy::scrollingNodeScrollViewDidScroll(ScrollingNodeID nodeID)
     254{
     255    pageClient().scrollingNodeScrollViewDidScroll(nodeID);
     256}
     257
     258void WebPageProxy::scrollingNodeScrollWillStartScroll(ScrollingNodeID nodeID)
     259{
     260    pageClient().scrollingNodeScrollWillStartScroll(nodeID);
     261}
     262
     263void WebPageProxy::scrollingNodeScrollDidEndScroll(ScrollingNodeID nodeID)
     264{
     265    pageClient().scrollingNodeScrollDidEndScroll(nodeID);
    266266}
    267267
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm

    r290794 r292812  
    9494void WebChromeClient::didStartOverflowScroll()
    9595{
    96     m_page.send(Messages::WebPageProxy::ScrollingNodeScrollWillStartScroll());
     96    // FIXME: This is only relevant for legacy touch-driven overflow in the web process (see ScrollAnimatorIOS::handleTouchEvent), and should be removed.
     97    m_page.send(Messages::WebPageProxy::ScrollingNodeScrollWillStartScroll(0));
    9798}
    9899
    99100void WebChromeClient::didEndOverflowScroll()
    100101{
    101     m_page.send(Messages::WebPageProxy::ScrollingNodeScrollDidEndScroll());
     102    // FIXME: This is only relevant for legacy touch-driven overflow in the web process (see ScrollAnimatorIOS::handleTouchEvent), and should be removed.
     103    m_page.send(Messages::WebPageProxy::ScrollingNodeScrollDidEndScroll(0));
    102104}
    103105
  • trunk/Tools/ChangeLog

    r292810 r292812  
     12022-04-13  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [css-scroll-snap] scrollIntoView fails with scroll-snap-type on :root
     4        https://bugs.webkit.org/show_bug.cgi?id=239063
     5        <rdar://problem/91603363>
     6
     7        Reviewed by Dean Jackson.
     8
     9        _didFinishScrolling: now works for subscrollers too.
     10
     11        * WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
     12        (-[TestRunnerWKWebView _didFinishScrolling:]):
     13        (-[TestRunnerWKWebView _didFinishScrolling]): Deleted.
     14
    1152022-04-13  Chris Dumez  <cdumez@apple.com>
    216
  • trunk/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm

    r281279 r292812  
    4545- (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(UIView *)view;
    4646- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(CGFloat)scale;
    47 - (void)_didFinishScrolling;
     47- (void)_didFinishScrolling:(UIScrollView *)scrollView;
    4848- (void)_scheduleVisibleContentRectUpdate;
    4949
     
    427427}
    428428
    429 - (void)_didFinishScrolling
    430 {
    431     [super _didFinishScrolling];
     429- (void)_didFinishScrolling:(UIScrollView *)scrollView
     430{
     431    [super _didFinishScrolling:scrollView];
    432432
    433433    if (self.didEndScrollingCallback)
Note: See TracChangeset for help on using the changeset viewer.