Title: [219340] trunk/Source
Revision
219340
Author
[email protected]
Date
2017-07-11 10:55:21 -0700 (Tue, 11 Jul 2017)

Log 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.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (219339 => 219340)


--- trunk/Source/WebCore/ChangeLog	2017-07-11 17:45:40 UTC (rev 219339)
+++ trunk/Source/WebCore/ChangeLog	2017-07-11 17:55:21 UTC (rev 219340)
@@ -1,3 +1,17 @@
+2017-07-11  Wenson Hsieh  <[email protected]>
+
+        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.
+
+        Removes pan-gesture-related plumbing introduced in r219310 that is no longer necessary.
+
+        * page/scrolling/ScrollingTree.h:
+        (WebCore::ScrollingTree::scrollingTreeNodeWillStartPanGesture):
+        (WebCore::ScrollingTree::scrollingTreeNodeDidEndPanGesture): Deleted.
+
 2017-07-11  Alex Christensen  <[email protected]>
 
         Reduce URL size

Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.h (219339 => 219340)


--- trunk/Source/WebCore/page/scrolling/ScrollingTree.h	2017-07-11 17:45:40 UTC (rev 219339)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.h	2017-07-11 17:55:21 UTC (rev 219340)
@@ -101,7 +101,6 @@
 #if PLATFORM(IOS)
     virtual FloatRect fixedPositionRect() = 0;
     virtual void scrollingTreeNodeWillStartPanGesture() { }
-    virtual void scrollingTreeNodeDidEndPanGesture() { }
     virtual void scrollingTreeNodeWillStartScroll() { }
     virtual void scrollingTreeNodeDidEndScroll() { }
 #endif

Modified: trunk/Source/WebKit2/ChangeLog (219339 => 219340)


--- trunk/Source/WebKit2/ChangeLog	2017-07-11 17:45:40 UTC (rev 219339)
+++ trunk/Source/WebKit2/ChangeLog	2017-07-11 17:55:21 UTC (rev 219340)
@@ -1,3 +1,49 @@
+2017-07-11  Wenson Hsieh  <[email protected]>
+
+        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.
+
+        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.
+
 2017-07-11  Brent Fulgham  <[email protected]>
 
         Unreviewed clean-up after r219323

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (219339 => 219340)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2017-07-11 17:45:40 UTC (rev 219339)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2017-07-11 17:55:21 UTC (rev 219340)
@@ -2150,9 +2150,6 @@
     // If we're decelerating, scroll offset will be updated when scrollViewDidFinishDecelerating: is called.
     if (!decelerate)
         [self _didFinishScrolling];
-
-    if (scrollView.panGestureRecognizer.state == UIGestureRecognizerStateEnded)
-        [_contentView scrollViewDidEndPanOrPinchGesture];
 }
 
 - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
@@ -2187,9 +2184,6 @@
     ASSERT(scrollView == _scrollView);
     [self _scheduleVisibleContentRectUpdateAfterScrollInView:scrollView];
     [_contentView didZoomToScale:scale];
-
-    if (scrollView.pinchGestureRecognizer.state == UIGestureRecognizerStateEnded)
-        [_contentView scrollViewDidEndPanOrPinchGesture];
 }
 
 - (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView

Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (219339 => 219340)


--- trunk/Source/WebKit2/UIProcess/PageClient.h	2017-07-11 17:45:40 UTC (rev 219339)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h	2017-07-11 17:55:21 UTC (rev 219340)
@@ -308,7 +308,6 @@
     virtual double minimumZoomScale() const = 0;
     virtual WebCore::FloatRect documentRect() const = 0;
     virtual void overflowScrollViewWillStartPanGesture() = 0;
-    virtual void overflowScrollViewDidEndPanGesture() = 0;
     virtual void overflowScrollViewDidScroll() = 0;
     virtual void overflowScrollWillStartScroll() = 0;
     virtual void overflowScrollDidEndScroll() = 0;

Modified: trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h (219339 => 219340)


--- trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h	2017-07-11 17:45:40 UTC (rev 219339)
+++ trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h	2017-07-11 17:55:21 UTC (rev 219340)
@@ -86,7 +86,6 @@
 #if PLATFORM(IOS)
     WebCore::FloatRect customFixedPositionRect() const;
     void scrollingTreeNodeWillStartPanGesture();
-    void scrollingTreeNodeDidEndPanGesture();
     void scrollingTreeNodeWillStartScroll();
     void scrollingTreeNodeDidEndScroll();
 #if ENABLE(CSS_SCROLL_SNAP)

Modified: trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.cpp (219339 => 219340)


--- trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.cpp	2017-07-11 17:45:40 UTC (rev 219339)
+++ trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.cpp	2017-07-11 17:55:21 UTC (rev 219340)
@@ -88,11 +88,6 @@
     m_scrollingCoordinatorProxy.scrollingTreeNodeWillStartPanGesture();
 }
 
