Always update the scroll position through the scrolling coordinator
https://bugs.webkit.org/show_bug.cgi?id=78403

Reviewed by Sam Weinig.

To get correct behavior, we always want to update the scrolling layer position
on the scrolling thread. Do this by allowing the scrolling coordinator to intercept
scroll position update requests and send them to the scrolling tree.

* page/FrameView.cpp:
(WebCore::FrameView::requestScrollPositionUpdate):
Let the scrolling coordinator have a go at updating the scroll position for this frame view.

* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::requestScrollPositionUpdate):
If it's a frame view we're coordinating scrolling for, tell the scrolling tree to update
the scroll position.

* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::setMainFrameScrollPosition):
Call through to the scrolling tree node.

* page/scrolling/ScrollingTreeNode.h:
Add a new pure virtual setScrollPosition member function.

(WebCore::ScrollingTreeNodeMac::setScrollPosition):
Move most of the code from scrollBy here.

(WebCore::ScrollingTreeNodeMac::setScrollLayerPosition):
Rename this member function from setScrollPosition to avoid conflicts.

(WebCore::ScrollingTreeNodeMac::scrollBy):
Just call setScsrollPosition.

* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::setScrollOffsetFromAnimation):
Call requestScrollPositionUpdate, which allows subclasses of scrollable area to intercept
the scroll operation and call it asynchronously.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107467 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/platform/ScrollableArea.h b/Source/WebCore/platform/ScrollableArea.h
index 4242822..94da5da 100644
--- a/Source/WebCore/platform/ScrollableArea.h
+++ b/Source/WebCore/platform/ScrollableArea.h
@@ -52,6 +52,11 @@
     // is updated on the scrolling thread and we need to notify the main thread.
     void notifyScrollPositionChanged(const IntPoint&);
 
+    // Allows subclasses to handle scroll position updates themselves. If this member function
+    // returns true, the scrollable area won't actually update the scroll position and instead
+    // expect it to happen sometime in the future.
+    virtual bool requestScrollPositionUpdate(const IntPoint&) { return false; }
+
     virtual void zoomAnimatorTransformChanged(float, float, float, ZoomAnimationState);
 
     bool handleWheelEvent(const PlatformWheelEvent&);