Title: [168338] trunk/Source
Revision
168338
Author
[email protected]
Date
2014-05-05 18:10:30 -0700 (Mon, 05 May 2014)

Log Message

[iOS WK2] Flickery scrolling inside overflow-scrolling: touch
https://bugs.webkit.org/show_bug.cgi?id=132591
<rdar://problem/16760466>

Reviewed by Tim Horton.

Source/WebCore:

Avoid triggering layer tree commits that touch the layer's boundsOrigin
while the user is scrolling in the UI process.

Fix the WKOverflowScrollViewDelegate to pass along an "inUserInteration"
flag to the ScrollingTree to say that we're in the middle of a user interaction
(and also to send a final non-interactive update). That gets passed along
to the web process, and turned into "SyncScrollingLayerPosition" update.
AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll() consults
this, and uses it to set a flag on the ScrollableArea to say that the scroll
is a user scroll.

RenderLayerBacking then makes use of this (in existing code, shared with WK1)
to avoid triggering layer bounds setting. Instead, it now just calls syncBoundsOrigin(),
which updates the GraphicsLayer without touching platform layers. This is necessary
so that GraphicsLayer geometry is up-to-date (used for tiled layer visibility
computations).

Finally, a hack in GraphicsLayerCA::computeVisibleRect() is conditionalized
for WebKit1 by checking the type of platform layer.

* WebCore.exp.in:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
* page/scrolling/ScrollingTree.h:
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::syncBoundsOrigin):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::computeVisibleRect):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):

Source/WebKit2:

Avoid triggering layer tree commits that touch the layer's boundsOrigin
while the user is scrolling in the UI process.

Fix the WKOverflowScrollViewDelegate to pass along an "inUserInteration"
flag to the ScrollingTree to say that we're in the middle of a user interaction
(and also to send a final non-interactive update). That gets passed along
to the web process, and turned into "SyncScrollingLayerPosition" update.
AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll() consults
this, and uses it to set a flag on the ScrollableArea to say that the scroll
is a user scroll.

RenderLayerBacking then makes use of this (in existing code, shared with WK1)
to avoid triggering layer bounds setting. Instead, it now just calls syncBoundsOrigin(),
which updates the GraphicsLayer without touching platform layers. This is necessary
so that GraphicsLayer geometry is up-to-date (used for tiled layer visibility
computations).

Finally, a hack in GraphicsLayerCA::computeVisibleRect() is conditionalized
for WebKit1 by checking the type of platform layer.

* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::rootScrollingNodeID):
(WebKit::RemoteScrollingCoordinatorProxy::isPointInNonFastScrollableRegion):
(WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
* UIProcess/Scrolling/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
(-[WKOverflowScrollViewDelegate scrollViewDidScroll:]):
(-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]):
(-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]):
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll):
* WebProcess/Scrolling/RemoteScrollingCoordinator.h:
* WebProcess/Scrolling/RemoteScrollingCoordinator.messages.in:
* WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
(WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (168337 => 168338)


--- trunk/Source/WebCore/ChangeLog	2014-05-06 01:10:06 UTC (rev 168337)
+++ trunk/Source/WebCore/ChangeLog	2014-05-06 01:10:30 UTC (rev 168338)
@@ -1,3 +1,44 @@
+2014-05-05  Simon Fraser  <[email protected]>
+
+        [iOS WK2] Flickery scrolling inside overflow-scrolling: touch
+        https://bugs.webkit.org/show_bug.cgi?id=132591
+        <rdar://problem/16760466>
+
+        Reviewed by Tim Horton.
+
+        Avoid triggering layer tree commits that touch the layer's boundsOrigin
+        while the user is scrolling in the UI process.
+        
+        Fix the WKOverflowScrollViewDelegate to pass along an "inUserInteration"
+        flag to the ScrollingTree to say that we're in the middle of a user interaction
+        (and also to send a final non-interactive update). That gets passed along
+        to the web process, and turned into "SyncScrollingLayerPosition" update.
+        AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll() consults
+        this, and uses it to set a flag on the ScrollableArea to say that the scroll
+        is a user scroll.
+        
+        RenderLayerBacking then makes use of this (in existing code, shared with WK1)
+        to avoid triggering layer bounds setting. Instead, it now just calls syncBoundsOrigin(),
+        which updates the GraphicsLayer without touching platform layers. This is necessary
+        so that GraphicsLayer geometry is up-to-date (used for tiled layer visibility
+        computations).
+        
+        Finally, a hack in GraphicsLayerCA::computeVisibleRect() is conditionalized
+        for WebKit1 by checking the type of platform layer.
+
+        * WebCore.exp.in:
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
+        * page/scrolling/ScrollingTree.cpp:
+        (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
+        * page/scrolling/ScrollingTree.h:
+        * platform/graphics/GraphicsLayer.h:
+        (WebCore::GraphicsLayer::syncBoundsOrigin):
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::computeVisibleRect):
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
+
 2014-05-05  Alexey Proskuryakov  <[email protected]>
 
         Stop using BlobData on client side

Modified: trunk/Source/WebCore/WebCore.exp.in (168337 => 168338)


--- trunk/Source/WebCore/WebCore.exp.in	2014-05-06 01:10:06 UTC (rev 168337)
+++ trunk/Source/WebCore/WebCore.exp.in	2014-05-06 01:10:30 UTC (rev 168338)
@@ -2760,7 +2760,7 @@
 __ZN7WebCore13ScrollingTree35shouldHandleWheelEventSynchronouslyERKNS_18PlatformWheelEventE
 __ZN7WebCore13ScrollingTree36viewportChangedViaDelegatedScrollingEyRKNS_9FloatRectEd
 __ZN7WebCore13ScrollingTree37setScrollingPerformanceLoggingEnabledEb
-__ZN7WebCore13ScrollingTree42scrollPositionChangedViaDelegatedScrollingEyRKNS_10FloatPointE
+__ZN7WebCore13ScrollingTree42scrollPositionChangedViaDelegatedScrollingEyRKNS_10FloatPointEb
 __ZN7WebCore13ScrollingTreeC2Ev
 __ZN7WebCore13ScrollingTreeD1Ev
 __ZN7WebCore13ScrollingTreeD2Ev

Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (168337 => 168338)


--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2014-05-06 01:10:06 UTC (rev 168337)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2014-05-06 01:10:30 UTC (rev 168338)
@@ -254,8 +254,11 @@
     }
 
     // Overflow-scroll area.
-    if (ScrollableArea* scrollableArea = frameView->scrollableAreaForScrollLayerID(scrollingNodeID))
+    if (ScrollableArea* scrollableArea = frameView->scrollableAreaForScrollLayerID(scrollingNodeID)) {
+        scrollableArea->setIsUserScroll(scrollingLayerPositionAction == SyncScrollingLayerPosition);
         scrollableArea->scrollToOffsetWithoutAnimation(scrollPosition);
+        scrollableArea->setIsUserScroll(false);
+    }
 }
 
 void AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange(ScrollableArea* scrollableArea, ScrollbarOrientation orientation)

Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp (168337 => 168338)


--- trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp	2014-05-06 01:10:06 UTC (rev 168337)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp	2014-05-06 01:10:30 UTC (rev 168338)
@@ -110,7 +110,7 @@
     toScrollingTreeScrollingNode(node)->updateLayersAfterViewportChange(viewportRect, scale);
 }
 
-void ScrollingTree::scrollPositionChangedViaDelegatedScrolling(ScrollingNodeID nodeID, const WebCore::FloatPoint& scrollPosition)
+void ScrollingTree::scrollPositionChangedViaDelegatedScrolling(ScrollingNodeID nodeID, const WebCore::FloatPoint& scrollPosition, bool inUserInteration)
 {
     ScrollingTreeNode* node = nodeForID(nodeID);
     if (!node)
@@ -123,7 +123,7 @@
     toScrollingTreeScrollingNode(node)->updateLayersAfterDelegatedScroll(scrollPosition);
 
     // Update GraphicsLayers and scroll state.
-    scrollingTreeNodeDidScroll(nodeID, scrollPosition);
+    scrollingTreeNodeDidScroll(nodeID, scrollPosition, inUserInteration ? SyncScrollingLayerPosition : SetScrollingLayerPosition);
 }
 
 void ScrollingTree::commitNewTreeState(PassOwnPtr<ScrollingStateTree> scrollingStateTree)

Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.h (168337 => 168338)