-void RemoteScrollingTree::scrollingTreeNodeDidEndPanGesture()
-{
-    m_scrollingCoordinatorProxy.scrollingTreeNodeDidEndPanGesture();
-}
-    
 void RemoteScrollingTree::scrollingTreeNodeWillStartScroll()
 {
     m_scrollingCoordinatorProxy.scrollingTreeNodeWillStartScroll();

Modified: trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.h (219339 => 219340)


--- trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.h	2017-07-11 17:45:40 UTC (rev 219339)
+++ trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.h	2017-07-11 17:55:21 UTC (rev 219340)
@@ -61,7 +61,6 @@
 #if PLATFORM(IOS)
     WebCore::FloatRect fixedPositionRect() override;
     void scrollingTreeNodeWillStartPanGesture() override;
-    void scrollingTreeNodeDidEndPanGesture() override;
     void scrollingTreeNodeWillStartScroll() override;
     void scrollingTreeNodeDidEndScroll() override;
 #endif

Modified: trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h (219339 => 219340)


--- trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h	2017-07-11 17:45:40 UTC (rev 219339)
+++ trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h	2017-07-11 17:55:21 UTC (rev 219340)
@@ -44,7 +44,6 @@
     void overflowScrollWillStart();
     void overflowScrollDidEnd();
     void overflowScrollViewWillStartPanGesture();
-    void overflowScrollViewDidEndPanGesture();
     void scrollViewDidScroll(const WebCore::FloatPoint&, bool inUserInteration);
     void currentSnapPointIndicesDidChange(unsigned horizontal, unsigned vertical);
 

Modified: trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm (219339 => 219340)


--- trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm	2017-07-11 17:45:40 UTC (rev 219339)
+++ trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm	2017-07-11 17:55:21 UTC (rev 219340)
@@ -117,9 +117,6 @@
         _scrollingTreeNode->scrollViewDidScroll(scrollView.contentOffset, _inUserInteraction);
         _scrollingTreeNode->overflowScrollDidEnd();
     }
-
-    if (scrollView.panGestureRecognizer.state == UIGestureRecognizerStateEnded)
-        _scrollingTreeNode->overflowScrollViewDidEndPanGesture();
 }
 
 - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
@@ -297,11 +294,6 @@
     scrollingTree().scrollingTreeNodeWillStartPanGesture();
 }
 
-void ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewDidEndPanGesture()
-{
-    scrollingTree().scrollingTreeNodeDidEndPanGesture();
-}
-
 void ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll(const FloatPoint& scrollPosition, bool inUserInteration)
 {
     if (m_updatingFromStateNode)

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (219339 => 219340)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2017-07-11 17:45:40 UTC (rev 219339)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2017-07-11 17:55:21 UTC (rev 219340)
@@ -495,7 +495,6 @@
     WebCore::FloatRect computeCustomFixedPositionRect(const WebCore::FloatRect& unobscuredContentRect, const WebCore::FloatRect& unobscuredContentRectRespectingInputViewBounds, const WebCore::FloatRect& currentCustomFixedPositionRect, double displayedContentScale, WebCore::FrameView::LayoutViewportConstraint = WebCore::FrameView::LayoutViewportConstraint::Unconstrained, bool visualViewportEnabled = false) const;
 
     void overflowScrollViewWillStartPanGesture();
-    void overflowScrollViewDidEndPanGesture();
     void overflowScrollViewDidScroll();
     void overflowScrollWillStartScroll();
     void overflowScrollDidEndScroll();

Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h (219339 => 219340)


--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h	2017-07-11 17:45:40 UTC (rev 219339)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h	2017-07-11 17:55:21 UTC (rev 219340)
@@ -151,7 +151,6 @@
     void disableInspectorNodeSearch() override;
 
     void overflowScrollViewWillStartPanGesture() override;
-    void overflowScrollViewDidEndPanGesture() override;
     void overflowScrollViewDidScroll() override;
     void overflowScrollWillStartScroll() override;
     void overflowScrollDidEndScroll() override;

Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm (219339 => 219340)


--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm	2017-07-11 17:45:40 UTC (rev 219339)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm	2017-07-11 17:55:21 UTC (rev 219340)
@@ -671,11 +671,6 @@
     [m_contentView scrollViewWillStartPanOrPinchGesture];
 }
 
