[iOS][WK2] Update the long press interactions correctly when an overflow scroll view...
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jun 2014 05:00:13 +0000 (05:00 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jun 2014 05:00:13 +0000 (05:00 +0000)
https://bugs.webkit.org/show_bug.cgi?id=134334

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-06-25
Reviewed by Simon Fraser.

* UIProcess/PageClient.h:
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
(-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]):
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewWillStartPanGesture):
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewWillStartPanGesture): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::overflowScrollViewWillStartPanGesture):
(WebKit::PageClientImpl::overflowScrollViewDidScroll):
(WebKit::PageClientImpl::scrollViewWillStartPanGesture): Deleted.
* UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartPanGesture):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::overflowScrollViewWillStartPanGesture):
(WebKit::WebPageProxy::overflowScrollViewDidScroll):
(WebKit::WebPageProxy::scrollViewWillStartPanGesture): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170466 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/PageClient.h
Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp
Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h
Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/ios/PageClientImplIOS.h
Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm
Source/WebKit2/UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm
Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h
Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm

index 0fc1f53787de7282f74389120c159f7b71663e6b..96fa2aefaa2044bca5bea30464686ad251188cd7 100644 (file)
@@ -1,3 +1,32 @@
+2014-06-25  Benjamin Poulain  <bpoulain@apple.com>
+
+        [iOS][WK2] Update the long press interactions correctly when an overflow scroll view scrolls
+        https://bugs.webkit.org/show_bug.cgi?id=134334
+
+        Reviewed by Simon Fraser.
+
+        * UIProcess/PageClient.h:
+        * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
+        (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
+        * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
+        * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
+        (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]):
+        (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewWillStartPanGesture):
+        (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewWillStartPanGesture): Deleted.
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/ios/PageClientImplIOS.h:
+        * UIProcess/ios/PageClientImplIOS.mm:
+        (WebKit::PageClientImpl::overflowScrollViewWillStartPanGesture):
+        (WebKit::PageClientImpl::overflowScrollViewDidScroll):
+        (WebKit::PageClientImpl::scrollViewWillStartPanGesture): Deleted.
+        * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
+        (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartPanGesture):
+        * UIProcess/ios/WKContentViewInteraction.h:
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::overflowScrollViewWillStartPanGesture):
+        (WebKit::WebPageProxy::overflowScrollViewDidScroll):
+        (WebKit::WebPageProxy::scrollViewWillStartPanGesture): Deleted.
+
 2014-06-25  Simon Fraser  <simon.fraser@apple.com>
 
         [iOS WK2] Page jumps when rubber-banding on azuremagazine.com 
index 71f8ae152d18e7a1d40cf0177427af6b27c4accd..f085d31f5096a59bdce8f26b13e8c440fed8f784 100644 (file)
@@ -271,7 +271,8 @@ public:
     virtual void setUsesMinimalUI(bool) = 0;
     virtual double minimumZoomScale() const = 0;
     virtual WebCore::FloatSize contentsSize() const = 0;
-    virtual void scrollViewWillStartPanGesture() = 0;
+    virtual void overflowScrollViewWillStartPanGesture() = 0;
+    virtual void overflowScrollViewDidScroll() = 0;
     virtual void didFinishDrawingPagesToPDF(const IPC::DataReference&) = 0;
 
 #if ENABLE(INSPECTOR)
index 15cc8e10bb006ec07a4d6c05011d3d3377e8f5dd..b9fb93e8b6e7799db224aa400d1000749867b06f 100644 (file)
@@ -167,6 +167,9 @@ void RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll(ScrollingNodeID
     if (!m_propagatesMainFrameScrolls && scrolledNodeID == rootScrollingNodeID())
         return;
 
+#if PLATFORM(IOS)
+    m_webPageProxy.overflowScrollViewDidScroll();
+#endif
     m_webPageProxy.send(Messages::RemoteScrollingCoordinator::ScrollPositionChangedForNode(scrolledNodeID, newScrollPosition, scrollingLayerPositionAction));
 }
 
index 3c6b4e08c119a9ba6da4ae8dceac6ba230480c7c..cb7440af94daa291b096b9102805761f7127980a 100644 (file)
@@ -40,7 +40,7 @@ public:
     static PassRefPtr<ScrollingTreeOverflowScrollingNodeIOS> create(WebCore::ScrollingTree&, WebCore::ScrollingNodeID);
     virtual ~ScrollingTreeOverflowScrollingNodeIOS();
 
-    void scrollViewWillStartPanGesture();
+    void overflowScrollViewWillStartPanGesture();
     void scrollViewDidScroll(const WebCore::FloatPoint&, bool inUserInteration);
 
     CALayer *scrollLayer() const { return m_scrollLayer.get(); }
index fda21fffbbc2007ca4371d912f3f9ac06d441ba5..228b3214610e19e2cb94b5569068083574c0e7dc 100644 (file)
@@ -68,7 +68,7 @@ using namespace WebCore;
     _inUserInteraction = YES;
 
     if (scrollView.panGestureRecognizer.state == UIGestureRecognizerStateBegan)
-        _scrollingTreeNode->scrollViewWillStartPanGesture();
+        _scrollingTreeNode->overflowScrollViewWillStartPanGesture();
 }
 
 - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)willDecelerate
@@ -195,7 +195,7 @@ void ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll(const Fl
         child->updateLayersAfterAncestorChange(*this, fixedPositionRect, scrollDelta);
 }
 
-void ScrollingTreeOverflowScrollingNodeIOS::scrollViewWillStartPanGesture()
+void ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewWillStartPanGesture()
 {
     scrollingTree().scrollingTreeNodeWillStartPanGesture();
 }