--- trunk/Source/WebCore/page/scrolling/ScrollingTree.h	2014-05-06 01:10:06 UTC (rev 168337)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.h	2014-05-06 01:10:30 UTC (rev 168338)
@@ -84,7 +84,7 @@
 
     // Delegated scrolling has scrolled a node. Update layer positions on descendant tree nodes,
     // and call scrollingTreeNodeDidScroll().
-    virtual void scrollPositionChangedViaDelegatedScrolling(ScrollingNodeID, const WebCore::FloatPoint& scrollPosition);
+    virtual void scrollPositionChangedViaDelegatedScrolling(ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, bool inUserInteration);
 
     FloatPoint mainFrameScrollPosition();
 

Modified: trunk/Source/WebCore/platform/ScrollableArea.h (168337 => 168338)


--- trunk/Source/WebCore/platform/ScrollableArea.h	2014-05-06 01:10:06 UTC (rev 168337)
+++ trunk/Source/WebCore/platform/ScrollableArea.h	2014-05-06 01:10:30 UTC (rev 168338)
@@ -68,8 +68,8 @@
     virtual void didStartScroll() { }
     virtual void didEndScroll() { }
     virtual void didUpdateScroll() { }
+#endif
     virtual void setIsUserScroll(bool) { }
-#endif
 
     // Functions for controlling if you can scroll past the end of the document.
     bool constrainsScrollingToContentEdge() const { return m_constrainsScrollingToContentEdge; }

Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.h (168337 => 168338)


--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.h	2014-05-06 01:10:06 UTC (rev 168337)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.h	2014-05-06 01:10:30 UTC (rev 168338)
@@ -289,7 +289,7 @@
 
     // For platforms that move underlying platform layers on a different thread for scrolling; just update the GraphicsLayer state.
     virtual void syncPosition(const FloatPoint& p) { m_position = p; }
-    
+
     // Anchor point: (0, 0) is top left, (1, 1) is bottom right. The anchor point
     // affects the origin of the transforms.
     const FloatPoint3D& anchorPoint() const { return m_anchorPoint; }
@@ -303,6 +303,9 @@
     const FloatPoint& boundsOrigin() const { return m_boundsOrigin; }
     virtual void setBoundsOrigin(const FloatPoint& origin) { m_boundsOrigin = origin; }
 
+    // For platforms that move underlying platform layers on a different thread for scrolling; just update the GraphicsLayer state.
+    virtual void syncBoundsOrigin(const FloatPoint& origin) { m_boundsOrigin = origin; }
+
     const TransformationMatrix& transform() const { return m_transform; }
     virtual void setTransform(const TransformationMatrix& t) { m_transform = t; }
 

Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (168337 => 168338)


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2014-05-06 01:10:06 UTC (rev 168337)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2014-05-06 01:10:30 UTC (rev 168338)
@@ -1147,8 +1147,9 @@
     FloatRect clipRectForChildren = state.mappedQuad(&mapWasClamped).boundingBox();
     FloatPoint boundsOrigin = m_boundsOrigin;
 #if PLATFORM(IOS)
