Changeset 219340 in webkit


Ignore:
Timestamp:
Jul 11, 2017 10:55:21 AM (7 years ago)
Author:
Wenson Hsieh
Message:

Address post-review feedback after http://trac.webkit.org/r219310
https://bugs.webkit.org/show_bug.cgi?id=174300
<rdar://problem/33030639>

Reviewed by Simon Fraser.

Source/WebCore:

Removes pan-gesture-related plumbing introduced in r219310 that is no longer necessary.

  • page/scrolling/ScrollingTree.h:

(WebCore::ScrollingTree::scrollingTreeNodeWillStartPanGesture):
(WebCore::ScrollingTree::scrollingTreeNodeDidEndPanGesture): Deleted.

Source/WebKit2:

Removes plumbing introduced in r219310 for telling WKContentView when the user has finished panning or zooming.
This was previously used to reset allowing asynchronous touch event after preventing the web touch events
gesture recognizer from firing.

However, a far simpler (and much less fragile) solution is to just set _canSendTouchEventsAsynchronously to NO
at the beginning of the gesture, before the first touchstart event is dispatched. This way, we always ensure
that _canSendTouchEventsAsynchronously is NO when beginning to process a touch event. This approach is correct
because the only place where we query _canSendTouchEventsAsynchronously is in -_webTouchEventsRecognized:, where
(when we are beginning a new gesture) we are guaranteed that -gestureRecognizer:shouldIgnoreWebTouchWithEvent:
has already been called and _canSendTouchEventsAsynchronously is NO.

Confirmed that the LayoutTests added in r219310 still pass.

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView scrollViewDidEndDragging:willDecelerate:]):
(-[WKWebView scrollViewDidEndZooming:withView:atScale:]):

  • UIProcess/PageClient.h:
  • UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
  • UIProcess/Scrolling/RemoteScrollingTree.cpp:

(WebKit::RemoteScrollingTree::scrollingTreeNodeDidEndPanGesture): Deleted.

  • UIProcess/Scrolling/RemoteScrollingTree.h:
  • UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
  • UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:

(-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]):
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewDidEndPanGesture): Deleted.

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

(WebKit::PageClientImpl::overflowScrollViewDidEndPanGesture): Deleted.

  • UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:

(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidEndPanGesture): Deleted.

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

(-[WKContentView gestureRecognizer:shouldIgnoreWebTouchWithEvent:]):
(-[WKContentView scrollViewDidEndPanOrPinchGesture]): Deleted.

  • UIProcess/ios/WebPageProxyIOS.mm:

(WebKit::WebPageProxy::overflowScrollViewDidEndPanGesture): Deleted.