index 8860e6f0fde91eafac947230b624337e3963237b..2187458ddbe4a15fc73956cb425b34b13d6679b8 100644 (file)
@@ -386,7 +386,8 @@ public:
 
     enum class UnobscuredRectConstraint { ConstrainedToDocumentRect, Unconstrained };
     WebCore::FloatRect computeCustomFixedPositionRect(const WebCore::FloatRect& unobscuredContentRect, double displayedContentScale, UnobscuredRectConstraint = UnobscuredRectConstraint::Unconstrained) const;
-    void scrollViewWillStartPanGesture();
+    void overflowScrollViewWillStartPanGesture();
+    void overflowScrollViewDidScroll();
 
     void dynamicViewportSizeUpdate(const WebCore::FloatSize& minimumLayoutSize, const WebCore::FloatSize& minimumLayoutSizeForMinimalUI, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, double targetScale, int32_t deviceOrientation);
     void synchronizeDynamicViewportUpdate();
index 59a2bc7c682de6fd7aa133e136ebb330bb3bdbb6..110d6a59f608bc48b4fc70d03f62d55e06e18b8d 100644 (file)
@@ -143,7 +143,8 @@ private:
 #endif
 
     virtual void zoomToRect(WebCore::FloatRect, double minimumScale, double maximumScale) override;
-    virtual void scrollViewWillStartPanGesture() override;
+    virtual void overflowScrollViewWillStartPanGesture() override;
+    virtual void overflowScrollViewDidScroll() override;
     virtual void didFinishDrawingPagesToPDF(const IPC::DataReference&) override;
 
     // Auxiliary Client Creation
index a5bcd1cd47a946fad5aa83aaa0d41378b42e30c4..f176823edfd4d8ea0f8383f4a079168fd7016191 100644 (file)
@@ -570,11 +570,16 @@ void PageClientImpl::zoomToRect(FloatRect rect, double minimumScale, double maxi
     [m_contentView _zoomToRect:rect withOrigin:rect.center() fitEntireRect:YES minimumScale:minimumScale maximumScale:maximumScale minimumScrollDistance:0];
 }
 
-void PageClientImpl::scrollViewWillStartPanGesture()
+void PageClientImpl::overflowScrollViewWillStartPanGesture()
 {
     [m_contentView scrollViewWillStartPanOrPinchGesture];
 }
 
+void PageClientImpl::overflowScrollViewDidScroll()
+{
+    [m_contentView _didScroll];
+}
+
 void PageClientImpl::didFinishDrawingPagesToPDF(const IPC::DataReference& pdfData)
 {
     RetainPtr<CFDataRef> data = adoptCF(CFDataCreate(kCFAllocatorDefault, pdfData.data(), pdfData.size()));
index 54aa3089e824100fd8f8da122e6b9cc1289c8b9a..2859039ba7b3e946693b064d1ffbf6b35149da42 100644 (file)
@@ -100,7 +100,7 @@ FloatRect RemoteScrollingCoordinatorProxy::customFixedPositionRect() const
 
 void RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartPanGesture()
 {
-    m_webPageProxy.scrollViewWillStartPanGesture();
+    m_webPageProxy.overflowScrollViewWillStartPanGesture();
 }
 
 } // namespace WebKit
index 6dc513bb4b4fbecd962ae702adbf73d8498c7029..883010b17094b5e1636b6715ddceac49e9d85c86 100644 (file)
@@ -171,6 +171,7 @@ struct WKAutoCorrectionData {
 - (void)_updatePositionInformation;
 - (void)_performAction:(WebKit::SheetAction)action;
 - (void)_willStartScrollingOrZooming;
+- (void)_didScroll;
 - (void)_didEndScrollingOrZooming;
 - (void)_didUpdateBlockSelectionWithTouch:(WebKit::SelectionTouch)touch withFlags:(WebKit::SelectionFlags)flags growThreshold:(CGFloat)growThreshold shrinkThreshold:(CGFloat)shrinkThreshold;
 - (void)_showPlaybackTargetPicker:(BOOL)hasVideo fromRect:(const WebCore::IntRect&)elementRect;
index 8faff1297a19f2e128e431130a9d6d266985f9a3..e731f2b011587a7939691e27b4ed91e38484d115 100644 (file)
@@ -242,9 +242,14 @@ WebCore::FloatRect WebPageProxy::computeCustomFixedPositionRect(const FloatRect&
     return FrameView::rectForViewportConstrainedObjects(enclosingLayoutRect(constrainedUnobscuredRect), roundedLayoutSize(contentsSize), displayedContentScale, false, StickToViewportBounds);
 }
 
-void WebPageProxy::scrollViewWillStartPanGesture()
+void WebPageProxy::overflowScrollViewWillStartPanGesture()
 {
-    m_pageClient.scrollViewWillStartPanGesture();
+    m_pageClient.overflowScrollViewWillStartPanGesture();
+}
+
+void WebPageProxy::overflowScrollViewDidScroll()
+{
+    m_pageClient.overflowScrollViewDidScroll();
 }
 
 void WebPageProxy::dynamicViewportSizeUpdate(const FloatSize& minimumLayoutSize, const WebCore::FloatSize& minimumLayoutSizeForMinimalUI, const WebCore::FloatSize& maximumUnobscuredSize, const FloatRect& targetExposedContentRect, const FloatRect& targetUnobscuredRect, const FloatRect& targetUnobscuredRectInScrollViewCoordinates,  double targetScale, int32_t deviceOrientation)