Changeset 245134 in webkit


Ignore:
Timestamp:
May 9, 2019 7:16:44 AM (5 years ago)
Author:
graouts@webkit.org
Message:

pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html is a timeout
https://bugs.webkit.org/show_bug.cgi?id=197738
<rdar://problem/50588613>

Reviewed by Antti Koivisto.

Source/WebKit:

We clear the touch actions for a given touch identifier when the matching touch is released in -[WKContentViewInteraction _handleTouchActionsForTouchEvent:].
This happens before -[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:] is called and thus, which we correctly
respected the touch actions during the panning gesture, we would not be able to respect them during the deceleration animation. This caused the test to fail
because it would check that no scrolling happened after the panning gesture completed, ie. during the deceleration animation.

To work around this, we now store the touch actions for a given UIScrollView interaction in the ScrollingTreeScrollingNodeDelegateIOS object when the interaction
starts.

  • UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:

(WebKit::ScrollingTreeScrollingNodeDelegateIOS::activeTouchActions const):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::clearActiveTouchActions):

  • UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:

(-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
(-[WKScrollingNodeScrollViewDelegate _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::computeActiveTouchActionsForGestureRecognizer):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::activeTouchActionsForGestureRecognizer const): Deleted.

LayoutTests:

To pass, this test must also disable the legacy "-webkit-overflow-scrolling: touch" behavior.

  • pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r245126 r245134  
     12019-05-09  Antoine Quint  <graouts@apple.com>
     2
     3        pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html is a timeout
     4        https://bugs.webkit.org/show_bug.cgi?id=197738
     5        <rdar://problem/50588613>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        To pass, this test must also disable the legacy "-webkit-overflow-scrolling: touch" behavior.
     10
     11        * pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html:
     12
    1132019-05-09  Antti Koivisto  <antti@apple.com>
    214
  • trunk/LayoutTests/pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html

    r243347 r245134  
    1 <!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true ] -->
     1<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true internal:LegacyOverflowScrollingTouchEnabled=false ] -->
    22<html>
    33<head>
  • trunk/Source/WebKit/ChangeLog

    r245112 r245134  
     12019-05-09  Antoine Quint  <graouts@apple.com>
     2
     3        pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html is a timeout
     4        https://bugs.webkit.org/show_bug.cgi?id=197738
     5        <rdar://problem/50588613>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        We clear the touch actions for a given touch identifier when the matching touch is released in -[WKContentViewInteraction _handleTouchActionsForTouchEvent:].
     10        This happens before -[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:] is called and thus, which we correctly
     11        respected the touch actions during the panning gesture, we would not be able to respect them during the deceleration animation. This caused the test to fail
     12        because it would check that no scrolling happened after the panning gesture completed, ie. during the deceleration animation.
     13
     14        To work around this, we now store the touch actions for a given UIScrollView interaction in the ScrollingTreeScrollingNodeDelegateIOS object when the interaction
     15        starts.
     16
     17        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
     18        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::activeTouchActions const):
     19        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::clearActiveTouchActions):
     20        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
     21        (-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
     22        (-[WKScrollingNodeScrollViewDelegate _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]):
     23        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::computeActiveTouchActionsForGestureRecognizer):
     24        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::activeTouchActionsForGestureRecognizer const): Deleted.
     25
    1262019-05-08  Antoine Quint  <graouts@apple.com>
    227
  • trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h

    r245112 r245134  
    6767
    6868#if ENABLE(POINTER_EVENTS)
    69     OptionSet<TouchAction> activeTouchActionsForGestureRecognizer(UIGestureRecognizer*) const;
     69    OptionSet<TouchAction> activeTouchActions() const { return m_activeTouchActions; }
     70    void computeActiveTouchActionsForGestureRecognizer(UIGestureRecognizer*);
     71    void clearActiveTouchActions() { m_activeTouchActions = { }; }
    7072    void cancelPointersForGestureRecognizer(UIGestureRecognizer*);
    7173#endif
     
    7577    RetainPtr<CALayer> m_scrolledContentsLayer;
    7678    RetainPtr<WKScrollingNodeScrollViewDelegate> m_scrollViewDelegate;
     79#if ENABLE(POINTER_EVENTS)
     80    OptionSet<TouchAction> m_activeTouchActions { };
     81#endif
    7782    bool m_updatingFromStateNode { false };
    7883};
  • trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm

    r245112 r245134  
    8080#if ENABLE(POINTER_EVENTS)
    8181    if (![scrollView isZooming]) {
    82         auto touchActions = _scrollingTreeNodeDelegate->activeTouchActionsForGestureRecognizer(scrollView.panGestureRecognizer);
     82        auto touchActions = _scrollingTreeNodeDelegate->activeTouchActions();
     83        _scrollingTreeNodeDelegate->clearActiveTouchActions();
     84       
    8385        if (touchActions && !touchActions.containsAny({ WebCore::TouchAction::Auto, WebCore::TouchAction::Manipulation })) {
    8486            bool canPanX = true;
     
    148150{
    149151    auto* panGestureRecognizer = scrollView.panGestureRecognizer;
    150     auto touchActions = _scrollingTreeNodeDelegate->activeTouchActionsForGestureRecognizer(panGestureRecognizer);
     152    _scrollingTreeNodeDelegate->computeActiveTouchActionsForGestureRecognizer(panGestureRecognizer);
     153    auto touchActions = _scrollingTreeNodeDelegate->activeTouchActions();
     154
    151155    if (!touchActions) {
    152156        [self cancelPointersForGestureRecognizer:panGestureRecognizer];
     
    337341
    338342#if ENABLE(POINTER_EVENTS)
    339 OptionSet<TouchAction> ScrollingTreeScrollingNodeDelegateIOS::activeTouchActionsForGestureRecognizer(UIGestureRecognizer* gestureRecognizer) const
     343void ScrollingTreeScrollingNodeDelegateIOS::computeActiveTouchActionsForGestureRecognizer(UIGestureRecognizer* gestureRecognizer)
    340344{
    341345    auto& scrollingCoordinatorProxy = downcast<RemoteScrollingTree>(scrollingTree()).scrollingCoordinatorProxy();
    342346    if (auto touchIdentifier = scrollingCoordinatorProxy.webPageProxy().pageClient().activeTouchIdentifierForGestureRecognizer(gestureRecognizer))
    343         return scrollingCoordinatorProxy.activeTouchActionsForTouchIdentifier(*touchIdentifier);
    344     return { };
     347        m_activeTouchActions = scrollingCoordinatorProxy.activeTouchActionsForTouchIdentifier(*touchIdentifier);
    345348}
    346349
Note: See TracChangeset for help on using the changeset viewer.