Location:
trunk/Source
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r219338 r219340  
     12017-07-11  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Address post-review feedback after http://trac.webkit.org/r219310
     4        https://bugs.webkit.org/show_bug.cgi?id=174300
     5        <rdar://problem/33030639>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Removes pan-gesture-related plumbing introduced in r219310 that is no longer necessary.
     10
     11        * page/scrolling/ScrollingTree.h:
     12        (WebCore::ScrollingTree::scrollingTreeNodeWillStartPanGesture):
     13        (WebCore::ScrollingTree::scrollingTreeNodeDidEndPanGesture): Deleted.
     14
    1152017-07-11  Alex Christensen  <achristensen@webkit.org>
    216
  • trunk/Source/WebCore/page/scrolling/ScrollingTree.h

    r219310 r219340  
    102102    virtual FloatRect fixedPositionRect() = 0;
    103103    virtual void scrollingTreeNodeWillStartPanGesture() { }
    104     virtual void scrollingTreeNodeDidEndPanGesture() { }
    105104    virtual void scrollingTreeNodeWillStartScroll() { }
    106105    virtual void scrollingTreeNodeDidEndScroll() { }
  • trunk/Source/WebKit2/ChangeLog

    r219337 r219340  
     12017-07-11  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Address post-review feedback after http://trac.webkit.org/r219310
     4        https://bugs.webkit.org/show_bug.cgi?id=174300
     5        <rdar://problem/33030639>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Removes plumbing introduced in r219310 for telling WKContentView when the user has finished panning or zooming.
     10        This was previously used to reset allowing asynchronous touch event after preventing the web touch events
     11        gesture recognizer from firing.
     12
     13        However, a far simpler (and much less fragile) solution is to just set _canSendTouchEventsAsynchronously to NO
     14        at the beginning of the gesture, before the first `touchstart` event is dispatched. This way, we always ensure
     15        that _canSendTouchEventsAsynchronously is NO when beginning to process a touch event. This approach is correct
     16        because the only place where we query _canSendTouchEventsAsynchronously is in -_webTouchEventsRecognized:, where
     17        (when we are beginning a new gesture) we are guaranteed that -gestureRecognizer:shouldIgnoreWebTouchWithEvent:
     18        has already been called and _canSendTouchEventsAsynchronously is NO.
     19
     20        Confirmed that the LayoutTests added in r219310 still pass.
     21
     22        * UIProcess/API/Cocoa/WKWebView.mm:
     23        (-[WKWebView scrollViewDidEndDragging:willDecelerate:]):
     24        (-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
     25        * UIProcess/PageClient.h:
     26        * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
     27        * UIProcess/Scrolling/RemoteScrollingTree.cpp:
     28        (WebKit::RemoteScrollingTree::scrollingTreeNodeDidEndPanGesture): Deleted.
     29        * UIProcess/Scrolling/RemoteScrollingTree.h:
     30        * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
     31        * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
     32        (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]):
     33        (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewDidEndPanGesture): Deleted.
     34        * UIProcess/WebPageProxy.h:
     35        * UIProcess/ios/PageClientImplIOS.h:
     36        * UIProcess/ios/PageClientImplIOS.mm:
     37        (WebKit::PageClientImpl::overflowScrollViewDidEndPanGesture): Deleted.
     38        * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
     39        (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidEndPanGesture): Deleted.
     40        * UIProcess/ios/WKContentViewInteraction.h:
     41        * UIProcess/ios/WKContentViewInteraction.mm:
     42        (-[WKContentView gestureRecognizer:shouldIgnoreWebTouchWithEvent:]):
     43        (-[WKContentView scrollViewDidEndPanOrPinchGesture]): Deleted.
     44        * UIProcess/ios/WebPageProxyIOS.mm:
     45        (WebKit::WebPageProxy::overflowScrollViewDidEndPanGesture): Deleted.
     46
    1472017-07-11  Brent Fulgham  <bfulgham@apple.com>
    248
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm

    r219314 r219340  
    21512151    if (!decelerate)
    21522152        [self _didFinishScrolling];
    2153 
    2154     if (scrollView.panGestureRecognizer.state == UIGestureRecognizerStateEnded)
    2155         [_contentView scrollViewDidEndPanOrPinchGesture];
    21562153}
    21572154
     
    21882185    [self _scheduleVisibleContentRectUpdateAfterScrollInView:scrollView];
    21892186    [_contentView didZoomToScale:scale];
    2190 
    2191     if (scrollView.pinchGestureRecognizer.state == UIGestureRecognizerStateEnded)
    2192         [_contentView scrollViewDidEndPanOrPinchGesture];
    21932187}
    21942188
  • trunk/Source/WebKit2/UIProcess/PageClient.h

    r219310 r219340  
    309309    virtual WebCore::FloatRect documentRect() const = 0;
    310310    virtual void overflowScrollViewWillStartPanGesture() = 0;
    311     virtual void overflowScrollViewDidEndPanGesture() = 0;
    312311    virtual void overflowScrollViewDidScroll() = 0;
    313312    virtual void overflowScrollWillStartScroll() = 0;
  • trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h

    r219310 r219340  
    8787    WebCore::FloatRect customFixedPositionRect() const;
    8888    void scrollingTreeNodeWillStartPanGesture();
    89     void scrollingTreeNodeDidEndPanGesture();
    9089    void scrollingTreeNodeWillStartScroll();
    9190    void scrollingTreeNodeDidEndScroll();
  • trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.cpp

    r219310 r219340  
    8989}
    9090
    91 void RemoteScrollingTree::scrollingTreeNodeDidEndPanGesture()
    92 {
    93     m_scrollingCoordinatorProxy.scrollingTreeNodeDidEndPanGesture();
    94 }
    95    
    9691void RemoteScrollingTree::scrollingTreeNodeWillStartScroll()
    9792{
  • trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.h

    r219310 r219340  
    6262    WebCore::FloatRect fixedPositionRect() override;
    6363    void scrollingTreeNodeWillStartPanGesture() override;
    64     void scrollingTreeNodeDidEndPanGesture() override;
    6564    void scrollingTreeNodeWillStartScroll() override;
    6665    void scrollingTreeNodeDidEndScroll() override;
  • trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h

    r219310 r219340  
    4545    void overflowScrollDidEnd();
    4646    void overflowScrollViewWillStartPanGesture();
    47     void overflowScrollViewDidEndPanGesture();
    4847    void scrollViewDidScroll(const WebCore::FloatPoint&, bool inUserInteration);
    4948    void currentSnapPointIndicesDidChange(unsigned horizontal, unsigned vertical);
  • trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm

    r219310 r219340  
    118118        _scrollingTreeNode->overflowScrollDidEnd();
    119119    }
    120 
    121     if (scrollView.panGestureRecognizer.state == UIGestureRecognizerStateEnded)
    122         _scrollingTreeNode->overflowScrollViewDidEndPanGesture();
    123120}
    124121
     
    298295}
    299296
    300 void ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewDidEndPanGesture()
    301 {
    302     scrollingTree().scrollingTreeNodeDidEndPanGesture();
    303 }
    304 
    305297void ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll(const FloatPoint& scrollPosition, bool inUserInteration)
    306298{
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r219330 r219340  
    496496
    497497    void overflowScrollViewWillStartPanGesture();
    498     void overflowScrollViewDidEndPanGesture();
    499498    void overflowScrollViewDidScroll();
    500499    void overflowScrollWillStartScroll();
  • trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h

    r219310 r219340  
    152152
    153153    void overflowScrollViewWillStartPanGesture() override;
    154     void overflowScrollViewDidEndPanGesture() override;
    155154    void overflowScrollViewDidScroll() override;
    156155    void overflowScrollWillStartScroll() override;
  • trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm

    r219310 r219340  
    672672}
    673673
    674 void PageClientImpl::overflowScrollViewDidEndPanGesture()
    675 {
    676     [m_contentView scrollViewDidEndPanOrPinchGesture];
    677 }
    678 
    679674void PageClientImpl::overflowScrollViewDidScroll()
    680675{
  • trunk/Source/WebKit2/UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm

    r219310 r219340  
    105105}
    106106
    107 void RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidEndPanGesture()
    108 {
    109     m_webPageProxy.overflowScrollViewDidEndPanGesture();
    110 }
    111 
    112107void RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartScroll()
    113108{
  • trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h

    r219310 r219340  
    280280
    281281- (void)scrollViewWillStartPanOrPinchGesture;
    282 - (void)scrollViewDidEndPanOrPinchGesture;
    283282
    284283- (BOOL)canBecomeFirstResponderForWebView;
  • trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm

    r219310 r219340  
    18441844
    18451845    _canSendTouchEventsAsynchronously = YES;
    1846 }
    1847 
    1848 - (void)scrollViewDidEndPanOrPinchGesture
    1849 {
    1850     _canSendTouchEventsAsynchronously = NO;
    18511846}
    18521847
     
    40644059- (BOOL)gestureRecognizer:(UIWebTouchEventsGestureRecognizer *)gestureRecognizer shouldIgnoreWebTouchWithEvent:(UIEvent *)event
    40654060{
     4061    _canSendTouchEventsAsynchronously = NO;
     4062
    40664063    NSSet<UITouch *> *touches = [event touchesForGestureRecognizer:gestureRecognizer];
    40674064    for (UITouch *touch in touches) {
  • trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm

    r219310 r219340  
    273273}
    274274
    275 void WebPageProxy::overflowScrollViewDidEndPanGesture()
    276 {
    277     m_pageClient.overflowScrollViewDidEndPanGesture();
    278 }
    279 
    280275void WebPageProxy::overflowScrollViewDidScroll()
    281276{
Note: See TracChangeset for help on using the changeset viewer.