-    // UIKit may be changing layer bounds behind our back in overflow-scroll layers, so use the layer's origin.
-    boundsOrigin = m_layer->bounds().location();
+    // In WK1, UIKit may be changing layer bounds behind our back in overflow-scroll layers, so use the layer's origin.
+    if (m_layer->isPlatformCALayerMac())
+        boundsOrigin = m_layer->bounds().location();
 #endif
     clipRectForChildren.move(boundsOrigin.x(), boundsOrigin.y());
     

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (168337 => 168338)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2014-05-06 01:10:06 UTC (rev 168337)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2014-05-06 01:10:30 UTC (rev 168338)
@@ -924,8 +924,8 @@
         bool paddingBoxOffsetChanged = oldScrollingLayerOffset != m_scrollingLayer->offsetFromRenderer();
 
         if (m_owningLayer.isInUserScroll()) {
-            // If scrolling is happening externally, we don't want to touch the layer bounds origin here because that will cause
-            // jitter. Set a flag to ensure that we sync up later.
+            // If scrolling is happening externally, we don't want to touch the layer bounds origin here because that will cause jitter.
+            m_scrollingLayer->syncBoundsOrigin(FloatPoint(scrollOffset.width(), scrollOffset.height()));
             m_owningLayer.setRequiresScrollBoundsOriginUpdate(true);
         } else {
             // Note that we implement the contents offset via the bounds origin on this layer, rather than a position on the sublayer.

Modified: trunk/Source/WebKit2/ChangeLog (168337 => 168338)


--- trunk/Source/WebKit2/ChangeLog	2014-05-06 01:10:06 UTC (rev 168337)
+++ trunk/Source/WebKit2/ChangeLog	2014-05-06 01:10:30 UTC (rev 168338)
@@ -1,3 +1,50 @@
+2014-05-05  Simon Fraser  <[email protected]>
+
+        [iOS WK2] Flickery scrolling inside overflow-scrolling: touch
+        https://bugs.webkit.org/show_bug.cgi?id=132591
+        <rdar://problem/16760466>
+
+        Reviewed by Tim Horton.
+        
+        Avoid triggering layer tree commits that touch the layer's boundsOrigin
+        while the user is scrolling in the UI process.
+        
+        Fix the WKOverflowScrollViewDelegate to pass along an "inUserInteration"
+        flag to the ScrollingTree to say that we're in the middle of a user interaction
+        (and also to send a final non-interactive update). That gets passed along
+        to the web process, and turned into "SyncScrollingLayerPosition" update.
+        AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll() consults
+        this, and uses it to set a flag on the ScrollableArea to say that the scroll
+        is a user scroll.
+        
+        RenderLayerBacking then makes use of this (in existing code, shared with WK1)
+        to avoid triggering layer bounds setting. Instead, it now just calls syncBoundsOrigin(),
+        which updates the GraphicsLayer without touching platform layers. This is necessary
+        so that GraphicsLayer geometry is up-to-date (used for tiled layer visibility
+        computations).
+        
+        Finally, a hack in GraphicsLayerCA::computeVisibleRect() is conditionalized
+        for WebKit1 by checking the type of platform layer.
+
+        * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
+        (WebKit::RemoteScrollingCoordinatorProxy::rootScrollingNodeID):
+        (WebKit::RemoteScrollingCoordinatorProxy::isPointInNonFastScrollableRegion):
+        (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
+        (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
+        * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
+        * UIProcess/Scrolling/RemoteScrollingTree.cpp:
+        (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
+        * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
+        * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
+        (-[WKOverflowScrollViewDelegate scrollViewDidScroll:]):
+        (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]):
+        (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]):
+        (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll):
+        * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
+        * WebProcess/Scrolling/RemoteScrollingCoordinator.messages.in:
+        * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
+        (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
+
 2014-05-05  Alexey Proskuryakov  <[email protected]>
 
         Stop using BlobData on client side

Modified: trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp (168337 => 168338)


--- trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp	2014-05-06 01:10:06 UTC (rev 168337)
+++ trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp	2014-05-06 01:10:30 UTC (rev 168338)
@@ -56,7 +56,7 @@
 {
 }
 
-WebCore::ScrollingNodeID RemoteScrollingCoordinatorProxy::rootScrollingNodeID() const
+ScrollingNodeID RemoteScrollingCoordinatorProxy::rootScrollingNodeID() const
 {
     if (!m_scrollingTree->rootNode())
         return 0;
@@ -139,25 +139,25 @@
     return result == ScrollingTree::DidHandleEvent; // FIXME: handle other values.
 }
 
-bool RemoteScrollingCoordinatorProxy::isPointInNonFastScrollableRegion(const WebCore::IntPoint& p) const
+bool RemoteScrollingCoordinatorProxy::isPointInNonFastScrollableRegion(const IntPoint& p) const
 {
     return m_scrollingTree->isPointInNonFastScrollableRegion(p);
 }
 
-void RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling(ScrollingNodeID nodeID, const WebCore::FloatRect& viewportRect, double scale)
+void RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling(ScrollingNodeID nodeID, const FloatRect& viewportRect, double scale)
 {
     m_scrollingTree->viewportChangedViaDelegatedScrolling(nodeID, viewportRect, scale);
 }
 
 // This comes from the scrolling tree.
-void RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll(WebCore::ScrollingNodeID scrolledNodeID, const WebCore::FloatPoint& newScrollPosition)
+void RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll(ScrollingNodeID scrolledNodeID, const FloatPoint& newScrollPosition, SetOrSyncScrollingLayerPosition scrollingLayerPositionAction)
 {
     // Scroll updates for the main frame are sent via WebPageProxy::updateVisibleContentRects()
     // so don't send them here.
     if (!m_propagatesMainFrameScrolls && scrolledNodeID == rootScrollingNodeID())
         return;
 
-    m_webPageProxy.send(Messages::RemoteScrollingCoordinator::ScrollPositionChangedForNode(scrolledNodeID, newScrollPosition));
+    m_webPageProxy.send(Messages::RemoteScrollingCoordinator::ScrollPositionChangedForNode(scrolledNodeID, newScrollPosition, scrollingLayerPositionAction));
 }
 
 void RemoteScrollingCoordinatorProxy::scrollingTreeNodeRequestsScroll(ScrollingNodeID scrolledNodeID, const FloatPoint& scrollPosition, bool representsProgrammaticScroll)

Modified: trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h (168337 => 168338)


--- trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h	2014-05-06 01:10:06 UTC (rev 168337)
+++ trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h	2014-05-06 01:10:30 UTC (rev 168338)
@@ -52,7 +52,7 @@
     virtual ~RemoteScrollingCoordinatorProxy();
     
     // Inform the web process that the scroll position changed (called from the scrolling tree)
-    void scrollingTreeNodeDidScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& newScrollPosition);
+    void scrollingTreeNodeDidScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& newScrollPosition, WebCore::SetOrSyncScrollingLayerPosition);
     void scrollingTreeNodeRequestsScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, bool representsProgrammaticScroll);
 
     bool isPointInNonFastScrollableRegion(const WebCore::IntPoint&) const;