-void PageClientImpl::overflowScrollViewDidEndPanGesture()
-{
-    [m_contentView scrollViewDidEndPanOrPinchGesture];
-}
-
 void PageClientImpl::overflowScrollViewDidScroll()
 {
     [m_contentView _didScroll];

Modified: trunk/Source/WebKit2/UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm (219339 => 219340)


--- trunk/Source/WebKit2/UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm	2017-07-11 17:45:40 UTC (rev 219339)
+++ trunk/Source/WebKit2/UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm	2017-07-11 17:55:21 UTC (rev 219340)
@@ -104,11 +104,6 @@
     m_webPageProxy.overflowScrollViewWillStartPanGesture();
 }
 
-void RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidEndPanGesture()
-{
-    m_webPageProxy.overflowScrollViewDidEndPanGesture();
-}
-
 void RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartScroll()
 {
     m_webPageProxy.overflowScrollWillStartScroll();

Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h (219339 => 219340)


--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h	2017-07-11 17:45:40 UTC (rev 219339)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h	2017-07-11 17:55:21 UTC (rev 219340)
@@ -279,7 +279,6 @@
 - (void)cleanupInteraction;
 
 - (void)scrollViewWillStartPanOrPinchGesture;
-- (void)scrollViewDidEndPanOrPinchGesture;
 
 - (BOOL)canBecomeFirstResponderForWebView;
 - (BOOL)becomeFirstResponderForWebView;

Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (219339 => 219340)


--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm	2017-07-11 17:45:40 UTC (rev 219339)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm	2017-07-11 17:55:21 UTC (rev 219340)
@@ -1845,11 +1845,6 @@
     _canSendTouchEventsAsynchronously = YES;
 }
 
-- (void)scrollViewDidEndPanOrPinchGesture
-{
-    _canSendTouchEventsAsynchronously = NO;
-}
-
 - (void)_didEndScrollingOrZooming
 {
     if (!_needsDeferredEndScrollingSelectionUpdate) {
@@ -4063,6 +4058,8 @@
 
 - (BOOL)gestureRecognizer:(UIWebTouchEventsGestureRecognizer *)gestureRecognizer shouldIgnoreWebTouchWithEvent:(UIEvent *)event
 {
+    _canSendTouchEventsAsynchronously = NO;
+
     NSSet<UITouch *> *touches = [event touchesForGestureRecognizer:gestureRecognizer];
     for (UITouch *touch in touches) {
         if ([touch.view isKindOfClass:[UIScrollView class]] && [(UIScrollView *)touch.view _isInterruptingDeceleration])

Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (219339 => 219340)


--- trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm	2017-07-11 17:45:40 UTC (rev 219339)
+++ trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm	2017-07-11 17:55:21 UTC (rev 219340)
@@ -272,11 +272,6 @@
     m_pageClient.overflowScrollViewWillStartPanGesture();
 }
 
-void WebPageProxy::overflowScrollViewDidEndPanGesture()
-{
-    m_pageClient.overflowScrollViewDidEndPanGesture();
-}
-
 void WebPageProxy::overflowScrollViewDidScroll()
 {
     m_pageClient.overflowScrollViewDidScroll();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to