Modified: trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.cpp (168337 => 168338)


--- trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.cpp	2014-05-06 01:10:06 UTC (rev 168337)
+++ trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.cpp	2014-05-06 01:10:30 UTC (rev 168338)
@@ -77,9 +77,9 @@
 }
 #endif
 
-void RemoteScrollingTree::scrollingTreeNodeDidScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, SetOrSyncScrollingLayerPosition)
+void RemoteScrollingTree::scrollingTreeNodeDidScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, SetOrSyncScrollingLayerPosition scrollingLayerPositionAction)
 {
-    m_scrollingCoordinatorProxy.scrollingTreeNodeDidScroll(nodeID, scrollPosition);
+    m_scrollingCoordinatorProxy.scrollingTreeNodeDidScroll(nodeID, scrollPosition, scrollingLayerPositionAction);
 }
 
 void RemoteScrollingTree::scrollingTreeNodeRequestsScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, bool representsProgrammaticScroll)

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


--- trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h	2014-05-06 01:10:06 UTC (rev 168337)
+++ trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h	2014-05-06 01:10:30 UTC (rev 168338)
@@ -41,7 +41,7 @@
     static PassOwnPtr<ScrollingTreeOverflowScrollingNodeIOS> create(WebCore::ScrollingTree&, WebCore::ScrollingNodeID);
     virtual ~ScrollingTreeOverflowScrollingNodeIOS();
 
-    void scrollViewDidScroll(const WebCore::FloatPoint&);
+    void scrollViewDidScroll(const WebCore::FloatPoint&, bool inUserInteration);
 
 private:
     ScrollingTreeOverflowScrollingNodeIOS(WebCore::ScrollingTree&, WebCore::ScrollingNodeID);

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


--- trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm	2014-05-06 01:10:06 UTC (rev 168337)
+++ trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm	2014-05-06 01:10:30 UTC (rev 168338)
@@ -58,7 +58,7 @@
 
 - (void)scrollViewDidScroll:(UIScrollView *)scrollView
 {
-    _scrollingTreeNode->scrollViewDidScroll(scrollView.contentOffset);
+    _scrollingTreeNode->scrollViewDidScroll(scrollView.contentOffset, _inUserInteraction);
 }
 
 - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
@@ -68,13 +68,18 @@
 
 - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)willDecelerate
 {
-    if (!willDecelerate)
+    if (_inUserInteraction && !willDecelerate) {
         _inUserInteraction = NO;
+        _scrollingTreeNode->scrollViewDidScroll(scrollView.contentOffset, _inUserInteraction);
+    }
 }
 
 - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
 {
-    _inUserInteraction = NO;
+    if (_inUserInteraction) {
+        _inUserInteraction = NO;
+        _scrollingTreeNode->scrollViewDidScroll(scrollView.contentOffset, _inUserInteraction);
+    }
 }
 
 @end
@@ -145,9 +150,9 @@
     }
 }
 
-void ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll(const FloatPoint& scrollPosition)
+void ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll(const FloatPoint& scrollPosition, bool inUserInteration)
 {
-    scrollingTree().scrollPositionChangedViaDelegatedScrolling(scrollingNodeID(), scrollPosition);
+    scrollingTree().scrollPositionChangedViaDelegatedScrolling(scrollingNodeID(), scrollPosition, inUserInteration);
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.h (168337 => 168338)


--- trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.h	2014-05-06 01:10:06 UTC (rev 168337)
+++ trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.h	2014-05-06 01:10:30 UTC (rev 168338)
@@ -71,7 +71,7 @@
     virtual void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&) override;
     
     // Respond to UI process changes.
-    void scrollPositionChangedForNode(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition);
+    void scrollPositionChangedForNode(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, bool syncLayerPosition);
 
     WebPage* m_webPage;
 };

Modified: trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.messages.in (168337 => 168338)


--- trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.messages.in	2014-05-06 01:10:06 UTC (rev 168337)
+++ trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.messages.in	2014-05-06 01:10:30 UTC (rev 168338)
@@ -23,7 +23,7 @@
 #if ENABLE(ASYNC_SCROLLING)
 
 messages -> RemoteScrollingCoordinator {
-    ScrollPositionChangedForNode(uint64_t nodeID, WebCore::FloatPoint scrollPosition);
+    ScrollPositionChangedForNode(uint64_t nodeID, WebCore::FloatPoint scrollPosition, bool syncLayerPosition);
 }
 
 #endif // ENABLE(ASYNC_SCROLLING)

Modified: trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.mm (168337 => 168338)


--- trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.mm	2014-05-06 01:10:06 UTC (rev 168337)
+++ trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.mm	2014-05-06 01:10:30 UTC (rev 168338)
@@ -91,9 +91,9 @@
 }
 
 // Notification from the UI process that we scrolled.
-void RemoteScrollingCoordinator::scrollPositionChangedForNode(ScrollingNodeID nodeID, const FloatPoint& scrollPosition)
+void RemoteScrollingCoordinator::scrollPositionChangedForNode(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, bool syncLayerPosition)
 {
-    scheduleUpdateScrollPositionAfterAsyncScroll(nodeID, scrollPosition, false /* FIXME */, SyncScrollingLayerPosition);
+    scheduleUpdateScrollPositionAfterAsyncScroll(nodeID, scrollPosition, false /* FIXME */, syncLayerPosition ? SyncScrollingLayerPosition : SetScrollingLayerPosition);
 }
 
 } // namespace WebKit
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to