Split scrolling tree ScrollingNodes into FrameScrollingNodes and OverflowScrollingNodes
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 May 2014 20:23:10 +0000 (20:23 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 May 2014 20:23:10 +0000 (20:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=133022

Reviewed by Sam Weinig.

Source/WebCore:

In both the scrolling state tree and the scrolling tree, split the "scrolling nodes"
into FrameScrolling and OverflowScrolling nodes.

Move what was the "viewportSize" property onto the base class for the scrolling
nodes, calling it "scrollableAreaSize".

Make minimum/maximumScrollPosition() virtual so we can share more code (and there
is more code sharing to be done in future).

* Configurations/WebCore.xcconfig: Remove ScrollingStateScrollingNodeMac.mm and ScrollingTreeScrollingNodeMac.mm
from the list, using #ifdefs in the file instead.
* WebCore.exp.in: Lots of exports.
* WebCore.xcodeproj/project.pbxproj: New files.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
(WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
(WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode):
(WebCore::AsyncScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView):
(WebCore::AsyncScrollingCoordinator::updateScrollingNode): Deleted.
(WebCore::AsyncScrollingCoordinator::setScrollbarPaintersFromScrollbarsForNode): Deleted.
This tiny function didn't need to exist.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::updateFrameScrollingNode):
(WebCore::ScrollingCoordinator::updateOverflowScrollingNode):
(WebCore::ScrollingCoordinator::updateScrollingNode): Deleted.
* page/scrolling/ScrollingStateFrameScrollingNode.cpp: Copied from Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp.
(WebCore::ScrollingStateFrameScrollingNode::create):
(WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
(WebCore::ScrollingStateFrameScrollingNode::~ScrollingStateFrameScrollingNode):
(WebCore::ScrollingStateFrameScrollingNode::clone):
(WebCore::ScrollingStateFrameScrollingNode::setFrameScaleFactor):
(WebCore::ScrollingStateFrameScrollingNode::setNonFastScrollableRegion):
(WebCore::ScrollingStateFrameScrollingNode::setWheelEventHandlerCount):
(WebCore::ScrollingStateFrameScrollingNode::setSynchronousScrollingReasons):
(WebCore::ScrollingStateFrameScrollingNode::setScrollBehaviorForFixedElements):
(WebCore::ScrollingStateFrameScrollingNode::setHeaderHeight):
(WebCore::ScrollingStateFrameScrollingNode::setFooterHeight):
(WebCore::ScrollingStateFrameScrollingNode::setTopContentInset):
(WebCore::ScrollingStateFrameScrollingNode::setCounterScrollingLayer):
(WebCore::ScrollingStateFrameScrollingNode::setInsetClipLayer):
(WebCore::ScrollingStateFrameScrollingNode::setContentShadowLayer):
(WebCore::ScrollingStateFrameScrollingNode::setHeaderLayer):
(WebCore::ScrollingStateFrameScrollingNode::setFooterLayer):
(WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars):
(WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
* page/scrolling/ScrollingStateFrameScrollingNode.h: Copied from Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h.
* page/scrolling/ScrollingStateNode.h:
(WebCore::LayerRepresentation::layerID):
(WebCore::ScrollingStateNode::isFrameScrollingNode):
(WebCore::ScrollingStateNode::isOverflowScrollingNode):
* page/scrolling/ScrollingStateOverflowScrollingNode.cpp: Added.
(WebCore::ScrollingStateOverflowScrollingNode::create):
(WebCore::ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode):
(WebCore::ScrollingStateOverflowScrollingNode::~ScrollingStateOverflowScrollingNode):
(WebCore::ScrollingStateOverflowScrollingNode::clone):
(WebCore::ScrollingStateOverflowScrollingNode::setScrolledContentsLayer):
(WebCore::ScrollingStateOverflowScrollingNode::dumpProperties):
* page/scrolling/ScrollingStateOverflowScrollingNode.h: Copied from Source/WebCore/page/scrolling/mac/ScrollingStateScrollingNodeMac.mm.
(WebCore::ScrollingStateOverflowScrollingNode::scrolledContentsLayer):
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
(WebCore::ScrollingStateScrollingNode::setScrollableAreaSize):
(WebCore::ScrollingStateScrollingNode::setTotalContentsSize):
(WebCore::ScrollingStateScrollingNode::dumpProperties):
(WebCore::ScrollingStateScrollingNode::create): Deleted.
(WebCore::ScrollingStateScrollingNode::clone): Deleted.
(WebCore::ScrollingStateScrollingNode::setViewportSize): Deleted.
(WebCore::ScrollingStateScrollingNode::setFrameScaleFactor): Deleted.
(WebCore::ScrollingStateScrollingNode::setNonFastScrollableRegion): Deleted.
(WebCore::ScrollingStateScrollingNode::setWheelEventHandlerCount): Deleted.
(WebCore::ScrollingStateScrollingNode::setSynchronousScrollingReasons): Deleted.
(WebCore::ScrollingStateScrollingNode::setScrollBehaviorForFixedElements): Deleted.
(WebCore::ScrollingStateScrollingNode::setHeaderHeight): Deleted.
(WebCore::ScrollingStateScrollingNode::setFooterHeight): Deleted.
(WebCore::ScrollingStateScrollingNode::setTopContentInset): Deleted.
(WebCore::ScrollingStateScrollingNode::setScrolledContentsLayer): Deleted.
(WebCore::ScrollingStateScrollingNode::setCounterScrollingLayer): Deleted.
(WebCore::ScrollingStateScrollingNode::setInsetClipLayer): Deleted.
(WebCore::ScrollingStateScrollingNode::setContentShadowLayer): Deleted.
(WebCore::ScrollingStateScrollingNode::setHeaderLayer): Deleted.
(WebCore::ScrollingStateScrollingNode::setFooterLayer): Deleted.
(WebCore::ScrollingStateScrollingNode::setScrollbarPaintersFromScrollbars): Deleted.
* page/scrolling/ScrollingStateScrollingNode.h:
(WebCore::ScrollingStateScrollingNode::scrollableAreaSize):
(WebCore::ScrollingStateScrollingNode::totalContentsSize):
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::attachNode):
(WebCore::ScrollingStateTree::commit):
* page/scrolling/ScrollingStateTree.h:
(WebCore::ScrollingStateTree::rootStateNode):
(WebCore::ScrollingStateTree::setRootStateNode):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitNewTreeState):
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp: Added.
(WebCore::ScrollingTreeFrameScrollingNode::ScrollingTreeFrameScrollingNode):
(WebCore::ScrollingTreeFrameScrollingNode::~ScrollingTreeFrameScrollingNode):
(WebCore::ScrollingTreeFrameScrollingNode::updateBeforeChildren):
* page/scrolling/ScrollingTreeFrameScrollingNode.h: Copied from Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h.
(WebCore::ScrollingTreeFrameScrollingNode::updateLayersAfterDelegatedScroll):
(WebCore::ScrollingTreeFrameScrollingNode::synchronousScrollingReasons):
(WebCore::ScrollingTreeFrameScrollingNode::shouldUpdateScrollLayerPositionSynchronously):
(WebCore::ScrollingTreeFrameScrollingNode::frameScaleFactor):
(WebCore::ScrollingTreeFrameScrollingNode::headerHeight):
(WebCore::ScrollingTreeFrameScrollingNode::footerHeight):
(WebCore::ScrollingTreeFrameScrollingNode::topContentInset):
(WebCore::ScrollingTreeFrameScrollingNode::scrollBehaviorForFixedElements):
* page/scrolling/ScrollingTreeNode.h:
(WebCore::ScrollingTreeNode::isFrameScrollingNode):
(WebCore::ScrollingTreeNode::isOverflowScrollingNode):
* page/scrolling/ScrollingTreeOverflowScrollingNode.cpp: Copied from Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h.
(WebCore::ScrollingTreeOverflowScrollingNode::ScrollingTreeOverflowScrollingNode):
(WebCore::ScrollingTreeOverflowScrollingNode::~ScrollingTreeOverflowScrollingNode):
* page/scrolling/ScrollingTreeOverflowScrollingNode.h: Copied from Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h.
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::ScrollingTreeScrollingNode):
(WebCore::ScrollingTreeScrollingNode::updateBeforeChildren):
(WebCore::ScrollingTreeScrollingNode::updateAfterChildren):
(WebCore::ScrollingTreeScrollingNode::setScrollPosition):
(WebCore::ScrollingTreeScrollingNode::setScrollPositionWithoutContentEdgeConstraints):
(WebCore::ScrollingTreeScrollingNode::minimumScrollPosition):
(WebCore::ScrollingTreeScrollingNode::maximumScrollPosition):
* page/scrolling/ScrollingTreeScrollingNode.h:
(WebCore::ScrollingTreeScrollingNode::scrollableAreaSize):
(WebCore::ScrollingTreeScrollingNode::totalContentsSize):
(WebCore::ScrollingTreeScrollingNode::totalContentsSizeForRubberBand):
(WebCore::ScrollingTreeScrollingNode::setTotalContentsSizeForRubberBand):
(WebCore::ScrollingTreeScrollingNode::synchronousScrollingReasons): Deleted.
(WebCore::ScrollingTreeScrollingNode::shouldUpdateScrollLayerPositionSynchronously): Deleted.
(WebCore::ScrollingTreeScrollingNode::viewportSize): Deleted.
(WebCore::ScrollingTreeScrollingNode::frameScaleFactor): Deleted.
(WebCore::ScrollingTreeScrollingNode::headerHeight): Deleted.
(WebCore::ScrollingTreeScrollingNode::footerHeight): Deleted.
(WebCore::ScrollingTreeScrollingNode::scrollBehaviorForFixedElements): Deleted.
(WebCore::ScrollingTreeScrollingNode::topContentInset): Deleted.
* page/scrolling/ios/ScrollingCoordinatorIOS.mm:
(WebCore::ScrollingCoordinatorIOS::createScrollingTreeNode):
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h: Renamed from Source/WebCore/page/scrolling/ios/ScrollingTreeScrollingNodeIOS.h.
(WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollLayer):
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: Renamed from Source/WebCore/page/scrolling/ios/ScrollingTreeScrollingNodeIOS.mm.
(WebCore::ScrollingTreeFrameScrollingNodeIOS::create):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::ScrollingTreeFrameScrollingNodeIOS):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::~ScrollingTreeFrameScrollingNodeIOS):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::updateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::updateAfterChildren):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollPosition):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPosition):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollLayerPosition):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterViewportChange):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterDelegatedScroll):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::updateChildNodesAfterScroll):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::minimumScrollPosition):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::maximumScrollPosition):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollBy):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollByWithoutContentEdgeConstraints):
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::createScrollingTreeNode):
* page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingStateScrollingNodeMac.mm.
(WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.h.
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm.
(WebCore::ScrollingTreeFrameScrollingNodeMac::create):
(WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
(WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac):
(WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::updateAfterChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
(WebCore::ScrollingTreeFrameScrollingNodeMac::allowsHorizontalStretching):
(WebCore::ScrollingTreeFrameScrollingNodeMac::allowsVerticalStretching):
(WebCore::ScrollingTreeFrameScrollingNodeMac::stretchAmount):
(WebCore::ScrollingTreeFrameScrollingNodeMac::pinnedInDirection):
(WebCore::ScrollingTreeFrameScrollingNodeMac::canScrollHorizontally):
(WebCore::ScrollingTreeFrameScrollingNodeMac::canScrollVertically):
(WebCore::ScrollingTreeFrameScrollingNodeMac::shouldRubberBandInDirection):
(WebCore::ScrollingTreeFrameScrollingNodeMac::absoluteScrollPosition):
(WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollBy):
(WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollByWithoutContentEdgeConstraints):
(WebCore::ScrollingTreeFrameScrollingNodeMac::startSnapRubberbandTimer):
(WebCore::ScrollingTreeFrameScrollingNodeMac::stopSnapRubberbandTimer):
(WebCore::ScrollingTreeFrameScrollingNodeMac::adjustScrollPositionToBoundsIfNecessary):
(WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition):
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
(WebCore::ScrollingTreeFrameScrollingNodeMac::updateLayersAfterViewportChange):
(WebCore::ScrollingTreeFrameScrollingNodeMac::minimumScrollPosition):
(WebCore::ScrollingTreeFrameScrollingNodeMac::maximumScrollPosition):
(WebCore::ScrollingTreeFrameScrollingNodeMac::scrollBy):
(WebCore::ScrollingTreeFrameScrollingNodeMac::scrollByWithoutContentEdgeConstraints):
(WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState):
(WebCore::ScrollingTreeFrameScrollingNodeMac::logExposedUnfilledArea):
(WebCore::logThreadedScrollingMode):
(WebCore::logWheelEventHandlerCountChanged):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):

Source/WebKit2:

In both the scrolling state tree and the scrolling tree, split the "scrolling nodes"
into FrameScrolling and OverflowScrolling nodes.

Move what was the "viewportSize" property onto the base class for the scrolling
nodes, calling it "scrollableAreaSize".

Make minimum/maximumScrollPosition() virtual so we can share more code (and there
is more code sharing to be done in future).

* Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateScrollingNode>::encode):
(ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
(ArgumentCoder<ScrollingStateOverflowScrollingNode>::encode):
(ArgumentCoder<ScrollingStateScrollingNode>::decode):
(ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
(ArgumentCoder<ScrollingStateOverflowScrollingNode>::decode):
(WebKit::encodeNodeAndDescendants):
(WebKit::RemoteScrollingCoordinatorTransaction::decode):
(WebKit::RemoteScrollingTreeTextStream::dump):
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
* UIProcess/Scrolling/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::createNode):
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollLayer):
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterViewportChange):
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::ScrollingTreeOverflowScrollingNodeIOS):
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateBeforeChildren):
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren):
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition):
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll):
* UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):

LayoutTests:

Updated for new node name. No geometry changes.

* platform/mac-wk2/tiled-drawing/clamp-out-of-bounds-scrolls-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed/absolute-inside-fixed-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed/absolute-inside-out-of-view-fixed-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed/fixed-in-overflow-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed/fixed-position-out-of-view-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed/fixed-position-out-of-view-negative-zindex-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed/four-bars-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed/four-bars-with-header-and-footer-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed/negative-scroll-offset-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed/negative-scroll-offset-in-view-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed/nested-fixed-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed/percentage-inside-fixed-expected.txt:
* platform/mac-wk2/tiled-drawing/scrolling-tree-after-scroll-expected.txt:
* platform/mac-wk2/tiled-drawing/scrolling-tree-slow-scrolling-expected.txt:
* platform/mac-wk2/tiled-drawing/sticky/negative-scroll-offset-expected.txt:
* platform/mac-wk2/tiled-drawing/sticky/sticky-horizontal-expected.txt:

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

57 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/tiled-drawing/clamp-out-of-bounds-scrolls-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fixed/absolute-inside-fixed-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fixed/absolute-inside-out-of-view-fixed-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fixed/fixed-in-overflow-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fixed/fixed-position-out-of-view-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fixed/fixed-position-out-of-view-negative-zindex-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fixed/four-bars-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fixed/four-bars-with-header-and-footer-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fixed/negative-scroll-offset-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fixed/negative-scroll-offset-in-view-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fixed/nested-fixed-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/fixed/percentage-inside-fixed-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/scrolling-tree-after-scroll-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/scrolling-tree-slow-scrolling-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/sticky/negative-scroll-offset-expected.txt
LayoutTests/platform/mac-wk2/tiled-drawing/sticky/sticky-horizontal-expected.txt
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Configurations/WebCore.xcconfig
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h
Source/WebCore/page/scrolling/ScrollingCoordinator.h
Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp [new file with mode: 0644]
Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h [new file with mode: 0644]
Source/WebCore/page/scrolling/ScrollingStateNode.h
Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.cpp [new file with mode: 0644]
Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.h [new file with mode: 0644]
Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp
Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h
Source/WebCore/page/scrolling/ScrollingStateTree.cpp
Source/WebCore/page/scrolling/ScrollingStateTree.h
Source/WebCore/page/scrolling/ScrollingTree.cpp
Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp [new file with mode: 0644]
Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h [new file with mode: 0644]
Source/WebCore/page/scrolling/ScrollingTreeNode.h
Source/WebCore/page/scrolling/ScrollingTreeOverflowScrollingNode.cpp [new file with mode: 0644]
Source/WebCore/page/scrolling/ScrollingTreeOverflowScrollingNode.h [new file with mode: 0644]
Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp
Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h
Source/WebCore/page/scrolling/ios/ScrollingCoordinatorIOS.mm
Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h [moved from Source/WebCore/page/scrolling/ios/ScrollingTreeScrollingNodeIOS.h with 80% similarity]
Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm [moved from Source/WebCore/page/scrolling/ios/ScrollingTreeScrollingNodeIOS.mm with 68% similarity]
Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm
Source/WebCore/page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm [moved from Source/WebCore/page/scrolling/mac/ScrollingStateScrollingNodeMac.mm with 89% similarity]
Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h [moved from Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.h with 82% similarity]
Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm [moved from Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm with 77% similarity]
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp
Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp
Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.cpp
Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h
Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm
Source/WebKit2/UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm

index 3430e9c..5088039 100644 (file)
@@ -1,3 +1,29 @@
+2014-05-19  Simon Fraser  <simon.fraser@apple.com>
+
+        Split scrolling tree ScrollingNodes into FrameScrollingNodes and OverflowScrollingNodes
+        https://bugs.webkit.org/show_bug.cgi?id=133022
+
+        Reviewed by Sam Weinig.
+        
+        Updated for new node name. No geometry changes.
+
+        * platform/mac-wk2/tiled-drawing/clamp-out-of-bounds-scrolls-expected.txt:
+        * platform/mac-wk2/tiled-drawing/fixed/absolute-inside-fixed-expected.txt:
+        * platform/mac-wk2/tiled-drawing/fixed/absolute-inside-out-of-view-fixed-expected.txt:
+        * platform/mac-wk2/tiled-drawing/fixed/fixed-in-overflow-expected.txt:
+        * platform/mac-wk2/tiled-drawing/fixed/fixed-position-out-of-view-expected.txt:
+        * platform/mac-wk2/tiled-drawing/fixed/fixed-position-out-of-view-negative-zindex-expected.txt:
+        * platform/mac-wk2/tiled-drawing/fixed/four-bars-expected.txt:
+        * platform/mac-wk2/tiled-drawing/fixed/four-bars-with-header-and-footer-expected.txt:
+        * platform/mac-wk2/tiled-drawing/fixed/negative-scroll-offset-expected.txt:
+        * platform/mac-wk2/tiled-drawing/fixed/negative-scroll-offset-in-view-expected.txt:
+        * platform/mac-wk2/tiled-drawing/fixed/nested-fixed-expected.txt:
+        * platform/mac-wk2/tiled-drawing/fixed/percentage-inside-fixed-expected.txt:
+        * platform/mac-wk2/tiled-drawing/scrolling-tree-after-scroll-expected.txt:
+        * platform/mac-wk2/tiled-drawing/scrolling-tree-slow-scrolling-expected.txt:
+        * platform/mac-wk2/tiled-drawing/sticky/negative-scroll-offset-expected.txt:
+        * platform/mac-wk2/tiled-drawing/sticky/sticky-horizontal-expected.txt:
+
 2014-05-19  Zalan Bujtas  <zalan@apple.com>
 
         Fix Element.offset* and .client* rounding mismatches after r168868.
index 4213027..4c3bd9c 100644 (file)
@@ -1,38 +1,38 @@
 Attempted scroll to -5000, 0
-(Scrolling node
-  (viewport rect 785 585)
+(Frame scrolling node
+  (scrollable area size 785 585)
   (contents size 5008 5021)
 )
 
 Attempted scroll to 0, -5000
-(Scrolling node
-  (viewport rect 785 585)
+(Frame scrolling node
+  (scrollable area size 785 585)
   (contents size 5008 5021)
 )
 
 Attempted scroll to -5000, -5000
-(Scrolling node
-  (viewport rect 785 585)
+(Frame scrolling node
+  (scrollable area size 785 585)
   (contents size 5008 5021)
 )
 
 Attempted scroll to 10000, 0
-(Scrolling node
-  (viewport rect 785 585)
+(Frame scrolling node
+  (scrollable area size 785 585)
   (contents size 5008 5021)
   (requested scroll position 4223 0)
 )
 
 Attempted scroll to 0, 10000
-(Scrolling node
-  (viewport rect 785 585)
+(Frame scrolling node
+  (scrollable area size 785 585)
   (contents size 5008 5021)
   (requested scroll position 0 4436)
 )
 
 Attempted scroll to 10000, 10000
-(Scrolling node
-  (viewport rect 785 585)
+(Frame scrolling node
+  (scrollable area size 785 585)
   (contents size 5008 5021)
   (requested scroll position 4223 4436)
 )
index 52be7b8..4a5893a 100644 (file)
@@ -1,5 +1,5 @@
-(Scrolling node
-  (viewport rect 785 600)
+(Frame scrolling node
+  (scrollable area size 785 600)
   (contents size 785 2710)
   (requested scroll position 0 200)
   (children 1
index f88d628..2a112d3 100644 (file)
@@ -1,5 +1,5 @@
-(Scrolling node
-  (viewport rect 785 600)
+(Frame scrolling node
+  (scrollable area size 785 600)
   (contents size 785 2513)
   (requested scroll position 0 200)
   (children 1
index 9583eea..a48d0fb 100644 (file)
@@ -1,5 +1,5 @@
-(Scrolling node
-  (viewport rect 785 600)
+(Frame scrolling node
+  (scrollable area size 785 600)
   (contents size 785 2213)
   (requested scroll position 0 200)
   (children 1
index 259d293..7728b6f 100644 (file)
@@ -1,5 +1,5 @@
-(Scrolling node
-  (viewport rect 785 600)
+(Frame scrolling node
+  (scrollable area size 785 600)
   (contents size 785 2221)
   (requested scroll position 0 200)
   (children 4
index 912d625..8b0caed 100644 (file)
@@ -1,5 +1,5 @@
-(Scrolling node
-  (viewport rect 785 600)
+(Frame scrolling node
+  (scrollable area size 785 600)
   (contents size 785 2421)
   (requested scroll position 0 200)
   (children 4
index eb90191..1992ca3 100644 (file)
@@ -1,5 +1,5 @@
-(Scrolling node
-  (viewport rect 785 600)
+(Frame scrolling node
+  (scrollable area size 785 600)
   (contents size 785 2221)
   (children 1
     (Fixed node
index cbe2ca6..1f38a72 100644 (file)
@@ -1,5 +1,5 @@
-(Scrolling node
-  (viewport rect 785 600)
+(Frame scrolling node
+  (scrollable area size 785 600)
   (contents size 785 2213)
   (requested scroll position 0 200)
   (children 1
index 3b7f06b..3b92bc0 100644 (file)
@@ -1,5 +1,5 @@
-(Scrolling node
-  (viewport rect 785 600)
+(Frame scrolling node
+  (scrollable area size 785 600)
   (contents size 785 2513)
   (requested scroll position 0 200)
   (children 1
index 8905af7..e8974b7 100644 (file)
@@ -1,5 +1,5 @@
-(Scrolling node
-  (viewport rect 785 600)
+(Frame scrolling node
+  (scrollable area size 785 600)
   (contents size 785 5021)
   (requested scroll position 0 3000)
 )
index fe2ba3d..425bac0 100644 (file)
@@ -1,5 +1,5 @@
-(Scrolling node
-  (viewport rect 800 600)
+(Frame scrolling node
+  (scrollable area size 800 600)
   (contents size 800 600)
   (Scrolling on main thread because: Has slow repaint objects)
 )
index 5d7697e..cb20c08 100644 (file)
@@ -1,5 +1,5 @@
-(Scrolling node
-  (viewport rect 785 600)
+(Frame scrolling node
+  (scrollable area size 785 600)
   (contents size 785 2216)
   (children 1
     (Sticky node
index d7827c0..18123df 100644 (file)
@@ -1,6 +1,6 @@
 Left sticky Right sticky Left % sticky Right % sticky Left and Right Left and Right %
-(Scrolling node
-  (viewport rect 800 585)
+(Frame scrolling node
+  (scrollable area size 800 585)
   (contents size 2008 585)
   (requested scroll position 800 0)
   (children 6
index d72e613..1628695 100644 (file)
@@ -1935,6 +1935,9 @@ set(WebCore_SOURCES
     page/scrolling/ScrollingStateFixedNode.cpp
     page/scrolling/ScrollingStateNode.cpp
     page/scrolling/ScrollingStateScrollingNode.cpp
+    page/scrolling/ScrollingStateFrameScrollingNode.cpp
+    page/scrolling/ScrollingStateOverflowScrollingNode.cpp
+    page/scrolling/ScrollingStateScrollingNode.cpp
     page/scrolling/ScrollingStateStickyNode.cpp
     page/scrolling/ScrollingStateTree.cpp
 
index 8795eba..6df9cf5 100644 (file)
@@ -1,5 +1,210 @@
 2014-05-19  Simon Fraser  <simon.fraser@apple.com>
 
+        Split scrolling tree ScrollingNodes into FrameScrollingNodes and OverflowScrollingNodes
+        https://bugs.webkit.org/show_bug.cgi?id=133022
+
+        Reviewed by Sam Weinig.
+
+        In both the scrolling state tree and the scrolling tree, split the "scrolling nodes"
+        into FrameScrolling and OverflowScrolling nodes.
+        
+        Move what was the "viewportSize" property onto the base class for the scrolling
+        nodes, calling it "scrollableAreaSize".
+        
+        Make minimum/maximumScrollPosition() virtual so we can share more code (and there
+        is more code sharing to be done in future).
+
+        * Configurations/WebCore.xcconfig: Remove ScrollingStateScrollingNodeMac.mm and ScrollingTreeScrollingNodeMac.mm
+        from the list, using #ifdefs in the file instead.
+        * WebCore.exp.in: Lots of exports.
+        * WebCore.xcodeproj/project.pbxproj: New files.
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
+        (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
+        (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
+        (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode):
+        (WebCore::AsyncScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView):
+        (WebCore::AsyncScrollingCoordinator::updateScrollingNode): Deleted.
+        (WebCore::AsyncScrollingCoordinator::setScrollbarPaintersFromScrollbarsForNode): Deleted.
+        This tiny function didn't need to exist.
+        * page/scrolling/AsyncScrollingCoordinator.h:
+        * page/scrolling/ScrollingCoordinator.h:
+        (WebCore::ScrollingCoordinator::updateFrameScrollingNode):
+        (WebCore::ScrollingCoordinator::updateOverflowScrollingNode):
+        (WebCore::ScrollingCoordinator::updateScrollingNode): Deleted.
+        * page/scrolling/ScrollingStateFrameScrollingNode.cpp: Copied from Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp.
+        (WebCore::ScrollingStateFrameScrollingNode::create):
+        (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
+        (WebCore::ScrollingStateFrameScrollingNode::~ScrollingStateFrameScrollingNode):
+        (WebCore::ScrollingStateFrameScrollingNode::clone):
+        (WebCore::ScrollingStateFrameScrollingNode::setFrameScaleFactor):
+        (WebCore::ScrollingStateFrameScrollingNode::setNonFastScrollableRegion):
+        (WebCore::ScrollingStateFrameScrollingNode::setWheelEventHandlerCount):
+        (WebCore::ScrollingStateFrameScrollingNode::setSynchronousScrollingReasons):
+        (WebCore::ScrollingStateFrameScrollingNode::setScrollBehaviorForFixedElements):
+        (WebCore::ScrollingStateFrameScrollingNode::setHeaderHeight):
+        (WebCore::ScrollingStateFrameScrollingNode::setFooterHeight):
+        (WebCore::ScrollingStateFrameScrollingNode::setTopContentInset):
+        (WebCore::ScrollingStateFrameScrollingNode::setCounterScrollingLayer):
+        (WebCore::ScrollingStateFrameScrollingNode::setInsetClipLayer):
+        (WebCore::ScrollingStateFrameScrollingNode::setContentShadowLayer):
+        (WebCore::ScrollingStateFrameScrollingNode::setHeaderLayer):
+        (WebCore::ScrollingStateFrameScrollingNode::setFooterLayer):
+        (WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars):
+        (WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
+        * page/scrolling/ScrollingStateFrameScrollingNode.h: Copied from Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h.
+        * page/scrolling/ScrollingStateNode.h:
+        (WebCore::LayerRepresentation::layerID):
+        (WebCore::ScrollingStateNode::isFrameScrollingNode):
+        (WebCore::ScrollingStateNode::isOverflowScrollingNode):
+        * page/scrolling/ScrollingStateOverflowScrollingNode.cpp: Added.
+        (WebCore::ScrollingStateOverflowScrollingNode::create):
+        (WebCore::ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode):
+        (WebCore::ScrollingStateOverflowScrollingNode::~ScrollingStateOverflowScrollingNode):
+        (WebCore::ScrollingStateOverflowScrollingNode::clone):
+        (WebCore::ScrollingStateOverflowScrollingNode::setScrolledContentsLayer):
+        (WebCore::ScrollingStateOverflowScrollingNode::dumpProperties):
+        * page/scrolling/ScrollingStateOverflowScrollingNode.h: Copied from Source/WebCore/page/scrolling/mac/ScrollingStateScrollingNodeMac.mm.
+        (WebCore::ScrollingStateOverflowScrollingNode::scrolledContentsLayer):
+        * page/scrolling/ScrollingStateScrollingNode.cpp:
+        (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
+        (WebCore::ScrollingStateScrollingNode::setScrollableAreaSize):
+        (WebCore::ScrollingStateScrollingNode::setTotalContentsSize):
+        (WebCore::ScrollingStateScrollingNode::dumpProperties):
+        (WebCore::ScrollingStateScrollingNode::create): Deleted.
+        (WebCore::ScrollingStateScrollingNode::clone): Deleted.
+        (WebCore::ScrollingStateScrollingNode::setViewportSize): Deleted.
+        (WebCore::ScrollingStateScrollingNode::setFrameScaleFactor): Deleted.
+        (WebCore::ScrollingStateScrollingNode::setNonFastScrollableRegion): Deleted.
+        (WebCore::ScrollingStateScrollingNode::setWheelEventHandlerCount): Deleted.
+        (WebCore::ScrollingStateScrollingNode::setSynchronousScrollingReasons): Deleted.
+        (WebCore::ScrollingStateScrollingNode::setScrollBehaviorForFixedElements): Deleted.
+        (WebCore::ScrollingStateScrollingNode::setHeaderHeight): Deleted.
+        (WebCore::ScrollingStateScrollingNode::setFooterHeight): Deleted.
+        (WebCore::ScrollingStateScrollingNode::setTopContentInset): Deleted.
+        (WebCore::ScrollingStateScrollingNode::setScrolledContentsLayer): Deleted.
+        (WebCore::ScrollingStateScrollingNode::setCounterScrollingLayer): Deleted.
+        (WebCore::ScrollingStateScrollingNode::setInsetClipLayer): Deleted.
+        (WebCore::ScrollingStateScrollingNode::setContentShadowLayer): Deleted.
+        (WebCore::ScrollingStateScrollingNode::setHeaderLayer): Deleted.
+        (WebCore::ScrollingStateScrollingNode::setFooterLayer): Deleted.
+        (WebCore::ScrollingStateScrollingNode::setScrollbarPaintersFromScrollbars): Deleted.
+        * page/scrolling/ScrollingStateScrollingNode.h:
+        (WebCore::ScrollingStateScrollingNode::scrollableAreaSize):
+        (WebCore::ScrollingStateScrollingNode::totalContentsSize):
+        * page/scrolling/ScrollingStateTree.cpp:
+        (WebCore::ScrollingStateTree::attachNode):
+        (WebCore::ScrollingStateTree::commit):
+        * page/scrolling/ScrollingStateTree.h:
+        (WebCore::ScrollingStateTree::rootStateNode):
+        (WebCore::ScrollingStateTree::setRootStateNode):
+        * page/scrolling/ScrollingTree.cpp:
+        (WebCore::ScrollingTree::commitNewTreeState):
+        * page/scrolling/ScrollingTreeFrameScrollingNode.cpp: Added.
+        (WebCore::ScrollingTreeFrameScrollingNode::ScrollingTreeFrameScrollingNode):
+        (WebCore::ScrollingTreeFrameScrollingNode::~ScrollingTreeFrameScrollingNode):
+        (WebCore::ScrollingTreeFrameScrollingNode::updateBeforeChildren):
+        * page/scrolling/ScrollingTreeFrameScrollingNode.h: Copied from Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h.
+        (WebCore::ScrollingTreeFrameScrollingNode::updateLayersAfterDelegatedScroll):
+        (WebCore::ScrollingTreeFrameScrollingNode::synchronousScrollingReasons):
+        (WebCore::ScrollingTreeFrameScrollingNode::shouldUpdateScrollLayerPositionSynchronously):
+        (WebCore::ScrollingTreeFrameScrollingNode::frameScaleFactor):
+        (WebCore::ScrollingTreeFrameScrollingNode::headerHeight):
+        (WebCore::ScrollingTreeFrameScrollingNode::footerHeight):
+        (WebCore::ScrollingTreeFrameScrollingNode::topContentInset):
+        (WebCore::ScrollingTreeFrameScrollingNode::scrollBehaviorForFixedElements):
+        * page/scrolling/ScrollingTreeNode.h:
+        (WebCore::ScrollingTreeNode::isFrameScrollingNode):
+        (WebCore::ScrollingTreeNode::isOverflowScrollingNode):
+        * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp: Copied from Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h.
+        (WebCore::ScrollingTreeOverflowScrollingNode::ScrollingTreeOverflowScrollingNode):
+        (WebCore::ScrollingTreeOverflowScrollingNode::~ScrollingTreeOverflowScrollingNode):
+        * page/scrolling/ScrollingTreeOverflowScrollingNode.h: Copied from Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h.
+        * page/scrolling/ScrollingTreeScrollingNode.cpp:
+        (WebCore::ScrollingTreeScrollingNode::ScrollingTreeScrollingNode):
+        (WebCore::ScrollingTreeScrollingNode::updateBeforeChildren):
+        (WebCore::ScrollingTreeScrollingNode::updateAfterChildren):
+        (WebCore::ScrollingTreeScrollingNode::setScrollPosition):
+        (WebCore::ScrollingTreeScrollingNode::setScrollPositionWithoutContentEdgeConstraints):
+        (WebCore::ScrollingTreeScrollingNode::minimumScrollPosition):
+        (WebCore::ScrollingTreeScrollingNode::maximumScrollPosition):
+        * page/scrolling/ScrollingTreeScrollingNode.h:
+        (WebCore::ScrollingTreeScrollingNode::scrollableAreaSize):
+        (WebCore::ScrollingTreeScrollingNode::totalContentsSize):
+        (WebCore::ScrollingTreeScrollingNode::totalContentsSizeForRubberBand):
+        (WebCore::ScrollingTreeScrollingNode::setTotalContentsSizeForRubberBand):
+        (WebCore::ScrollingTreeScrollingNode::synchronousScrollingReasons): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::shouldUpdateScrollLayerPositionSynchronously): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::viewportSize): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::frameScaleFactor): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::headerHeight): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::footerHeight): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::scrollBehaviorForFixedElements): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::topContentInset): Deleted.
+        * page/scrolling/ios/ScrollingCoordinatorIOS.mm:
+        (WebCore::ScrollingCoordinatorIOS::createScrollingTreeNode):
+        * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h: Renamed from Source/WebCore/page/scrolling/ios/ScrollingTreeScrollingNodeIOS.h.
+        (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollLayer):
+        * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: Renamed from Source/WebCore/page/scrolling/ios/ScrollingTreeScrollingNodeIOS.mm.
+        (WebCore::ScrollingTreeFrameScrollingNodeIOS::create):
+        (WebCore::ScrollingTreeFrameScrollingNodeIOS::ScrollingTreeFrameScrollingNodeIOS):
+        (WebCore::ScrollingTreeFrameScrollingNodeIOS::~ScrollingTreeFrameScrollingNodeIOS):
+        (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateBeforeChildren):
+        (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateAfterChildren):
+        (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollPosition):
+        (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPosition):
+        (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints):
+        (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollLayerPosition):
+        (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterViewportChange):
+        (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterDelegatedScroll):
+        (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateChildNodesAfterScroll):
+        (WebCore::ScrollingTreeFrameScrollingNodeIOS::minimumScrollPosition):
+        (WebCore::ScrollingTreeFrameScrollingNodeIOS::maximumScrollPosition):
+        (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollBy):
+        (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollByWithoutContentEdgeConstraints):
+        * page/scrolling/mac/ScrollingCoordinatorMac.mm:
+        (WebCore::ScrollingCoordinatorMac::createScrollingTreeNode):
+        * page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingStateScrollingNodeMac.mm.
+        (WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars):
+        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.h.
+        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm.
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::create):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::updateAfterChildren):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::allowsHorizontalStretching):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::allowsVerticalStretching):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::stretchAmount):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::pinnedInDirection):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::canScrollHorizontally):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::canScrollVertically):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::shouldRubberBandInDirection):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::absoluteScrollPosition):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollBy):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollByWithoutContentEdgeConstraints):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::startSnapRubberbandTimer):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::stopSnapRubberbandTimer):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::adjustScrollPositionToBoundsIfNecessary):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::updateLayersAfterViewportChange):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::minimumScrollPosition):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::maximumScrollPosition):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollBy):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollByWithoutContentEdgeConstraints):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::logExposedUnfilledArea):
+        (WebCore::logThreadedScrollingMode):
+        (WebCore::logWheelEventHandlerCountChanged):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
+
+2014-05-19  Simon Fraser  <simon.fraser@apple.com>
+
         Images missing sometimes with composited clipping layers
         https://bugs.webkit.org/show_bug.cgi?id=133065
         <rdar://problem/15224559>
index f229c54..0515080 100644 (file)
@@ -112,6 +112,6 @@ JAVASCRIPTCORE_PRIVATE_HEADERS_DIR_Production_macosx = $(SDKROOT)$(PRODUCTION_FR
 JAVASCRIPTCORE_PRIVATE_HEADERS_engineering = $(BUILT_PRODUCTS_DIR)/JavaScriptCore.framework/PrivateHeaders;
 
 EXCLUDED_SOURCE_FILE_NAMES = $(EXCLUDED_SOURCE_FILE_NAMES_$(PLATFORM_NAME));
-EXCLUDED_SOURCE_FILE_NAMES_iphoneos = *.tiff *Cursor.png AccessibilityObjectMac.mm AXObjectCacheMac.mm ColorMac.mm Cursor.cpp CursorMac.mm DataTransferMac.mm EditorMac.mm EventHandlerMac.mm EventLoopMac.mm GeolocationServiceMac.mm GraphicsContext3DOpenGLES.cpp IconDatabase.cpp IconMac.mm KillRingMac.mm LocalCurrentGraphicsContext.mm MIMETypeRegistryMac.mm MediaPlayerPrivateQTKit.mm NSScrollerImpDetails.mm NetworkStateNotifierMac.cpp PasteboardMac.mm PlatformEventFactoryMac.mm PlatformMouseEventMac.mm PlatformPasteboardMac.mm PlatformScreenMac.mm PlatformSpeechSynthesizerMac.mm PluginMainThreadScheduler.cpp RunLoopMac.mm SSLKeyGeneratorMac.cpp ScrollingCoordinatorMac.mm ScrollingStateScrollingNodeMac.mm ScrollingTreeScrollingNodeMac.mm ScrollViewMac.mm ScrollbarThemeMac.mm SharedTimerMac.mm SoundMac.mm SystemTimeMac.cpp ThemeMac.mm ThreadCheck.mm UserAgentMac.mm WebAccessibilityObjectWrapperMac.mm WebCoreSystemInterface.mm WebCoreURLResponse.mm WebCoreView.m WebFontCache.mm WebVideoFullscreenController.mm WebVideoFullscreenHUDWindowController.mm WebWindowAnimation.mm WidgetMac.mm mac/LayerPool.mm DisplayRefreshMonitorMac.cpp;
+EXCLUDED_SOURCE_FILE_NAMES_iphoneos = *.tiff *Cursor.png AccessibilityObjectMac.mm AXObjectCacheMac.mm ColorMac.mm Cursor.cpp CursorMac.mm DataTransferMac.mm EditorMac.mm EventHandlerMac.mm EventLoopMac.mm GeolocationServiceMac.mm GraphicsContext3DOpenGLES.cpp IconDatabase.cpp IconMac.mm KillRingMac.mm LocalCurrentGraphicsContext.mm MIMETypeRegistryMac.mm MediaPlayerPrivateQTKit.mm NSScrollerImpDetails.mm NetworkStateNotifierMac.cpp PasteboardMac.mm PlatformEventFactoryMac.mm PlatformMouseEventMac.mm PlatformPasteboardMac.mm PlatformScreenMac.mm PlatformSpeechSynthesizerMac.mm PluginMainThreadScheduler.cpp RunLoopMac.mm SSLKeyGeneratorMac.cpp ScrollingCoordinatorMac.mm ScrollViewMac.mm ScrollbarThemeMac.mm SharedTimerMac.mm SoundMac.mm SystemTimeMac.cpp ThemeMac.mm ThreadCheck.mm UserAgentMac.mm WebAccessibilityObjectWrapperMac.mm WebCoreSystemInterface.mm WebCoreURLResponse.mm WebCoreView.m WebFontCache.mm WebVideoFullscreenController.mm WebVideoFullscreenHUDWindowController.mm WebWindowAnimation.mm WidgetMac.mm mac/LayerPool.mm DisplayRefreshMonitorMac.cpp;
 EXCLUDED_SOURCE_FILE_NAMES_iphonesimulator = $(EXCLUDED_SOURCE_FILE_NAMES_iphoneos);
 EXCLUDED_SOURCE_FILE_NAMES_macosx = *IOS.h *IOS.cpp *IOS.mm JSTouch* JSGesture* DOMGesture* DOMTouch* KillRingNone.cpp WAKAppKitStubs.h WAKClipView.h WAKResponder.h WAKScrollView.h WAKView.h WAKViewPrivate.h WAKWindow.h WKContentObservation.h WKGraphics.h WKTypes.h WKUtilities.h WKView.h WKViewPrivate.h WebCoreThread.h WebCoreThreadMessage.h WebCoreThreadRun.h WebCoreThreadSystemInterface.h;
index bf5e9a9..7975136 100644 (file)
@@ -2814,10 +2814,11 @@ __ZN7WebCore25AsyncScrollingCoordinator14clearStateTreeEv
 __ZN7WebCore25AsyncScrollingCoordinator17attachToStateTreeENS_17ScrollingNodeTypeEyy
 __ZN7WebCore25AsyncScrollingCoordinator18syncChildPositionsERKNS_10LayoutRectE
 __ZN7WebCore25AsyncScrollingCoordinator19detachFromStateTreeEy
-__ZN7WebCore25AsyncScrollingCoordinator19updateScrollingNodeEyPNS_13GraphicsLayerES2_S2_S2_PKNS_20ScrollingCoordinator17ScrollingGeometryE
 __ZN7WebCore25AsyncScrollingCoordinator22frameViewLayoutUpdatedEPNS_9FrameViewE
+__ZN7WebCore25AsyncScrollingCoordinator24updateFrameScrollingNodeEyPNS_13GraphicsLayerES2_S2_PKNS_20ScrollingCoordinator17ScrollingGeometryE
 __ZN7WebCore25AsyncScrollingCoordinator27frameViewRootLayerDidChangeEPNS_9FrameViewE
 __ZN7WebCore25AsyncScrollingCoordinator27requestScrollPositionUpdateEPNS_9FrameViewERKNS_8IntPointE
+__ZN7WebCore25AsyncScrollingCoordinator27updateOverflowScrollingNodeEyPNS_13GraphicsLayerES2_PKNS_20ScrollingCoordinator17ScrollingGeometryE
 __ZN7WebCore25AsyncScrollingCoordinator29updateViewportConstrainedNodeEyRKNS_19ViewportConstraintsEPNS_13GraphicsLayerE
 __ZN7WebCore25AsyncScrollingCoordinator30setSynchronousScrollingReasonsEj
 __ZN7WebCore25AsyncScrollingCoordinator37scrollableAreaScrollbarLayerDidChangeEPNS_14ScrollableAreaENS_20ScrollbarOrientationE
@@ -2826,43 +2827,43 @@ __ZN7WebCore25AsyncScrollingCoordinator43recomputeWheelEventHandlerCountForFrame
 __ZN7WebCore25AsyncScrollingCoordinator44scheduleUpdateScrollPositionAfterAsyncScrollEyRKNS_10FloatPointEbNS_31SetOrSyncScrollingLayerPositionE
 __ZN7WebCore25AsyncScrollingCoordinatorC2EPNS_4PageE
 __ZN7WebCore25AsyncScrollingCoordinatorD2Ev
-__ZN7WebCore27ScrollingStateScrollingNode14setFooterLayerERKNS_19LayerRepresentationE
-__ZN7WebCore27ScrollingStateScrollingNode14setHeaderLayerERKNS_19LayerRepresentationE
-__ZN7WebCore27ScrollingStateScrollingNode15setFooterHeightEi
-__ZN7WebCore27ScrollingStateScrollingNode15setHeaderHeightEi
+__ZN7WebCore26ScrollingTreeScrollingNode17setScrollPositionERKNS_10FloatPointE
+__ZN7WebCore26ScrollingTreeScrollingNode19updateAfterChildrenERKNS_18ScrollingStateNodeE
+__ZN7WebCore26ScrollingTreeScrollingNode20updateBeforeChildrenERKNS_18ScrollingStateNodeE
+__ZN7WebCore26ScrollingTreeScrollingNode46setScrollPositionWithoutContentEdgeConstraintsERKNS_10FloatPointE
 __ZN7WebCore27ScrollingStateScrollingNode15setScrollOriginERKNS_8IntPointE
-__ZN7WebCore27ScrollingStateScrollingNode15setViewportSizeERKNS_9FloatSizeE
-__ZN7WebCore27ScrollingStateScrollingNode17setInsetClipLayerERKNS_19LayerRepresentationE
 __ZN7WebCore27ScrollingStateScrollingNode17setScrollPositionERKNS_10FloatPointE
-__ZN7WebCore27ScrollingStateScrollingNode18setTopContentInsetEf
-__ZN7WebCore27ScrollingStateScrollingNode19setFrameScaleFactorEf
-__ZN7WebCore27ScrollingStateScrollingNode20setTotalContentsSizeERKNS_7IntSizeE
-__ZN7WebCore27ScrollingStateScrollingNode21setContentShadowLayerERKNS_19LayerRepresentationE
-__ZN7WebCore27ScrollingStateScrollingNode24setCounterScrollingLayerERKNS_19LayerRepresentationE
-__ZN7WebCore27ScrollingStateScrollingNode24setScrolledContentsLayerERKNS_19LayerRepresentationE
-__ZN7WebCore27ScrollingStateScrollingNode25setWheelEventHandlerCountEj
-__ZN7WebCore27ScrollingStateScrollingNode26setNonFastScrollableRegionERKNS_6RegionE
+__ZN7WebCore27ScrollingStateScrollingNode20setTotalContentsSizeERKNS_9FloatSizeE
+__ZN7WebCore27ScrollingStateScrollingNode21setScrollableAreaSizeERKNS_9FloatSizeE
 __ZN7WebCore27ScrollingStateScrollingNode26setRequestedScrollPositionERKNS_10FloatPointEb
 __ZN7WebCore27ScrollingStateScrollingNode27setScrollableAreaParametersERKNS_24ScrollableAreaParametersE
-__ZN7WebCore27ScrollingStateScrollingNode30setSynchronousScrollingReasonsEj
-__ZN7WebCore27ScrollingStateScrollingNode33setScrollBehaviorForFixedElementsENS_30ScrollBehaviorForFixedElementsE
+__ZN7WebCore32ScrollingStateFrameScrollingNode14setFooterLayerERKNS_19LayerRepresentationE
+__ZN7WebCore32ScrollingStateFrameScrollingNode14setHeaderLayerERKNS_19LayerRepresentationE
+__ZN7WebCore32ScrollingStateFrameScrollingNode15setFooterHeightEi
+__ZN7WebCore32ScrollingStateFrameScrollingNode15setHeaderHeightEi
+__ZN7WebCore32ScrollingStateFrameScrollingNode17setInsetClipLayerERKNS_19LayerRepresentationE
+__ZN7WebCore32ScrollingStateFrameScrollingNode18setTopContentInsetEf
+__ZN7WebCore32ScrollingStateFrameScrollingNode19setFrameScaleFactorEf
+__ZN7WebCore32ScrollingStateFrameScrollingNode21setContentShadowLayerERKNS_19LayerRepresentationE
+__ZN7WebCore32ScrollingStateFrameScrollingNode24setCounterScrollingLayerERKNS_19LayerRepresentationE
+__ZN7WebCore32ScrollingStateFrameScrollingNode25setWheelEventHandlerCountEj
+__ZN7WebCore32ScrollingStateFrameScrollingNode26setNonFastScrollableRegionERKNS_6RegionE
+__ZN7WebCore32ScrollingStateFrameScrollingNode30setSynchronousScrollingReasonsEj
+__ZN7WebCore32ScrollingStateFrameScrollingNode33setScrollBehaviorForFixedElementsENS_30ScrollBehaviorForFixedElementsE
+__ZN7WebCore34ScrollingTreeOverflowScrollingNodeC2ERNS_13ScrollingTreeEy
+__ZN7WebCore34ScrollingTreeOverflowScrollingNodeD2Ev
+__ZN7WebCore35ScrollingStateOverflowScrollingNode24setScrolledContentsLayerERKNS_19LayerRepresentationE
 __ZNK7WebCore25AsyncScrollingCoordinator24scrollingStateTreeAsTextEv
+__ZNK7WebCore26ScrollingTreeScrollingNode21maximumScrollPositionEv
+__ZNK7WebCore26ScrollingTreeScrollingNode21minimumScrollPositionEv
 #endif
 
 #if ENABLE(ASYNC_SCROLLING) && PLATFORM(MAC)
-__ZN7WebCore29ScrollingTreeScrollingNodeMac6createERNS_13ScrollingTreeENS_17ScrollingNodeTypeEy
+__ZN7WebCore34ScrollingTreeFrameScrollingNodeMac6createERNS_13ScrollingTreeEy
 #endif
 
 #if ENABLE(ASYNC_SCROLLING) && PLATFORM(IOS)
-__ZN7WebCore29ScrollingTreeScrollingNodeIOS17setScrollPositionERKNS_10FloatPointE
-__ZN7WebCore29ScrollingTreeScrollingNodeIOS19updateAfterChildrenERKNS_18ScrollingStateNodeE
-__ZN7WebCore29ScrollingTreeScrollingNodeIOS20updateBeforeChildrenERKNS_18ScrollingStateNodeE
-__ZN7WebCore29ScrollingTreeScrollingNodeIOS31updateLayersAfterViewportChangeERKNS_9FloatRectEd
-__ZN7WebCore29ScrollingTreeScrollingNodeIOS32updateLayersAfterDelegatedScrollERKNS_10FloatPointE
-__ZN7WebCore29ScrollingTreeScrollingNodeIOS46setScrollPositionWithoutContentEdgeConstraintsERKNS_10FloatPointE
-__ZN7WebCore29ScrollingTreeScrollingNodeIOS6createERNS_13ScrollingTreeENS_17ScrollingNodeTypeEy
-__ZN7WebCore29ScrollingTreeScrollingNodeIOSC2ERNS_13ScrollingTreeENS_17ScrollingNodeTypeEy
-__ZN7WebCore29ScrollingTreeScrollingNodeIOSD2Ev
+__ZN7WebCore34ScrollingTreeFrameScrollingNodeIOS6createERNS_13ScrollingTreeEy
 #endif
 
 #if USE(AVFOUNDATION)
@@ -3231,7 +3232,9 @@ __ZN7WebCore16ScriptController16createRootObjectEPv
 
 #if ENABLE(POINTER_LOCK)
 __ZN7WebCore10MouseEvent6createERKN3WTF12AtomicStringEbbdNS1_10PassRefPtrINS_9DOMWindowEEEiiiiiiibbbbtNS5_INS_11EventTargetEEENS5_INS_12DataTransferEEEb
-#else
+#endif
+
+#if !ENABLE(POINTER_LOCK)
 __ZN7WebCore10MouseEvent6createERKN3WTF12AtomicStringEbbdNS1_10PassRefPtrINS_9DOMWindowEEEiiiiibbbbtNS5_INS_11EventTargetEEENS5_INS_12DataTransferEEEb
 #endif
 
index 8c9fcc9..bfe885d 100644 (file)
                0F97A658155DA81E00FADD4C /* DisplayRefreshMonitorIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F97A657155DA81E00FADD4C /* DisplayRefreshMonitorIOS.mm */; };
                0FA24D79162DF91900A3F4C0 /* GraphicsLayerUpdater.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FA24D77162DF91900A3F4C0 /* GraphicsLayerUpdater.cpp */; };
                0FA24D7A162DF91900A3F4C0 /* GraphicsLayerUpdater.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FA24D78162DF91900A3F4C0 /* GraphicsLayerUpdater.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               0FA88EBD16A8D1BD00F99984 /* ScrollingStateScrollingNodeMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FA88EBC16A8D1BD00F99984 /* ScrollingStateScrollingNodeMac.mm */; };
+               0FA88EBD16A8D1BD00F99984 /* ScrollingStateFrameScrollingNodeMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FA88EBC16A8D1BD00F99984 /* ScrollingStateFrameScrollingNodeMac.mm */; };
                0FB6252E18DE1B1500A07C05 /* GeometryUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB6252C18DE1B1500A07C05 /* GeometryUtilities.cpp */; };
                0FB6252F18DE1B1500A07C05 /* GeometryUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB6252D18DE1B1500A07C05 /* GeometryUtilities.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0FB8890A167D2FA10010CDA5 /* ScrollingTreeStickyNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB88908167D2FA10010CDA5 /* ScrollingTreeStickyNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0FC4E40E187F82E10045882C /* ScrollingCoordinatorIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FC4E408187F82E10045882C /* ScrollingCoordinatorIOS.mm */; };
                0FC4E40F187F82E10045882C /* ScrollingTreeIOS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC4E409187F82E10045882C /* ScrollingTreeIOS.cpp */; };
                0FC4E410187F82E10045882C /* ScrollingTreeIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC4E40A187F82E10045882C /* ScrollingTreeIOS.h */; };
-               0FC4E411187F82E10045882C /* ScrollingTreeScrollingNodeIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC4E40B187F82E10045882C /* ScrollingTreeScrollingNodeIOS.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               0FC4E412187F82E10045882C /* ScrollingTreeScrollingNodeIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FC4E40C187F82E10045882C /* ScrollingTreeScrollingNodeIOS.mm */; };
+               0FC4E411187F82E10045882C /* ScrollingTreeFrameScrollingNodeIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC4E40B187F82E10045882C /* ScrollingTreeFrameScrollingNodeIOS.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               0FC4E412187F82E10045882C /* ScrollingTreeFrameScrollingNodeIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FC4E40C187F82E10045882C /* ScrollingTreeFrameScrollingNodeIOS.mm */; };
                0FCF33240F2B9715004B6795 /* ColorCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FCF33230F2B9715004B6795 /* ColorCG.cpp */; };
                0FCF332E0F2B9A25004B6795 /* WebLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCF332A0F2B9A25004B6795 /* WebLayer.mm */; };
                0FCF332F0F2B9A25004B6795 /* WebLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCF332B0F2B9A25004B6795 /* WebLayer.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0FDA7C271883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDA7C251883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.h */; };
                0FE71405142170B800DB33BA /* ScrollbarThemeMock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE71403142170B800DB33BA /* ScrollbarThemeMock.cpp */; };
                0FE71406142170B800DB33BA /* ScrollbarThemeMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE71404142170B800DB33BA /* ScrollbarThemeMock.h */; };
+               0FEA3E7B191B2FC5000F1B55 /* ScrollingStateFrameScrollingNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA3E79191B2FC5000F1B55 /* ScrollingStateFrameScrollingNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               0FEA3E7C191B2FC5000F1B55 /* ScrollingStateFrameScrollingNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA3E7A191B2FC5000F1B55 /* ScrollingStateFrameScrollingNode.cpp */; };
+               0FEA3E7F191B3169000F1B55 /* ScrollingTreeOverflowScrollingNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA3E7D191B3169000F1B55 /* ScrollingTreeOverflowScrollingNode.cpp */; };
+               0FEA3E80191B3169000F1B55 /* ScrollingTreeOverflowScrollingNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA3E7E191B3169000F1B55 /* ScrollingTreeOverflowScrollingNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               0FEA3E83191B31BF000F1B55 /* ScrollingStateOverflowScrollingNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA3E81191B31BF000F1B55 /* ScrollingStateOverflowScrollingNode.cpp */; };
+               0FEA3E84191B31BF000F1B55 /* ScrollingStateOverflowScrollingNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA3E82191B31BF000F1B55 /* ScrollingStateOverflowScrollingNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               0FEA3E87191B3BD7000F1B55 /* ScrollingTreeFrameScrollingNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA3E85191B3BD7000F1B55 /* ScrollingTreeFrameScrollingNode.cpp */; };
+               0FEA3E88191B3BD7000F1B55 /* ScrollingTreeFrameScrollingNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA3E86191B3BD7000F1B55 /* ScrollingTreeFrameScrollingNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0FF5025B102BA9010066F39A /* DOMStyleMedia.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF50259102BA9010066F39A /* DOMStyleMedia.h */; };
                0FF5025C102BA9010066F39A /* DOMStyleMedia.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FF5025A102BA9010066F39A /* DOMStyleMedia.mm */; };
                0FF50263102BA92C0066F39A /* DOMStyleMediaInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF50262102BA92B0066F39A /* DOMStyleMediaInternal.h */; };
                93C38C03164473DD00091EB2 /* ScrollingTreeFixedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 93C38C01164473DD00091EB2 /* ScrollingTreeFixedNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
                93C38C04164473DD00091EB2 /* ScrollingTreeFixedNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93C38C02164473DD00091EB2 /* ScrollingTreeFixedNode.mm */; };
                93C442000F813AE100C1A634 /* CollectionType.h in Headers */ = {isa = PBXBuildFile; fileRef = 93C441FF0F813AE100C1A634 /* CollectionType.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               93C4A4151629DF5A00C3EB6E /* ScrollingTreeScrollingNodeMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 93C4A4131629DF5A00C3EB6E /* ScrollingTreeScrollingNodeMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               93C4A4161629DF5A00C3EB6E /* ScrollingTreeScrollingNodeMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93C4A4141629DF5A00C3EB6E /* ScrollingTreeScrollingNodeMac.mm */; };
+               93C4A4151629DF5A00C3EB6E /* ScrollingTreeFrameScrollingNodeMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 93C4A4131629DF5A00C3EB6E /* ScrollingTreeFrameScrollingNodeMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               93C4A4161629DF5A00C3EB6E /* ScrollingTreeFrameScrollingNodeMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93C4A4141629DF5A00C3EB6E /* ScrollingTreeFrameScrollingNodeMac.mm */; };
                93C4F6EB1108F9A50099D0DB /* AccessibilityScrollbar.h in Headers */ = {isa = PBXBuildFile; fileRef = 93C4F6E91108F9A50099D0DB /* AccessibilityScrollbar.h */; };
                93C841F809CE855C00DFF5E5 /* DOMImplementationFront.h in Headers */ = {isa = PBXBuildFile; fileRef = 93C841F709CE855C00DFF5E5 /* DOMImplementationFront.h */; };
                93C841FF09CE858300DFF5E5 /* DOMImplementationFront.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93C841FE09CE858300DFF5E5 /* DOMImplementationFront.cpp */; };
                0F97A657155DA81E00FADD4C /* DisplayRefreshMonitorIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DisplayRefreshMonitorIOS.mm; sourceTree = "<group>"; };
                0FA24D77162DF91900A3F4C0 /* GraphicsLayerUpdater.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsLayerUpdater.cpp; sourceTree = "<group>"; };
                0FA24D78162DF91900A3F4C0 /* GraphicsLayerUpdater.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsLayerUpdater.h; sourceTree = "<group>"; };
-               0FA88EBC16A8D1BD00F99984 /* ScrollingStateScrollingNodeMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollingStateScrollingNodeMac.mm; sourceTree = "<group>"; };
+               0FA88EBC16A8D1BD00F99984 /* ScrollingStateFrameScrollingNodeMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollingStateFrameScrollingNodeMac.mm; sourceTree = "<group>"; };
                0FB6252C18DE1B1500A07C05 /* GeometryUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GeometryUtilities.cpp; sourceTree = "<group>"; };
                0FB6252D18DE1B1500A07C05 /* GeometryUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeometryUtilities.h; sourceTree = "<group>"; };
                0FB88908167D2FA10010CDA5 /* ScrollingTreeStickyNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeStickyNode.h; sourceTree = "<group>"; };
                0FC4E408187F82E10045882C /* ScrollingCoordinatorIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ScrollingCoordinatorIOS.mm; path = ios/ScrollingCoordinatorIOS.mm; sourceTree = "<group>"; };
                0FC4E409187F82E10045882C /* ScrollingTreeIOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScrollingTreeIOS.cpp; path = ios/ScrollingTreeIOS.cpp; sourceTree = "<group>"; };
                0FC4E40A187F82E10045882C /* ScrollingTreeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScrollingTreeIOS.h; path = ios/ScrollingTreeIOS.h; sourceTree = "<group>"; };
-               0FC4E40B187F82E10045882C /* ScrollingTreeScrollingNodeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScrollingTreeScrollingNodeIOS.h; path = ios/ScrollingTreeScrollingNodeIOS.h; sourceTree = "<group>"; };
-               0FC4E40C187F82E10045882C /* ScrollingTreeScrollingNodeIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ScrollingTreeScrollingNodeIOS.mm; path = ios/ScrollingTreeScrollingNodeIOS.mm; sourceTree = "<group>"; };
+               0FC4E40B187F82E10045882C /* ScrollingTreeFrameScrollingNodeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScrollingTreeFrameScrollingNodeIOS.h; path = ios/ScrollingTreeFrameScrollingNodeIOS.h; sourceTree = "<group>"; };
+               0FC4E40C187F82E10045882C /* ScrollingTreeFrameScrollingNodeIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ScrollingTreeFrameScrollingNodeIOS.mm; path = ios/ScrollingTreeFrameScrollingNodeIOS.mm; sourceTree = "<group>"; };
                0FCF33230F2B9715004B6795 /* ColorCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ColorCG.cpp; sourceTree = "<group>"; };
                0FCF332A0F2B9A25004B6795 /* WebLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebLayer.mm; sourceTree = "<group>"; };
                0FCF332B0F2B9A25004B6795 /* WebLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebLayer.h; sourceTree = "<group>"; };
                0FE71403142170B800DB33BA /* ScrollbarThemeMock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollbarThemeMock.cpp; sourceTree = "<group>"; };
                0FE71404142170B800DB33BA /* ScrollbarThemeMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollbarThemeMock.h; sourceTree = "<group>"; };
                0FE71415142189FC00DB33BA /* ScrollbarTheme.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollbarTheme.cpp; sourceTree = "<group>"; };
+               0FEA3E79191B2FC5000F1B55 /* ScrollingStateFrameScrollingNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingStateFrameScrollingNode.h; sourceTree = "<group>"; };
+               0FEA3E7A191B2FC5000F1B55 /* ScrollingStateFrameScrollingNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollingStateFrameScrollingNode.cpp; sourceTree = "<group>"; };
+               0FEA3E7D191B3169000F1B55 /* ScrollingTreeOverflowScrollingNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollingTreeOverflowScrollingNode.cpp; sourceTree = "<group>"; };
+               0FEA3E7E191B3169000F1B55 /* ScrollingTreeOverflowScrollingNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeOverflowScrollingNode.h; sourceTree = "<group>"; };
+               0FEA3E81191B31BF000F1B55 /* ScrollingStateOverflowScrollingNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollingStateOverflowScrollingNode.cpp; sourceTree = "<group>"; };
+               0FEA3E82191B31BF000F1B55 /* ScrollingStateOverflowScrollingNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingStateOverflowScrollingNode.h; sourceTree = "<group>"; };
+               0FEA3E85191B3BD7000F1B55 /* ScrollingTreeFrameScrollingNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollingTreeFrameScrollingNode.cpp; sourceTree = "<group>"; };
+               0FEA3E86191B3BD7000F1B55 /* ScrollingTreeFrameScrollingNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeFrameScrollingNode.h; sourceTree = "<group>"; };
                0FF50259102BA9010066F39A /* DOMStyleMedia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMStyleMedia.h; sourceTree = "<group>"; };
                0FF5025A102BA9010066F39A /* DOMStyleMedia.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMStyleMedia.mm; sourceTree = "<group>"; };
                0FF50262102BA92B0066F39A /* DOMStyleMediaInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMStyleMediaInternal.h; sourceTree = "<group>"; };
                93C38C01164473DD00091EB2 /* ScrollingTreeFixedNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeFixedNode.h; sourceTree = "<group>"; };
                93C38C02164473DD00091EB2 /* ScrollingTreeFixedNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollingTreeFixedNode.mm; sourceTree = "<group>"; };
                93C441FF0F813AE100C1A634 /* CollectionType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CollectionType.h; sourceTree = "<group>"; };
-               93C4A4131629DF5A00C3EB6E /* ScrollingTreeScrollingNodeMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeScrollingNodeMac.h; sourceTree = "<group>"; };
-               93C4A4141629DF5A00C3EB6E /* ScrollingTreeScrollingNodeMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollingTreeScrollingNodeMac.mm; sourceTree = "<group>"; };
+               93C4A4131629DF5A00C3EB6E /* ScrollingTreeFrameScrollingNodeMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeFrameScrollingNodeMac.h; sourceTree = "<group>"; };
+               93C4A4141629DF5A00C3EB6E /* ScrollingTreeFrameScrollingNodeMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollingTreeFrameScrollingNodeMac.mm; sourceTree = "<group>"; };
                93C4F6E91108F9A50099D0DB /* AccessibilityScrollbar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityScrollbar.h; sourceTree = "<group>"; };
                93C841F709CE855C00DFF5E5 /* DOMImplementationFront.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMImplementationFront.h; sourceTree = "<group>"; };
                93C841FE09CE858300DFF5E5 /* DOMImplementationFront.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMImplementationFront.cpp; sourceTree = "<group>"; };
                                0FC4E408187F82E10045882C /* ScrollingCoordinatorIOS.mm */,
                                0FC4E409187F82E10045882C /* ScrollingTreeIOS.cpp */,
                                0FC4E40A187F82E10045882C /* ScrollingTreeIOS.h */,
-                               0FC4E40B187F82E10045882C /* ScrollingTreeScrollingNodeIOS.h */,
-                               0FC4E40C187F82E10045882C /* ScrollingTreeScrollingNodeIOS.mm */,
+                               0FC4E40B187F82E10045882C /* ScrollingTreeFrameScrollingNodeIOS.h */,
+                               0FC4E40C187F82E10045882C /* ScrollingTreeFrameScrollingNodeIOS.mm */,
                        );
                        name = ios;
                        sourceTree = "<group>";
                                931CBD07161A44E900E4C874 /* ScrollingStateNode.h */,
                                931CBD08161A44E900E4C874 /* ScrollingStateScrollingNode.cpp */,
                                931CBD09161A44E900E4C874 /* ScrollingStateScrollingNode.h */,
+                               0FEA3E7A191B2FC5000F1B55 /* ScrollingStateFrameScrollingNode.cpp */,
+                               0FEA3E79191B2FC5000F1B55 /* ScrollingStateFrameScrollingNode.h */,
+                               0FEA3E81191B31BF000F1B55 /* ScrollingStateOverflowScrollingNode.cpp */,
+                               0FEA3E82191B31BF000F1B55 /* ScrollingStateOverflowScrollingNode.h */,
                                0FB8890C167D30160010CDA5 /* ScrollingStateStickyNode.cpp */,
                                0FB8890D167D30160010CDA5 /* ScrollingStateStickyNode.h */,
                                931CBD0A161A44E900E4C874 /* ScrollingStateTree.cpp */,
                                1AAADDA214DB409F00AF64B3 /* ScrollingTree.h */,
                                1AAADDE114DC8C8F00AF64B3 /* ScrollingTreeNode.cpp */,
                                1AAADDE214DC8C8F00AF64B3 /* ScrollingTreeNode.h */,
+                               0FEA3E85191B3BD7000F1B55 /* ScrollingTreeFrameScrollingNode.cpp */,
+                               0FEA3E86191B3BD7000F1B55 /* ScrollingTreeFrameScrollingNode.h */,
+                               0FEA3E7D191B3169000F1B55 /* ScrollingTreeOverflowScrollingNode.cpp */,
+                               0FEA3E7E191B3169000F1B55 /* ScrollingTreeOverflowScrollingNode.h */,
                                9391A99A1629D6FF00297330 /* ScrollingTreeScrollingNode.cpp */,
                                9391A99B1629D70000297330 /* ScrollingTreeScrollingNode.h */,
                                0F6383DB18615B29003E5DB5 /* ThreadedScrollingTree.cpp */,
                                9391A990162746CB00297330 /* ScrollingCoordinatorMac.h */,
                                1AF62EE314DA22A70041556C /* ScrollingCoordinatorMac.mm */,
                                931CBD12161A44F800E4C874 /* ScrollingStateNodeMac.mm */,
-                               0FA88EBC16A8D1BD00F99984 /* ScrollingStateScrollingNodeMac.mm */,
+                               0FA88EBC16A8D1BD00F99984 /* ScrollingStateFrameScrollingNodeMac.mm */,
                                1AF62F2314DAFE910041556C /* ScrollingThreadMac.mm */,
                                93C38C01164473DD00091EB2 /* ScrollingTreeFixedNode.h */,
                                93C38C02164473DD00091EB2 /* ScrollingTreeFixedNode.mm */,
-                               93C4A4131629DF5A00C3EB6E /* ScrollingTreeScrollingNodeMac.h */,
-                               93C4A4141629DF5A00C3EB6E /* ScrollingTreeScrollingNodeMac.mm */,
+                               93C4A4131629DF5A00C3EB6E /* ScrollingTreeFrameScrollingNodeMac.h */,
+                               93C4A4141629DF5A00C3EB6E /* ScrollingTreeFrameScrollingNodeMac.mm */,
                                0FB88908167D2FA10010CDA5 /* ScrollingTreeStickyNode.h */,
                                0FB88909167D2FA10010CDA5 /* ScrollingTreeStickyNode.mm */,
                        );
                                D72F6D7A153159A3001EE44E /* FlowThreadController.h in Headers */,
                                14993BE60B2F2B1C0050497F /* FocusController.h in Headers */,
                                062287840B4DB322000C34DF /* FocusDirection.h in Headers */,
+                               0FEA3E88191B3BD7000F1B55 /* ScrollingTreeFrameScrollingNode.h in Headers */,
                                B6D9D23514EABD260090D75E /* FocusEvent.h in Headers */,
                                B2C3DA610D006CD600EF6F26 /* Font.h in Headers */,
                                BCB92D4F1293550B00C8387F /* FontBaseline.h in Headers */,
                                FE80DA640E9C4703000D6F75 /* JSGeolocation.h in Headers */,
                                FE80DA660E9C4703000D6F75 /* JSGeoposition.h in Headers */,
                                0FDA7C1F188322FC00C954B5 /* JSGestureEvent.h in Headers */,
+                               0FEA3E80191B3169000F1B55 /* ScrollingTreeOverflowScrollingNode.h in Headers */,
                                8482B7521198CB6B00BFB005 /* JSHashChangeEvent.h in Headers */,
                                BC94D14F0C275C68006BC617 /* JSHistory.h in Headers */,
                                BC97E413109154FA0010D361 /* JSHTMLAllCollection.h in Headers */,
                                0FC4E410187F82E10045882C /* ScrollingTreeIOS.h in Headers */,
                                1AAADDE414DC8C8F00AF64B3 /* ScrollingTreeNode.h in Headers */,
                                9391A99D1629D70000297330 /* ScrollingTreeScrollingNode.h in Headers */,
-                               0FC4E411187F82E10045882C /* ScrollingTreeScrollingNodeIOS.h in Headers */,
-                               93C4A4151629DF5A00C3EB6E /* ScrollingTreeScrollingNodeMac.h in Headers */,
+                               0FC4E411187F82E10045882C /* ScrollingTreeFrameScrollingNodeIOS.h in Headers */,
+                               93C4A4151629DF5A00C3EB6E /* ScrollingTreeFrameScrollingNodeMac.h in Headers */,
                                0FB8890A167D2FA10010CDA5 /* ScrollingTreeStickyNode.h in Headers */,
                                93C09C860B0657AA005ABD4D /* ScrollTypes.h in Headers */,
                                BC6D6E2609AF943500F59759 /* ScrollView.h in Headers */,
                                081EBF3B0FD34F4100DA7559 /* SVGFilterBuilder.h in Headers */,
                                B2227A0C0D00BF220071B782 /* SVGFilterElement.h in Headers */,
                                B2227A0F0D00BF220071B782 /* SVGFilterPrimitiveStandardAttributes.h in Headers */,
+                               0FEA3E84191B31BF000F1B55 /* ScrollingStateOverflowScrollingNode.h in Headers */,
                                B2227A120D00BF220071B782 /* SVGFitToViewBox.h in Headers */,
                                B237C8A80D344D110013F707 /* SVGFontData.h in Headers */,
                                B2A1F2AB0CEF0ABF00442F6A /* SVGFontElement.h in Headers */,
                                6EBF0E5512A8929800DB1709 /* WebGLExtension.h in Headers */,
                                49C7B9CF1042D32F0009D447 /* WebGLFramebuffer.h in Headers */,
                                6E47E66110B7944B00B186C8 /* WebGLGetInfo.h in Headers */,
+                               0FEA3E7B191B2FC5000F1B55 /* ScrollingStateFrameScrollingNode.h in Headers */,
                                49FFBF3F11C93EE3006A7118 /* WebGLLayer.h in Headers */,
                                93F1D5BB12D532C400832BEC /* WebGLLoseContext.h in Headers */,
                                49C7B9D51042D32F0009D447 /* WebGLObject.h in Headers */,
                                85032DE00AA8C9BE007D3B7D /* DOMCSSPageRule.mm in Sources */,
                                858C382D0AA8E40500B187A4 /* DOMCSSPrimitiveValue.mm in Sources */,
                                85032DE20AA8C9BE007D3B7D /* DOMCSSRule.mm in Sources */,
+                               0FEA3E87191B3BD7000F1B55 /* ScrollingTreeFrameScrollingNode.cpp in Sources */,
                                85032DE40AA8C9BE007D3B7D /* DOMCSSRuleList.mm in Sources */,
                                85032DE60AA8C9BE007D3B7D /* DOMCSSStyleDeclaration.mm in Sources */,
                                85032DE80AA8C9BE007D3B7D /* DOMCSSStyleRule.mm in Sources */,
                                2E37DFDA12DBAFB800A6B233 /* DOMURL.cpp in Sources */,
                                CD9DE18117AAD6A400EA386D /* DOMURLMediaSource.cpp in Sources */,
                                BC1A37BF097C715F0019F3D8 /* DOMUtility.mm in Sources */,
+                               0FEA3E7C191B2FC5000F1B55 /* ScrollingStateFrameScrollingNode.cpp in Sources */,
                                15C770A5100D41CD005BA267 /* DOMValidityState.mm in Sources */,
                                31C0FF4A0E4CEFDD007D6FE5 /* DOMWebKitAnimationEvent.mm in Sources */,
                                3106037A143281CD00ABF4BA /* DOMWebKitCSSFilterValue.mm in Sources */,
                                B59DD6A611902A62007E9684 /* JSSQLStatementCallback.cpp in Sources */,
                                B59DD6AA11902A71007E9684 /* JSSQLStatementErrorCallback.cpp in Sources */,
                                514C76380CE9225E007EF3CD /* JSSQLTransaction.cpp in Sources */,
+                               0FEA3E7F191B3169000F1B55 /* ScrollingTreeOverflowScrollingNode.cpp in Sources */,
                                B59DD69E11902A42007E9684 /* JSSQLTransactionCallback.cpp in Sources */,
                                1AD2316E0CD269E700C1F194 /* JSSQLTransactionCustom.cpp in Sources */,
                                B59DD6A211902A52007E9684 /* JSSQLTransactionErrorCallback.cpp in Sources */,
                                B2FA3D4C0AB75A6F000E5AC4 /* JSSVGAnimatedRect.cpp in Sources */,
                                B2FA3D4E0AB75A6F000E5AC4 /* JSSVGAnimatedString.cpp in Sources */,
                                B2FA3D500AB75A6F000E5AC4 /* JSSVGAnimatedTransformList.cpp in Sources */,
+                               0FEA3E83191B31BF000F1B55 /* ScrollingStateOverflowScrollingNode.cpp in Sources */,
                                B2FA3D520AB75A6F000E5AC4 /* JSSVGAnimateElement.cpp in Sources */,
                                4496E39D1398136C003EE32A /* JSSVGAnimateMotionElement.cpp in Sources */,
                                B2FA3D540AB75A6F000E5AC4 /* JSSVGAnimateTransformElement.cpp in Sources */,
                                931CBD0C161A44E900E4C874 /* ScrollingStateNode.cpp in Sources */,
                                931CBD13161A44F800E4C874 /* ScrollingStateNodeMac.mm in Sources */,
                                931CBD0E161A44E900E4C874 /* ScrollingStateScrollingNode.cpp in Sources */,
-                               0FA88EBD16A8D1BD00F99984 /* ScrollingStateScrollingNodeMac.mm in Sources */,
+                               0FA88EBD16A8D1BD00F99984 /* ScrollingStateFrameScrollingNodeMac.mm in Sources */,
                                0FB8890E167D30160010CDA5 /* ScrollingStateStickyNode.cpp in Sources */,
                                931CBD10161A44E900E4C874 /* ScrollingStateTree.cpp in Sources */,
                                1AF62F2514DAFE9E0041556C /* ScrollingThread.cpp in Sources */,
                                0FC4E40F187F82E10045882C /* ScrollingTreeIOS.cpp in Sources */,
                                1AAADDE314DC8C8F00AF64B3 /* ScrollingTreeNode.cpp in Sources */,
                                9391A99C1629D70000297330 /* ScrollingTreeScrollingNode.cpp in Sources */,
-                               0FC4E412187F82E10045882C /* ScrollingTreeScrollingNodeIOS.mm in Sources */,
-                               93C4A4161629DF5A00C3EB6E /* ScrollingTreeScrollingNodeMac.mm in Sources */,
+                               0FC4E412187F82E10045882C /* ScrollingTreeFrameScrollingNodeIOS.mm in Sources */,
+                               93C4A4161629DF5A00C3EB6E /* ScrollingTreeFrameScrollingNodeMac.mm in Sources */,
                                0FB8890B167D2FA10010CDA5 /* ScrollingTreeStickyNode.mm in Sources */,
                                BC2441C40E8B65D00055320F /* ScrollView.cpp in Sources */,
                                E45390450EAFD637003695C8 /* ScrollViewIOS.mm in Sources */,
index 8283c1b..7fea9e8 100644 (file)
@@ -35,7 +35,8 @@
 #include "Page.h"
 #include "ScrollingConstraints.h"
 #include "ScrollingStateFixedNode.h"
-#include "ScrollingStateScrollingNode.h"
+#include "ScrollingStateFrameScrollingNode.h"
+#include "ScrollingStateOverflowScrollingNode.h"
 #include "ScrollingStateStickyNode.h"
 #include "ScrollingStateTree.h"
 
@@ -76,21 +77,21 @@ void AsyncScrollingCoordinator::frameViewLayoutUpdated(FrameView* frameView)
     if (!coordinatesScrollingForFrameView(frameView))
         return;
 
-    ScrollingStateScrollingNode* node = toScrollingStateScrollingNode(m_scrollingStateTree->stateNodeForID(frameView->scrollLayerID()));
+    ScrollingStateFrameScrollingNode* node = toScrollingStateFrameScrollingNode(m_scrollingStateTree->stateNodeForID(frameView->scrollLayerID()));
     if (!node)
         return;
 
     Scrollbar* verticalScrollbar = frameView->verticalScrollbar();
     Scrollbar* horizontalScrollbar = frameView->horizontalScrollbar();
-    setScrollbarPaintersFromScrollbarsForNode(verticalScrollbar, horizontalScrollbar, node);
-
+    node->setScrollbarPaintersFromScrollbars(verticalScrollbar, horizontalScrollbar);
+    
     node->setFrameScaleFactor(frameView->frame().frameScaleFactor());
     node->setHeaderHeight(frameView->headerHeight());
     node->setFooterHeight(frameView->footerHeight());
     node->setTopContentInset(frameView->topContentInset());
 
     node->setScrollOrigin(frameView->scrollOrigin());
-    node->setViewportSize(frameView->visibleContentRect().size());
+    node->setScrollableAreaSize(frameView->visibleContentRect().size());
     node->setTotalContentsSize(frameView->totalContentsSize());
 
     ScrollableAreaParameters scrollParameters;
@@ -131,7 +132,7 @@ void AsyncScrollingCoordinator::frameViewRootLayerDidChange(FrameView* frameView
 
     ScrollingCoordinator::frameViewRootLayerDidChange(frameView);
 
-    ScrollingStateScrollingNode* node = toScrollingStateScrollingNode(m_scrollingStateTree->stateNodeForID(frameView->scrollLayerID()));
+    ScrollingStateFrameScrollingNode* node = toScrollingStateFrameScrollingNode(m_scrollingStateTree->stateNodeForID(frameView->scrollLayerID()));
     node->setLayer(scrollLayerForFrameView(frameView));
     node->setCounterScrollingLayer(counterScrollingLayerForFrameView(frameView));
     node->setInsetClipLayer(insetClipLayerForFrameView(frameView));
@@ -327,15 +328,14 @@ void AsyncScrollingCoordinator::ensureRootStateNodeForFrameView(FrameView* frame
     attachToStateTree(FrameScrollingNode, frameView->scrollLayerID(), 0);
 }
 
-void AsyncScrollingCoordinator::updateScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry* scrollingGeometry)
+void AsyncScrollingCoordinator::updateFrameScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry* scrollingGeometry)
 {
-    ScrollingStateScrollingNode* node = toScrollingStateScrollingNode(m_scrollingStateTree->stateNodeForID(nodeID));
+    ScrollingStateFrameScrollingNode* node = toScrollingStateFrameScrollingNode(m_scrollingStateTree->stateNodeForID(nodeID));
     ASSERT(node);
     if (!node)
         return;
 
     node->setLayer(layer);
-    node->setScrolledContentsLayer(scrolledContentsLayer);
     node->setInsetClipLayer(insetClipLayer);
     node->setCounterScrollingLayer(counterScrollingLayer);
 
@@ -343,6 +343,25 @@ void AsyncScrollingCoordinator::updateScrollingNode(ScrollingNodeID nodeID, Grap
         node->setScrollOrigin(scrollingGeometry->scrollOrigin);
         node->setScrollPosition(scrollingGeometry->scrollPosition);
         node->setTotalContentsSize(scrollingGeometry->contentSize);
+        node->setScrollableAreaSize(scrollingGeometry->scrollableAreaSize);
+    }
+}
+    
+void AsyncScrollingCoordinator::updateOverflowScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, const ScrollingGeometry* scrollingGeometry)
+{
+    ScrollingStateOverflowScrollingNode* node = toScrollingStateOverflowScrollingNode(m_scrollingStateTree->stateNodeForID(nodeID));
+    ASSERT(node);
+    if (!node)
+        return;
+
+    node->setLayer(layer);
+    node->setScrolledContentsLayer(scrolledContentsLayer);
+    
+    if (scrollingGeometry) {
+        node->setScrollOrigin(scrollingGeometry->scrollOrigin);
+        node->setScrollPosition(scrollingGeometry->scrollPosition);
+        node->setTotalContentsSize(scrollingGeometry->contentSize);
+        node->setScrollableAreaSize(scrollingGeometry->scrollableAreaSize);
     }
 }
 
@@ -370,12 +389,6 @@ void AsyncScrollingCoordinator::updateViewportConstrainedNode(ScrollingNodeID no
     }
 }
 
-// FIXME: not sure if this belongs here.
-void AsyncScrollingCoordinator::setScrollbarPaintersFromScrollbarsForNode(Scrollbar* verticalScrollbar, Scrollbar* horizontalScrollbar, ScrollingStateScrollingNode* node)
-{
-    node->setScrollbarPaintersFromScrollbars(verticalScrollbar, horizontalScrollbar);
-}
-
 void AsyncScrollingCoordinator::setSynchronousScrollingReasons(SynchronousScrollingReasons reasons)
 {
     if (!m_scrollingStateTree->rootStateNode())
@@ -406,7 +419,7 @@ void AsyncScrollingCoordinator::updateMainFrameScrollLayerPosition()
 
 void AsyncScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView(FrameView* frameView)
 {
-    ScrollingStateScrollingNode* node = toScrollingStateScrollingNode(m_scrollingStateTree->stateNodeForID(frameView->scrollLayerID()));
+    ScrollingStateFrameScrollingNode* node = toScrollingStateFrameScrollingNode(m_scrollingStateTree->stateNodeForID(frameView->scrollLayerID()));
     if (!node)
         return;
     node->setWheelEventHandlerCount(computeCurrentWheelEventHandlerCount());
index 48cf099..5d5efc2 100644 (file)
@@ -85,9 +85,12 @@ private:
     virtual ScrollingNodeID attachToStateTree(ScrollingNodeType, ScrollingNodeID newNodeID, ScrollingNodeID parentID) override;
     virtual void detachFromStateTree(ScrollingNodeID) override;
     virtual void clearStateTree() override;
-
+    
     virtual void updateViewportConstrainedNode(ScrollingNodeID, const ViewportConstraints&, GraphicsLayer*) override;
-    virtual void updateScrollingNode(ScrollingNodeID, GraphicsLayer*, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry* = nullptr) override;
+    
+    virtual void updateFrameScrollingNode(ScrollingNodeID, GraphicsLayer* scrollLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry* = nullptr);
+    virtual void updateOverflowScrollingNode(ScrollingNodeID, GraphicsLayer* scrollLayer, GraphicsLayer* scrolledContentsLayer, const ScrollingGeometry* = nullptr);
+    
     virtual String scrollingStateTreeAsText() const override;
     virtual bool isRubberBandInProgress() const override;
     virtual void setScrollPinningBehavior(ScrollPinningBehavior) override;
@@ -103,9 +106,6 @@ private:
     void ensureRootStateNodeForFrameView(FrameView*);
     void updateMainFrameScrollLayerPosition();
 
-    // FIXME: move somewhere else?
-    void setScrollbarPaintersFromScrollbarsForNode(Scrollbar* verticalScrollbar, Scrollbar* horizontalScrollbar, ScrollingStateScrollingNode*);
-
     void updateScrollPositionAfterAsyncScrollTimerFired(Timer<AsyncScrollingCoordinator>*);
 
     Timer<AsyncScrollingCoordinator> m_updateNodeScrollPositionTimer;
index 445790d..358069b 100644 (file)
@@ -159,12 +159,14 @@ public:
     virtual void updateViewportConstrainedNode(ScrollingNodeID, const ViewportConstraints&, GraphicsLayer*) { }
 
     struct ScrollingGeometry {
-        IntSize contentSize;
+        FloatSize scrollableAreaSize;
+        FloatSize contentSize;
         FloatPoint scrollPosition;
         IntPoint scrollOrigin;
     };
 
-    virtual void updateScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*scrolledContentsLayer*/, GraphicsLayer* /*counterScrollingLayer*/, GraphicsLayer* /*insetClipLayer*/, const ScrollingGeometry* = nullptr) { }
+    virtual void updateFrameScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*counterScrollingLayer*/, GraphicsLayer* /*insetClipLayer*/, const ScrollingGeometry* = nullptr) { }
+    virtual void updateOverflowScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*scrolledContentsLayer*/, const ScrollingGeometry* = nullptr) { }
     virtual void syncChildPositions(const LayoutRect&) { }
     virtual String scrollingStateTreeAsText() const;
     virtual bool isRubberBandInProgress() const { return false; }
diff --git a/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp b/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp
new file mode 100644 (file)
index 0000000..3f3a4fa
--- /dev/null
@@ -0,0 +1,246 @@
+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ScrollingStateFrameScrollingNode.h"
+
+#if ENABLE(ASYNC_SCROLLING) || USE(COORDINATED_GRAPHICS)
+
+#include "ScrollingStateTree.h"
+#include "TextStream.h"
+#include <wtf/OwnPtr.h>
+
+namespace WebCore {
+
+PassOwnPtr<ScrollingStateFrameScrollingNode> ScrollingStateFrameScrollingNode::create(ScrollingStateTree& stateTree, ScrollingNodeID nodeID)
+{
+    return adoptPtr(new ScrollingStateFrameScrollingNode(stateTree, nodeID));
+}
+
+ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode(ScrollingStateTree& stateTree, ScrollingNodeID nodeID)
+    : ScrollingStateScrollingNode(stateTree, FrameScrollingNode, nodeID)
+#if PLATFORM(MAC)
+    , m_verticalScrollbarPainter(0)
+    , m_horizontalScrollbarPainter(0)
+#endif
+    , m_frameScaleFactor(1)
+    , m_wheelEventHandlerCount(0)
+    , m_synchronousScrollingReasons(0)
+    , m_behaviorForFixed(StickToDocumentBounds)
+    , m_headerHeight(0)
+    , m_footerHeight(0)
+    , m_requestedScrollPositionRepresentsProgrammaticScroll(false)
+    , m_topContentInset(0)
+{
+}
+
+ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode(const ScrollingStateFrameScrollingNode& stateNode, ScrollingStateTree& adoptiveTree)
+    : ScrollingStateScrollingNode(stateNode, adoptiveTree)
+#if PLATFORM(MAC)
+    , m_verticalScrollbarPainter(stateNode.verticalScrollbarPainter())
+    , m_horizontalScrollbarPainter(stateNode.horizontalScrollbarPainter())
+#endif
+    , m_nonFastScrollableRegion(stateNode.nonFastScrollableRegion())
+    , m_frameScaleFactor(stateNode.frameScaleFactor())
+    , m_wheelEventHandlerCount(stateNode.wheelEventHandlerCount())
+    , m_synchronousScrollingReasons(stateNode.synchronousScrollingReasons())
+    , m_behaviorForFixed(stateNode.scrollBehaviorForFixedElements())
+    , m_headerHeight(stateNode.headerHeight())
+    , m_footerHeight(stateNode.footerHeight())
+    , m_requestedScrollPosition(stateNode.requestedScrollPosition())
+    , m_requestedScrollPositionRepresentsProgrammaticScroll(stateNode.requestedScrollPositionRepresentsProgrammaticScroll())
+    , m_topContentInset(stateNode.topContentInset())
+{
+    if (hasChangedProperty(CounterScrollingLayer))
+        setCounterScrollingLayer(stateNode.counterScrollingLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
+
+    if (hasChangedProperty(InsetClipLayer))
+        setInsetClipLayer(stateNode.insetClipLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
+
+    if (hasChangedProperty(ContentShadowLayer))
+        setContentShadowLayer(stateNode.contentShadowLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
+
+    if (hasChangedProperty(HeaderLayer))
+        setHeaderLayer(stateNode.headerLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
+
+    if (hasChangedProperty(FooterLayer))
+        setFooterLayer(stateNode.footerLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
+}
+
+ScrollingStateFrameScrollingNode::~ScrollingStateFrameScrollingNode()
+{
+}
+
+PassOwnPtr<ScrollingStateNode> ScrollingStateFrameScrollingNode::clone(ScrollingStateTree& adoptiveTree)
+{
+    return adoptPtr(new ScrollingStateFrameScrollingNode(*this, adoptiveTree));
+}
+
+void ScrollingStateFrameScrollingNode::setFrameScaleFactor(float scaleFactor)
+{
+    if (m_frameScaleFactor == scaleFactor)
+        return;
+
+    m_frameScaleFactor = scaleFactor;
+
+    setPropertyChanged(FrameScaleFactor);
+}
+
+void ScrollingStateFrameScrollingNode::setNonFastScrollableRegion(const Region& nonFastScrollableRegion)
+{
+    if (m_nonFastScrollableRegion == nonFastScrollableRegion)
+        return;
+
+    m_nonFastScrollableRegion = nonFastScrollableRegion;
+    setPropertyChanged(NonFastScrollableRegion);
+}
+
+void ScrollingStateFrameScrollingNode::setWheelEventHandlerCount(unsigned wheelEventHandlerCount)
+{
+    if (m_wheelEventHandlerCount == wheelEventHandlerCount)
+        return;
+
+    m_wheelEventHandlerCount = wheelEventHandlerCount;
+    setPropertyChanged(WheelEventHandlerCount);
+}
+
+void ScrollingStateFrameScrollingNode::setSynchronousScrollingReasons(SynchronousScrollingReasons reasons)
+{
+    if (m_synchronousScrollingReasons == reasons)
+        return;
+
+    m_synchronousScrollingReasons = reasons;
+    setPropertyChanged(ReasonsForSynchronousScrolling);
+}
+
+void ScrollingStateFrameScrollingNode::setScrollBehaviorForFixedElements(ScrollBehaviorForFixedElements behaviorForFixed)
+{
+    if (m_behaviorForFixed == behaviorForFixed)
+        return;
+
+    m_behaviorForFixed = behaviorForFixed;
+    setPropertyChanged(BehaviorForFixedElements);
+}
+    
+void ScrollingStateFrameScrollingNode::setHeaderHeight(int headerHeight)
+{
+    if (m_headerHeight == headerHeight)
+        return;
+
+    m_headerHeight = headerHeight;
+    setPropertyChanged(HeaderHeight);
+}
+
+void ScrollingStateFrameScrollingNode::setFooterHeight(int footerHeight)
+{
+    if (m_footerHeight == footerHeight)
+        return;
+
+    m_footerHeight = footerHeight;
+    setPropertyChanged(FooterHeight);
+}
+
+void ScrollingStateFrameScrollingNode::setTopContentInset(float topContentInset)
+{
+    if (m_topContentInset == topContentInset)
+        return;
+
+    m_topContentInset = topContentInset;
+    setPropertyChanged(TopContentInset);
+}
+
+void ScrollingStateFrameScrollingNode::setCounterScrollingLayer(const LayerRepresentation& layerRepresentation)
+{
+    if (layerRepresentation == m_counterScrollingLayer)
+        return;
+    
+    m_counterScrollingLayer = layerRepresentation;
+    setPropertyChanged(CounterScrollingLayer);
+}
+
+void ScrollingStateFrameScrollingNode::setInsetClipLayer(const LayerRepresentation& layerRepresentation)
+{
+    if (layerRepresentation == m_insetClipLayer)
+        return;
+    
+    m_insetClipLayer = layerRepresentation;
+    setPropertyChanged(InsetClipLayer);
+}
+
+void ScrollingStateFrameScrollingNode::setContentShadowLayer(const LayerRepresentation& layerRepresentation)
+{
+    if (layerRepresentation == m_contentShadowLayer)
+        return;
+    
+    m_contentShadowLayer = layerRepresentation;
+    setPropertyChanged(ContentShadowLayer);
+}
+
+void ScrollingStateFrameScrollingNode::setHeaderLayer(const LayerRepresentation& layerRepresentation)
+{
+    if (layerRepresentation == m_headerLayer)
+        return;
+    
+    m_headerLayer = layerRepresentation;
+    setPropertyChanged(HeaderLayer);
+}
+
+void ScrollingStateFrameScrollingNode::setFooterLayer(const LayerRepresentation& layerRepresentation)
+{
+    if (layerRepresentation == m_footerLayer)
+        return;
+    
+    m_footerLayer = layerRepresentation;
+    setPropertyChanged(FooterLayer);
+}
+
+#if !PLATFORM(MAC)
+void ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars(Scrollbar*, Scrollbar*)
+{
+}
+#endif
+
+void ScrollingStateFrameScrollingNode::dumpProperties(TextStream& ts, int indent) const
+{
+    ts << "(Frame scrolling node" << "\n";
+    
+    ScrollingStateScrollingNode::dumpProperties(ts, indent);
+    
+    if (m_frameScaleFactor != 1) {
+        writeIndent(ts, indent + 1);
+        ts << "(frame scale factor " << m_frameScaleFactor << ")\n";
+    }
+
+    if (m_synchronousScrollingReasons) {
+        writeIndent(ts, indent + 1);
+        ts << "(Scrolling on main thread because: " << ScrollingCoordinator::synchronousScrollingReasonsAsText(m_synchronousScrollingReasons) << ")\n";
+    }
+    
+    // FIXME: dump more properties.
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(ASYNC_SCROLLING) || USE(COORDINATED_GRAPHICS)
diff --git a/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h b/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h
new file mode 100644 (file)
index 0000000..52468ff
--- /dev/null
@@ -0,0 +1,154 @@
+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ScrollingStateFrameScrollingNode_h
+#define ScrollingStateFrameScrollingNode_h
+
+#if ENABLE(ASYNC_SCROLLING) || USE(COORDINATED_GRAPHICS)
+
+#include "Region.h"
+#include "ScrollTypes.h"
+#include "ScrollbarThemeComposite.h"
+#include "ScrollingCoordinator.h"
+#include "ScrollingStateScrollingNode.h"
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+class Scrollbar;
+
+class ScrollingStateFrameScrollingNode final : public ScrollingStateScrollingNode {
+public:
+    static PassOwnPtr<ScrollingStateFrameScrollingNode> create(ScrollingStateTree&, ScrollingNodeID);
+
+    virtual PassOwnPtr<ScrollingStateNode> clone(ScrollingStateTree&);
+
+    virtual ~ScrollingStateFrameScrollingNode();
+
+    enum ChangedProperty {
+        FrameScaleFactor = NumScrollingStateNodeBits,
+        NonFastScrollableRegion,
+        WheelEventHandlerCount,
+        ReasonsForSynchronousScrolling,
+        CounterScrollingLayer,
+        InsetClipLayer,
+        ContentShadowLayer,
+        HeaderHeight,
+        FooterHeight,
+        HeaderLayer,
+        FooterLayer,
+        PainterForScrollbar,
+        BehaviorForFixedElements,
+        TopContentInset
+    };
+
+    float frameScaleFactor() const { return m_frameScaleFactor; }
+    void setFrameScaleFactor(float);
+
+    const Region& nonFastScrollableRegion() const { return m_nonFastScrollableRegion; }
+    void setNonFastScrollableRegion(const Region&);
+
+    unsigned wheelEventHandlerCount() const { return m_wheelEventHandlerCount; }
+    void setWheelEventHandlerCount(unsigned);
+
+    SynchronousScrollingReasons synchronousScrollingReasons() const { return m_synchronousScrollingReasons; }
+    void setSynchronousScrollingReasons(SynchronousScrollingReasons);
+
+    ScrollBehaviorForFixedElements scrollBehaviorForFixedElements() const { return m_behaviorForFixed; }
+    void setScrollBehaviorForFixedElements(ScrollBehaviorForFixedElements);
+
+    int headerHeight() const { return m_headerHeight; }
+    void setHeaderHeight(int);
+
+    int footerHeight() const { return m_footerHeight; }
+    void setFooterHeight(int);
+
+    float topContentInset() const { return m_topContentInset; }
+    void setTopContentInset(float);
+    
+    // This is a layer moved in the opposite direction to scrolling, for example for background-attachment:fixed
+    const LayerRepresentation& counterScrollingLayer() const { return m_counterScrollingLayer; }
+    void setCounterScrollingLayer(const LayerRepresentation&);
+
+    // This is a clipping layer that will scroll with the page for all y-delta scroll values between 0
+    // and topContentInset(). Once the y-deltas get beyond the content inset point, this layer no longer
+    // needs to move. If the topContentInset() is 0, this layer does not need to move at all. This is
+    // only used on the Mac.
+    const LayerRepresentation& insetClipLayer() const { return m_insetClipLayer; }
+    void setInsetClipLayer(const LayerRepresentation&);
+
+    const LayerRepresentation& contentShadowLayer() const { return m_contentShadowLayer; }
+    void setContentShadowLayer(const LayerRepresentation&);
+
+    // The header and footer layers scroll vertically with the page, they should remain fixed when scrolling horizontally.
+    const LayerRepresentation& headerLayer() const { return m_headerLayer; }
+    void setHeaderLayer(const LayerRepresentation&);
+
+    // The header and footer layers scroll vertically with the page, they should remain fixed when scrolling horizontally.
+    const LayerRepresentation& footerLayer() const { return m_footerLayer; }
+    void setFooterLayer(const LayerRepresentation&);
+
+#if PLATFORM(MAC)
+    ScrollbarPainter verticalScrollbarPainter() const { return m_verticalScrollbarPainter.get(); }
+    ScrollbarPainter horizontalScrollbarPainter() const { return m_horizontalScrollbarPainter.get(); }
+#endif
+    void setScrollbarPaintersFromScrollbars(Scrollbar* verticalScrollbar, Scrollbar* horizontalScrollbar);
+
+    virtual void dumpProperties(TextStream&, int indent) const override;
+
+private:
+    ScrollingStateFrameScrollingNode(ScrollingStateTree&, ScrollingNodeID);
+    ScrollingStateFrameScrollingNode(const ScrollingStateFrameScrollingNode&, ScrollingStateTree&);
+
+    LayerRepresentation m_counterScrollingLayer;
+    LayerRepresentation m_insetClipLayer;
+    LayerRepresentation m_contentShadowLayer;
+    LayerRepresentation m_headerLayer;
+    LayerRepresentation m_footerLayer;
+
+#if PLATFORM(MAC)
+    RetainPtr<ScrollbarPainter> m_verticalScrollbarPainter;
+    RetainPtr<ScrollbarPainter> m_horizontalScrollbarPainter;
+#endif
+
+    Region m_nonFastScrollableRegion;
+    float m_frameScaleFactor;
+    unsigned m_wheelEventHandlerCount;
+    SynchronousScrollingReasons m_synchronousScrollingReasons;
+    ScrollBehaviorForFixedElements m_behaviorForFixed;
+    int m_headerHeight;
+    int m_footerHeight;
+    FloatPoint m_requestedScrollPosition;
+    bool m_requestedScrollPositionRepresentsProgrammaticScroll;
+    float m_topContentInset;
+};
+
+SCROLLING_STATE_NODE_TYPE_CASTS(ScrollingStateFrameScrollingNode, isFrameScrollingNode());
+
+} // namespace WebCore
+
+#endif // ENABLE(ASYNC_SCROLLING) || USE(COORDINATED_GRAPHICS)
+
+#endif // ScrollingStateFrameScrollingNode_h
index 203aa00..c90d159 100644 (file)
@@ -90,6 +90,11 @@ public:
         ASSERT(m_representation == PlatformLayerRepresentation);
         return m_platformLayer;
     }
+    
+    GraphicsLayer::PlatformLayerID layerID() const
+    {
+        return m_layerID;
+    }
 
     operator GraphicsLayer::PlatformLayerID() const
     {
@@ -156,6 +161,8 @@ public:
     bool isFixedNode() const { return m_nodeType == FixedNode; }
     bool isStickyNode() const { return m_nodeType == StickyNode; }
     bool isScrollingNode() const { return m_nodeType == FrameScrollingNode || m_nodeType == OverflowScrollingNode; }
+    bool isFrameScrollingNode() const { return m_nodeType == FrameScrollingNode; }
+    bool isOverflowScrollingNode() const { return m_nodeType == OverflowScrollingNode; }
 
     virtual PassOwnPtr<ScrollingStateNode> clone(ScrollingStateTree& adoptiveTree) = 0;
     PassOwnPtr<ScrollingStateNode> cloneAndReset(ScrollingStateTree& adoptiveTree);
diff --git a/Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.cpp b/Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.cpp
new file mode 100644 (file)
index 0000000..7ff4a37
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ScrollingStateOverflowScrollingNode.h"
+
+#if ENABLE(ASYNC_SCROLLING) || USE(COORDINATED_GRAPHICS)
+
+#include "ScrollingStateTree.h"
+#include "TextStream.h"
+#include <wtf/OwnPtr.h>
+
+namespace WebCore {
+
+PassOwnPtr<ScrollingStateOverflowScrollingNode> ScrollingStateOverflowScrollingNode::create(ScrollingStateTree& stateTree, ScrollingNodeID nodeID)
+{
+    return adoptPtr(new ScrollingStateOverflowScrollingNode(stateTree, nodeID));
+}
+
+ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode(ScrollingStateTree& stateTree, ScrollingNodeID nodeID)
+    : ScrollingStateScrollingNode(stateTree, OverflowScrollingNode, nodeID)
+{
+}
+
+ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode(const ScrollingStateOverflowScrollingNode& stateNode, ScrollingStateTree& adoptiveTree)
+    : ScrollingStateScrollingNode(stateNode, adoptiveTree)
+{
+    if (hasChangedProperty(ScrolledContentsLayer))
+        setScrolledContentsLayer(stateNode.scrolledContentsLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
+}
+
+ScrollingStateOverflowScrollingNode::~ScrollingStateOverflowScrollingNode()
+{
+}
+
+PassOwnPtr<ScrollingStateNode> ScrollingStateOverflowScrollingNode::clone(ScrollingStateTree& adoptiveTree)
+{
+    return adoptPtr(new ScrollingStateOverflowScrollingNode(*this, adoptiveTree));
+}
+    
+void ScrollingStateOverflowScrollingNode::setScrolledContentsLayer(const LayerRepresentation& layerRepresentation)
+{
+    if (layerRepresentation == m_scrolledContentsLayer)
+        return;
+    
+    m_scrolledContentsLayer = layerRepresentation;
+    setPropertyChanged(ScrolledContentsLayer);
+}
+
+void ScrollingStateOverflowScrollingNode::dumpProperties(TextStream& ts, int indent) const
+{
+    ts << "(" << "Overflow scrolling node" << "\n";
+    
+    ScrollingStateScrollingNode::dumpProperties(ts, indent);
+    
+    if (m_scrolledContentsLayer.layerID()) {
+        writeIndent(ts, indent + 1);
+        ts << "(scrolled contents layer " << m_scrolledContentsLayer.layerID() << ")\n";
+    }
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(ASYNC_SCROLLING) || USE(COORDINATED_GRAPHICS)
diff --git a/Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.h b/Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.h
new file mode 100644 (file)
index 0000000..0659b02
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ScrollingStateOverflowScrollingNode_h
+#define ScrollingStateOverflowScrollingNode_h
+
+#if ENABLE(ASYNC_SCROLLING) || USE(COORDINATED_GRAPHICS)
+
+#include "ScrollingStateScrollingNode.h"
+
+namespace WebCore {
+
+class ScrollingStateOverflowScrollingNode : public ScrollingStateScrollingNode {
+public:
+    static PassOwnPtr<ScrollingStateOverflowScrollingNode> create(ScrollingStateTree&, ScrollingNodeID);
+
+    virtual PassOwnPtr<ScrollingStateNode> clone(ScrollingStateTree&);
+
+    virtual ~ScrollingStateOverflowScrollingNode();
+
+    enum ChangedProperty {
+        ScrolledContentsLayer = NumScrollingStateNodeBits
+    };
+
+    // This is a layer with the contents that move.
+    const LayerRepresentation& scrolledContentsLayer() const { return m_scrolledContentsLayer; }
+    void setScrolledContentsLayer(const LayerRepresentation&);
+    
+    virtual void dumpProperties(TextStream&, int indent) const override;
+
+private:
+    ScrollingStateOverflowScrollingNode(ScrollingStateTree&, ScrollingNodeID);
+    ScrollingStateOverflowScrollingNode(const ScrollingStateOverflowScrollingNode&, ScrollingStateTree&);
+    
+    LayerRepresentation m_scrolledContentsLayer;    
+};
+
+SCROLLING_STATE_NODE_TYPE_CASTS(ScrollingStateOverflowScrollingNode, isOverflowScrollingNode());
+
+} // namespace WebCore
+
+#endif // ENABLE(ASYNC_SCROLLING) || USE(COORDINATED_GRAPHICS)
+
+#endif // ScrollingStateScrollingNode_h
index ef662fe..af3f372 100644 (file)
 
 namespace WebCore {
 
-PassOwnPtr<ScrollingStateScrollingNode> ScrollingStateScrollingNode::create(ScrollingStateTree& stateTree, ScrollingNodeType nodeType, ScrollingNodeID nodeID)
-{
-    return adoptPtr(new ScrollingStateScrollingNode(stateTree, nodeType, nodeID));
-}
-
 ScrollingStateScrollingNode::ScrollingStateScrollingNode(ScrollingStateTree& stateTree, ScrollingNodeType nodeType, ScrollingNodeID nodeID)
     : ScrollingStateNode(nodeType, stateTree, nodeID)
-#if PLATFORM(MAC)
-    , m_verticalScrollbarPainter(0)
-    , m_horizontalScrollbarPainter(0)
-#endif
-    , m_frameScaleFactor(1)
-    , m_wheelEventHandlerCount(0)
-    , m_synchronousScrollingReasons(0)
-    , m_behaviorForFixed(StickToDocumentBounds)
-    , m_headerHeight(0)
-    , m_footerHeight(0)
     , m_requestedScrollPositionRepresentsProgrammaticScroll(false)
-    , m_topContentInset(0)
 {
 }
 
 ScrollingStateScrollingNode::ScrollingStateScrollingNode(const ScrollingStateScrollingNode& stateNode, ScrollingStateTree& adoptiveTree)
     : ScrollingStateNode(stateNode, adoptiveTree)
-#if PLATFORM(MAC)
-    , m_verticalScrollbarPainter(stateNode.verticalScrollbarPainter())
-    , m_horizontalScrollbarPainter(stateNode.horizontalScrollbarPainter())
-#endif
-    , m_viewportSize(stateNode.viewportSize())
+    , m_scrollableAreaSize(stateNode.scrollableAreaSize())
     , m_totalContentsSize(stateNode.totalContentsSize())
     , m_scrollPosition(stateNode.scrollPosition())
+    , m_requestedScrollPosition(stateNode.requestedScrollPosition())
     , m_scrollOrigin(stateNode.scrollOrigin())
     , m_scrollableAreaParameters(stateNode.scrollableAreaParameters())
-    , m_nonFastScrollableRegion(stateNode.nonFastScrollableRegion())
-    , m_frameScaleFactor(stateNode.frameScaleFactor())
-    , m_wheelEventHandlerCount(stateNode.wheelEventHandlerCount())
-    , m_synchronousScrollingReasons(stateNode.synchronousScrollingReasons())
-    , m_behaviorForFixed(stateNode.scrollBehaviorForFixedElements())
-    , m_headerHeight(stateNode.headerHeight())
-    , m_footerHeight(stateNode.footerHeight())
-    , m_requestedScrollPosition(stateNode.requestedScrollPosition())
     , m_requestedScrollPositionRepresentsProgrammaticScroll(stateNode.requestedScrollPositionRepresentsProgrammaticScroll())
-    , m_topContentInset(stateNode.topContentInset())
 {
-    if (hasChangedProperty(ScrolledContentsLayer))
-        setScrolledContentsLayer(stateNode.scrolledContentsLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
-
-    if (hasChangedProperty(CounterScrollingLayer))
-        setCounterScrollingLayer(stateNode.counterScrollingLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
-
-    if (hasChangedProperty(InsetClipLayer))
-        setInsetClipLayer(stateNode.insetClipLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
-
-    if (hasChangedProperty(ContentShadowLayer))
-        setContentShadowLayer(stateNode.contentShadowLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
-
-    if (hasChangedProperty(HeaderLayer))
-        setHeaderLayer(stateNode.headerLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
-
-    if (hasChangedProperty(FooterLayer))
-        setFooterLayer(stateNode.footerLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
 }
 
 ScrollingStateScrollingNode::~ScrollingStateScrollingNode()
 {
 }
 
-PassOwnPtr<ScrollingStateNode> ScrollingStateScrollingNode::clone(ScrollingStateTree& adoptiveTree)
+void ScrollingStateScrollingNode::setScrollableAreaSize(const FloatSize& size)
 {
-    return adoptPtr(new ScrollingStateScrollingNode(*this, adoptiveTree));
-}
-
-void ScrollingStateScrollingNode::setViewportSize(const FloatSize& size)
-{
-    if (m_viewportSize == size)
+    if (m_scrollableAreaSize == size)
         return;
 
-    m_viewportSize = size;
-    setPropertyChanged(ViewportSize);
+    m_scrollableAreaSize = size;
+    setPropertyChanged(ScrollableAreaSize);
 }
 
-void ScrollingStateScrollingNode::setTotalContentsSize(const IntSize& totalContentsSize)
+void ScrollingStateScrollingNode::setTotalContentsSize(const FloatSize& totalContentsSize)
 {
     if (m_totalContentsSize == totalContentsSize)
         return;
@@ -151,52 +101,6 @@ void ScrollingStateScrollingNode::setScrollableAreaParameters(const ScrollableAr
     setPropertyChanged(ScrollableAreaParams);
 }
 
-void ScrollingStateScrollingNode::setFrameScaleFactor(float scaleFactor)
-{
-    if (m_frameScaleFactor == scaleFactor)
-        return;
-
-    m_frameScaleFactor = scaleFactor;
-
-    setPropertyChanged(FrameScaleFactor);
-}
-
-void ScrollingStateScrollingNode::setNonFastScrollableRegion(const Region& nonFastScrollableRegion)
-{
-    if (m_nonFastScrollableRegion == nonFastScrollableRegion)
-        return;
-
-    m_nonFastScrollableRegion = nonFastScrollableRegion;
-    setPropertyChanged(NonFastScrollableRegion);
-}
-
-void ScrollingStateScrollingNode::setWheelEventHandlerCount(unsigned wheelEventHandlerCount)
-{
-    if (m_wheelEventHandlerCount == wheelEventHandlerCount)
-        return;
-
-    m_wheelEventHandlerCount = wheelEventHandlerCount;
-    setPropertyChanged(WheelEventHandlerCount);
-}
-
-void ScrollingStateScrollingNode::setSynchronousScrollingReasons(SynchronousScrollingReasons reasons)
-{
-    if (m_synchronousScrollingReasons == reasons)
-        return;
-
-    m_synchronousScrollingReasons = reasons;
-    setPropertyChanged(ReasonsForSynchronousScrolling);
-}
-
-void ScrollingStateScrollingNode::setScrollBehaviorForFixedElements(ScrollBehaviorForFixedElements behaviorForFixed)
-{
-    if (m_behaviorForFixed == behaviorForFixed)
-        return;
-
-    m_behaviorForFixed = behaviorForFixed;
-    setPropertyChanged(BehaviorForFixedElements);
-}
-
 void ScrollingStateScrollingNode::setRequestedScrollPosition(const FloatPoint& requestedScrollPosition, bool representsProgrammaticScroll)
 {
     m_requestedScrollPosition = requestedScrollPosition;
@@ -204,105 +108,8 @@ void ScrollingStateScrollingNode::setRequestedScrollPosition(const FloatPoint& r
     setPropertyChanged(RequestedScrollPosition);
 }
 
-void ScrollingStateScrollingNode::setHeaderHeight(int headerHeight)
-{
-    if (m_headerHeight == headerHeight)
-        return;
-
-    m_headerHeight = headerHeight;
-    setPropertyChanged(HeaderHeight);
-}
-
-void ScrollingStateScrollingNode::setFooterHeight(int footerHeight)
-{
-    if (m_footerHeight == footerHeight)
-        return;
-
-    m_footerHeight = footerHeight;
-    setPropertyChanged(FooterHeight);
-}
-
-void ScrollingStateScrollingNode::setTopContentInset(float topContentInset)
-{
-    if (m_topContentInset == topContentInset)
-        return;
-
-    m_topContentInset = topContentInset;
-    setPropertyChanged(TopContentInset);
-}
-
-void ScrollingStateScrollingNode::setScrolledContentsLayer(const LayerRepresentation& layerRepresentation)
-{
-    if (layerRepresentation == m_scrolledContentsLayer)
-        return;
-    
-    m_scrolledContentsLayer = layerRepresentation;
-    setPropertyChanged(ScrolledContentsLayer);
-}
-
-void ScrollingStateScrollingNode::setCounterScrollingLayer(const LayerRepresentation& layerRepresentation)
-{
-    if (layerRepresentation == m_counterScrollingLayer)
-        return;
-    
-    m_counterScrollingLayer = layerRepresentation;
-    setPropertyChanged(CounterScrollingLayer);
-}
-
-void ScrollingStateScrollingNode::setInsetClipLayer(const LayerRepresentation& layerRepresentation)
-{
-    if (layerRepresentation == m_insetClipLayer)
-        return;
-    
-    m_insetClipLayer = layerRepresentation;
-    setPropertyChanged(InsetClipLayer);
-}
-
-void ScrollingStateScrollingNode::setContentShadowLayer(const LayerRepresentation& layerRepresentation)
-{
-    if (layerRepresentation == m_contentShadowLayer)
-        return;
-    
-    m_contentShadowLayer = layerRepresentation;
-    setPropertyChanged(ContentShadowLayer);
-}
-
-void ScrollingStateScrollingNode::setHeaderLayer(const LayerRepresentation& layerRepresentation)
-{
-    if (layerRepresentation == m_headerLayer)
-        return;
-    
-    m_headerLayer = layerRepresentation;
-    setPropertyChanged(HeaderLayer);
-}
-
-
-void ScrollingStateScrollingNode::setFooterLayer(const LayerRepresentation& layerRepresentation)
-{
-    if (layerRepresentation == m_footerLayer)
-        return;
-    
-    m_footerLayer = layerRepresentation;
-    setPropertyChanged(FooterLayer);
-}
-
-#if !PLATFORM(MAC)
-void ScrollingStateScrollingNode::setScrollbarPaintersFromScrollbars(Scrollbar*, Scrollbar*)
-{
-}
-#endif
-
 void ScrollingStateScrollingNode::dumpProperties(TextStream& ts, int indent) const
 {
-    ts << "(" << "Scrolling node" << "\n";
-
-    if (!m_viewportSize.isEmpty()) {
-        writeIndent(ts, indent + 1);
-        ts << "(viewport rect "
-            << TextStream::FormatNumberRespectingIntegers(m_viewportSize.width()) << " "
-            << TextStream::FormatNumberRespectingIntegers(m_viewportSize.height()) << ")\n";
-    }
-
     if (m_scrollPosition != FloatPoint()) {
         writeIndent(ts, indent + 1);
         ts << "(scroll position "
@@ -310,24 +117,25 @@ void ScrollingStateScrollingNode::dumpProperties(TextStream& ts, int indent) con
             << TextStream::FormatNumberRespectingIntegers(m_scrollPosition.y()) << ")\n";
     }
 
-    if (!m_totalContentsSize.isEmpty()) {
+    if (!m_scrollableAreaSize.isEmpty()) {
         writeIndent(ts, indent + 1);
-        ts << "(contents size " << m_totalContentsSize.width() << " " << m_totalContentsSize.height() << ")\n";
+        ts << "(scrollable area size "
+            << TextStream::FormatNumberRespectingIntegers(m_scrollableAreaSize.width()) << " "
+            << TextStream::FormatNumberRespectingIntegers(m_scrollableAreaSize.height()) << ")\n";
     }
 
-    if (m_frameScaleFactor != 1) {
-        writeIndent(ts, indent + 1);
-        ts << "(frame scale factor " << m_frameScaleFactor << ")\n";
-    }
-
-    if (m_synchronousScrollingReasons) {
+    if (!m_totalContentsSize.isEmpty()) {
         writeIndent(ts, indent + 1);
-        ts << "(Scrolling on main thread because: " << ScrollingCoordinator::synchronousScrollingReasonsAsText(m_synchronousScrollingReasons) << ")\n";
+        ts << "(contents size "
+            << TextStream::FormatNumberRespectingIntegers(m_totalContentsSize.width()) << " "
+            << TextStream::FormatNumberRespectingIntegers(m_totalContentsSize.height()) << ")\n";
     }
 
     if (m_requestedScrollPosition != IntPoint()) {
         writeIndent(ts, indent + 1);
-        ts << "(requested scroll position " << TextStream::FormatNumberRespectingIntegers(m_requestedScrollPosition.x()) << " " << TextStream::FormatNumberRespectingIntegers(m_requestedScrollPosition.y()) << ")\n";
+        ts << "(requested scroll position "
+            << TextStream::FormatNumberRespectingIntegers(m_requestedScrollPosition.x()) << " "
+            << TextStream::FormatNumberRespectingIntegers(m_requestedScrollPosition.y()) << ")\n";
     }
 
     if (m_scrollOrigin != IntPoint()) {
index c2ace2a..35ddffe 100644 (file)
 
 #if ENABLE(ASYNC_SCROLLING) || USE(COORDINATED_GRAPHICS)
 
-#include "GraphicsLayer.h"
-#include "IntRect.h"
-#include "Region.h"
 #include "ScrollTypes.h"
-#include "ScrollbarThemeComposite.h"
 #include "ScrollingCoordinator.h"
 #include "ScrollingStateNode.h"
 #include <wtf/PassOwnPtr.h>
 
 namespace WebCore {
 
-class Scrollbar;
-
-class ScrollingStateScrollingNode final : public ScrollingStateNode {
+class ScrollingStateScrollingNode : public ScrollingStateNode {
 public:
-    static PassOwnPtr<ScrollingStateScrollingNode> create(ScrollingStateTree&, ScrollingNodeType, ScrollingNodeID);
-
-    virtual PassOwnPtr<ScrollingStateNode> clone(ScrollingStateTree&);
-
     virtual ~ScrollingStateScrollingNode();
 
     enum ChangedProperty {
-        ViewportSize = NumStateNodeBits,
+        ScrollableAreaSize = NumStateNodeBits,
         TotalContentsSize,
         ScrollPosition,
         ScrollOrigin,
         ScrollableAreaParams,
-        FrameScaleFactor,
-        NonFastScrollableRegion,
-        WheelEventHandlerCount,
-        ReasonsForSynchronousScrolling,
         RequestedScrollPosition,
-        ScrolledContentsLayer,
-        CounterScrollingLayer,
-        InsetClipLayer,
-        ContentShadowLayer,
-        HeaderHeight,
-        FooterHeight,
-        HeaderLayer,
-        FooterLayer,
-        PainterForScrollbar,
-        BehaviorForFixedElements,
-        TopContentInset
+        NumScrollingStateNodeBits,
     };
 
-    const FloatSize& viewportSize() const { return m_viewportSize; }
-    void setViewportSize(const FloatSize&);
+    const FloatSize& scrollableAreaSize() const { return m_scrollableAreaSize; }
+    void setScrollableAreaSize(const FloatSize&);
 
-    const IntSize& totalContentsSize() const { return m_totalContentsSize; }
-    void setTotalContentsSize(const IntSize&);
+    const FloatSize& totalContentsSize() const { return m_totalContentsSize; }
+    void setTotalContentsSize(const FloatSize&);
 
     const FloatPoint& scrollPosition() const { return m_scrollPosition; }
     void setScrollPosition(const FloatPoint&);
@@ -85,103 +61,27 @@ public:
     const IntPoint& scrollOrigin() const { return m_scrollOrigin; }
     void setScrollOrigin(const IntPoint&);
 
-    float frameScaleFactor() const { return m_frameScaleFactor; }
-    void setFrameScaleFactor(float);
-
-    const Region& nonFastScrollableRegion() const { return m_nonFastScrollableRegion; }
-    void setNonFastScrollableRegion(const Region&);
-
-    unsigned wheelEventHandlerCount() const { return m_wheelEventHandlerCount; }
-    void setWheelEventHandlerCount(unsigned);
-
-    SynchronousScrollingReasons synchronousScrollingReasons() const { return m_synchronousScrollingReasons; }
-    void setSynchronousScrollingReasons(SynchronousScrollingReasons);
-
     const ScrollableAreaParameters& scrollableAreaParameters() const { return m_scrollableAreaParameters; }
     void setScrollableAreaParameters(const ScrollableAreaParameters& params);
 
-    ScrollBehaviorForFixedElements scrollBehaviorForFixedElements() const { return m_behaviorForFixed; }
-    void setScrollBehaviorForFixedElements(ScrollBehaviorForFixedElements);
-
     const FloatPoint& requestedScrollPosition() const { return m_requestedScrollPosition; }
     bool requestedScrollPositionRepresentsProgrammaticScroll() const { return m_requestedScrollPositionRepresentsProgrammaticScroll; }
     void setRequestedScrollPosition(const FloatPoint&, bool representsProgrammaticScroll);
     
-    int headerHeight() const { return m_headerHeight; }
-    void setHeaderHeight(int);
-
-    int footerHeight() const { return m_footerHeight; }
-    void setFooterHeight(int);
-
-    float topContentInset() const { return m_topContentInset; }
-    void setTopContentInset(float);
-
-    // This is a layer with the contents that move.
-    const LayerRepresentation& scrolledContentsLayer() const { return m_scrolledContentsLayer; }
-    void setScrolledContentsLayer(const LayerRepresentation&);
-
-    // This is a layer moved in the opposite direction to scrolling, for example for background-attachment:fixed
-    const LayerRepresentation& counterScrollingLayer() const { return m_counterScrollingLayer; }
-    void setCounterScrollingLayer(const LayerRepresentation&);
-
-    // This is a clipping layer that will scroll with the page for all y-delta scroll values between 0
-    // and topContentInset(). Once the y-deltas get beyond the content inset point, this layer no longer
-    // needs to move. If the topContentInset() is 0, this layer does not need to move at all. This is
-    // only used on the Mac.
-    const LayerRepresentation& insetClipLayer() const { return m_insetClipLayer; }
-    void setInsetClipLayer(const LayerRepresentation&);
-
-    const LayerRepresentation& contentShadowLayer() const { return m_contentShadowLayer; }
-    void setContentShadowLayer(const LayerRepresentation&);
-
-    // The header and footer layers scroll vertically with the page, they should remain fixed when scrolling horizontally.
-    const LayerRepresentation& headerLayer() const { return m_headerLayer; }
-    void setHeaderLayer(const LayerRepresentation&);
-
-    // The header and footer layers scroll vertically with the page, they should remain fixed when scrolling horizontally.
-    const LayerRepresentation& footerLayer() const { return m_footerLayer; }
-    void setFooterLayer(const LayerRepresentation&);
-
-#if PLATFORM(MAC)
-    ScrollbarPainter verticalScrollbarPainter() const { return m_verticalScrollbarPainter.get(); }
-    ScrollbarPainter horizontalScrollbarPainter() const { return m_horizontalScrollbarPainter.get(); }
-#endif
-    void setScrollbarPaintersFromScrollbars(Scrollbar* verticalScrollbar, Scrollbar* horizontalScrollbar);
-
     virtual void dumpProperties(TextStream&, int indent) const override;
-
-private:
+    
+protected:
     ScrollingStateScrollingNode(ScrollingStateTree&, ScrollingNodeType, ScrollingNodeID);
     ScrollingStateScrollingNode(const ScrollingStateScrollingNode&, ScrollingStateTree&);
-
-    LayerRepresentation m_scrolledContentsLayer;
-    LayerRepresentation m_counterScrollingLayer;
-    LayerRepresentation m_insetClipLayer;
-    LayerRepresentation m_contentShadowLayer;
-    LayerRepresentation m_headerLayer;
-    LayerRepresentation m_footerLayer;
-
-#if PLATFORM(MAC)
-    RetainPtr<ScrollbarPainter> m_verticalScrollbarPainter;
-    RetainPtr<ScrollbarPainter> m_horizontalScrollbarPainter;
-#endif
-
-    FloatSize m_viewportSize;
-    IntSize m_totalContentsSize;
+    
+private:
+    FloatSize m_scrollableAreaSize;
+    FloatSize m_totalContentsSize;
     FloatPoint m_scrollPosition;
+    FloatPoint m_requestedScrollPosition;
     IntPoint m_scrollOrigin;
-    
     ScrollableAreaParameters m_scrollableAreaParameters;
-    Region m_nonFastScrollableRegion;
-    float m_frameScaleFactor;
-    unsigned m_wheelEventHandlerCount;
-    SynchronousScrollingReasons m_synchronousScrollingReasons;
-    ScrollBehaviorForFixedElements m_behaviorForFixed;
-    int m_headerHeight;
-    int m_footerHeight;
-    FloatPoint m_requestedScrollPosition;
     bool m_requestedScrollPositionRepresentsProgrammaticScroll;
-    float m_topContentInset;
 };
 
 SCROLLING_STATE_NODE_TYPE_CASTS(ScrollingStateScrollingNode, isScrollingNode());
index 579e99b..7c024a7 100644 (file)
@@ -30,7 +30,8 @@
 
 #include "AsyncScrollingCoordinator.h"
 #include "ScrollingStateFixedNode.h"
-#include "ScrollingStateScrollingNode.h"
+#include "ScrollingStateFrameScrollingNode.h"
+#include "ScrollingStateOverflowScrollingNode.h"
 #include "ScrollingStateStickyNode.h"
 
 namespace WebCore {
@@ -86,7 +87,7 @@ ScrollingNodeID ScrollingStateTree::attachNode(ScrollingNodeType nodeType, Scrol
         // If we're resetting the root node, we should clear the HashMap and destroy the current children.
         clear();
 
-        setRootStateNode(ScrollingStateScrollingNode::create(*this, FrameScrollingNode, newNodeID));
+        setRootStateNode(ScrollingStateFrameScrollingNode::create(*this, newNodeID));
         newNode = rootStateNode();
         m_hasNewRootStateNode = true;
     } else {
@@ -107,9 +108,14 @@ ScrollingNodeID ScrollingStateTree::attachNode(ScrollingNodeType nodeType, Scrol
             parent->appendChild(stickyNode.release());
             break;
         }
-        case FrameScrollingNode:
+        case FrameScrollingNode: {
+            OwnPtr<ScrollingStateFrameScrollingNode> scrollingNode = ScrollingStateFrameScrollingNode::create(*this, newNodeID);
+            newNode = scrollingNode.get();
+            parent->appendChild(scrollingNode.release());
+            break;
+        }
         case OverflowScrollingNode: {
-            OwnPtr<ScrollingStateScrollingNode> scrollingNode = ScrollingStateScrollingNode::create(*this, nodeType, newNodeID);
+            OwnPtr<ScrollingStateOverflowScrollingNode> scrollingNode = ScrollingStateOverflowScrollingNode::create(*this, newNodeID);
             newNode = scrollingNode.get();
             parent->appendChild(scrollingNode.release());
             break;
@@ -147,7 +153,7 @@ PassOwnPtr<ScrollingStateTree> ScrollingStateTree::commit(LayerRepresentation::T
     treeStateClone->setPreferredLayerRepresentation(preferredLayerRepresentation);
 
     if (m_rootStateNode)
-        treeStateClone->setRootStateNode(static_pointer_cast<ScrollingStateScrollingNode>(m_rootStateNode->cloneAndReset(*treeStateClone)));
+        treeStateClone->setRootStateNode(static_pointer_cast<ScrollingStateFrameScrollingNode>(m_rootStateNode->cloneAndReset(*treeStateClone)));
 
     // Copy the IDs of the nodes that have been removed since the last commit into the clone.
     treeStateClone->m_nodesRemovedSinceLastCommit.swap(m_nodesRemovedSinceLastCommit);
index 17d54b1..d3f9e87 100644 (file)
@@ -28,7 +28,7 @@
 
 #if ENABLE(ASYNC_SCROLLING) || USE(COORDINATED_GRAPHICS)
 
-#include "ScrollingStateScrollingNode.h"
+#include "ScrollingStateFrameScrollingNode.h"
 #include <wtf/OwnPtr.h>
 #include <wtf/PassOwnPtr.h>
 #include <wtf/RefPtr.h>
@@ -49,7 +49,7 @@ public:
     static PassOwnPtr<ScrollingStateTree> create(AsyncScrollingCoordinator* = 0);
     ~ScrollingStateTree();
 
-    ScrollingStateScrollingNode* rootStateNode() const { return m_rootStateNode.get(); }
+    ScrollingStateFrameScrollingNode* rootStateNode() const { return m_rootStateNode.get(); }
     ScrollingStateNode* stateNodeForID(ScrollingNodeID);
 
     ScrollingNodeID attachNode(ScrollingNodeType, ScrollingNodeID, ScrollingNodeID parentID);
@@ -79,14 +79,14 @@ public:
 private:
     ScrollingStateTree(AsyncScrollingCoordinator*);
 
-    void setRootStateNode(PassOwnPtr<ScrollingStateScrollingNode> rootStateNode) { m_rootStateNode = rootStateNode; }
+    void setRootStateNode(PassOwnPtr<ScrollingStateFrameScrollingNode> rootStateNode) { m_rootStateNode = rootStateNode; }
     void addNode(ScrollingStateNode*);
     void removeNode(ScrollingStateNode*);
     void didRemoveNode(ScrollingNodeID);
 
     AsyncScrollingCoordinator* m_scrollingCoordinator;
     StateNodeMap m_stateNodeMap;
-    OwnPtr<ScrollingStateScrollingNode> m_rootStateNode;
+    OwnPtr<ScrollingStateFrameScrollingNode> m_rootStateNode;
     Vector<ScrollingNodeID> m_nodesRemovedSinceLastCommit;
     bool m_hasChangedProperties;
     bool m_hasNewRootStateNode;
index 1e1a196..d821cf7 100644 (file)
@@ -133,16 +133,16 @@ void ScrollingTree::commitNewTreeState(PassOwnPtr<ScrollingStateTree> scrollingS
     ScrollingStateScrollingNode* rootNode = scrollingStateTree->rootStateNode();
     if (rootNode
         && (rootStateNodeChanged
-            || rootNode->hasChangedProperty(ScrollingStateScrollingNode::WheelEventHandlerCount)
-            || rootNode->hasChangedProperty(ScrollingStateScrollingNode::NonFastScrollableRegion)
+            || rootNode->hasChangedProperty(ScrollingStateFrameScrollingNode::WheelEventHandlerCount)
+            || rootNode->hasChangedProperty(ScrollingStateFrameScrollingNode::NonFastScrollableRegion)
             || rootNode->hasChangedProperty(ScrollingStateNode::ScrollLayer))) {
         MutexLocker lock(m_mutex);
 
         if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateNode::ScrollLayer))
             m_mainFrameScrollPosition = FloatPoint();
-        if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateScrollingNode::WheelEventHandlerCount))
+        if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateFrameScrollingNode::WheelEventHandlerCount))
             m_hasWheelEventHandlers = scrollingStateTree->rootStateNode()->wheelEventHandlerCount();
-        if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateScrollingNode::NonFastScrollableRegion))
+        if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateFrameScrollingNode::NonFastScrollableRegion))
             m_nonFastScrollableRegion = scrollingStateTree->rootStateNode()->nonFastScrollableRegion();
     }
     
diff --git a/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp b/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp
new file mode 100644 (file)
index 0000000..f944cc3
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ScrollingTreeFrameScrollingNode.h"
+
+#if ENABLE(ASYNC_SCROLLING)
+
+#include "ScrollingStateTree.h"
+#include "ScrollingTree.h"
+
+namespace WebCore {
+
+ScrollingTreeFrameScrollingNode::ScrollingTreeFrameScrollingNode(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
+    : ScrollingTreeScrollingNode(scrollingTree, FrameScrollingNode, nodeID)
+    , m_frameScaleFactor(1)
+    , m_headerHeight(0)
+    , m_footerHeight(0)
+    , m_topContentInset(0)
+    , m_synchronousScrollingReasons(0)
+    , m_behaviorForFixed(StickToDocumentBounds)
+{
+}
+
+ScrollingTreeFrameScrollingNode::~ScrollingTreeFrameScrollingNode()
+{
+}
+
+void ScrollingTreeFrameScrollingNode::updateBeforeChildren(const ScrollingStateNode& stateNode)
+{
+    ScrollingTreeScrollingNode::updateBeforeChildren(stateNode);
+    
+    const ScrollingStateFrameScrollingNode& state = toScrollingStateFrameScrollingNode(stateNode);
+
+    if (state.hasChangedProperty(ScrollingStateFrameScrollingNode::FrameScaleFactor))
+        m_frameScaleFactor = state.frameScaleFactor();
+
+    if (state.hasChangedProperty(ScrollingStateFrameScrollingNode::ReasonsForSynchronousScrolling))
+        m_synchronousScrollingReasons = state.synchronousScrollingReasons();
+
+    if (state.hasChangedProperty(ScrollingStateFrameScrollingNode::HeaderHeight))
+        m_headerHeight = state.headerHeight();
+
+    if (state.hasChangedProperty(ScrollingStateFrameScrollingNode::FooterHeight))
+        m_footerHeight = state.footerHeight();
+
+    if (state.hasChangedProperty(ScrollingStateFrameScrollingNode::BehaviorForFixedElements))
+        m_behaviorForFixed = state.scrollBehaviorForFixedElements();
+
+    if (state.hasChangedProperty(ScrollingStateFrameScrollingNode::TopContentInset))
+        m_topContentInset = state.topContentInset();
+}
+    
+} // namespace WebCore
+
+#endif // ENABLE(ASYNC_SCROLLING)
diff --git a/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h b/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h
new file mode 100644 (file)
index 0000000..a9b3257
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ScrollingTreeFrameScrollingNode_h
+#define ScrollingTreeFrameScrollingNode_h
+
+#if ENABLE(ASYNC_SCROLLING)
+
+#include "ScrollingTreeScrollingNode.h"
+
+namespace WebCore {
+
+class PlatformWheelEvent;
+class ScrollingTree;
+class ScrollingStateScrollingNode;
+
+class ScrollingTreeFrameScrollingNode : public ScrollingTreeScrollingNode {
+public:
+    virtual ~ScrollingTreeFrameScrollingNode();
+
+    virtual void updateBeforeChildren(const ScrollingStateNode&) override;
+    
+    // FIXME: We should implement this when we support ScrollingTreeScrollingNodes as children.
+    virtual void parentScrollPositionDidChange(const FloatRect& /*viewportRect*/, const FloatSize& /*cumulativeDelta*/) override { }
+
+    virtual void handleWheelEvent(const PlatformWheelEvent&) = 0;
+    virtual void setScrollPosition(const FloatPoint&) = 0;
+    virtual void setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&) = 0;
+
+    virtual void updateLayersAfterViewportChange(const FloatRect& viewportRect, double scale) = 0;
+    virtual void updateLayersAfterDelegatedScroll(const FloatPoint&) { }
+
+    SynchronousScrollingReasons synchronousScrollingReasons() const { return m_synchronousScrollingReasons; }
+    bool shouldUpdateScrollLayerPositionSynchronously() const { return m_synchronousScrollingReasons; }
+
+protected:
+    ScrollingTreeFrameScrollingNode(ScrollingTree&, ScrollingNodeID);
+
+    float frameScaleFactor() const { return m_frameScaleFactor; }
+    int headerHeight() const { return m_headerHeight; }
+    int footerHeight() const { return m_footerHeight; }
+    float topContentInset() const { return m_topContentInset; }
+    
+    ScrollBehaviorForFixedElements scrollBehaviorForFixedElements() const { return m_behaviorForFixed; }
+    
+private:
+    float m_frameScaleFactor;
+
+    int m_headerHeight;
+    int m_footerHeight;
+    float m_topContentInset;
+    
+    SynchronousScrollingReasons m_synchronousScrollingReasons;
+    ScrollBehaviorForFixedElements m_behaviorForFixed;
+};
+
+SCROLLING_NODE_TYPE_CASTS(ScrollingTreeFrameScrollingNode, isFrameScrollingNode());
+
+} // namespace WebCore
+
+#endif // ENABLE(ASYNC_SCROLLING)
+
+#endif // ScrollingTreeScrollingNode_h
index 5f0ddb1..6ad47ae 100644 (file)
@@ -49,6 +49,8 @@ public:
     bool isFixedNode() const { return nodeType() == FixedNode; }
     bool isStickyNode() const { return nodeType() == StickyNode; }
     bool isScrollingNode() const { return nodeType() == FrameScrollingNode || nodeType() == OverflowScrollingNode; }
+    bool isFrameScrollingNode() const { return nodeType() == FrameScrollingNode; }
+    bool isOverflowScrollingNode() const { return nodeType() == OverflowScrollingNode; }
 
     virtual void updateBeforeChildren(const ScrollingStateNode&) = 0;
     virtual void updateAfterChildren(const ScrollingStateNode&) { }
diff --git a/Source/WebCore/page/scrolling/ScrollingTreeOverflowScrollingNode.cpp b/Source/WebCore/page/scrolling/ScrollingTreeOverflowScrollingNode.cpp
new file mode 100644 (file)
index 0000000..013e350
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ScrollingTreeOverflowScrollingNode.h"
+
+#if ENABLE(ASYNC_SCROLLING)
+
+#include "ScrollingStateTree.h"
+#include "ScrollingTree.h"
+
+namespace WebCore {
+
+ScrollingTreeOverflowScrollingNode::ScrollingTreeOverflowScrollingNode(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
+    : ScrollingTreeScrollingNode(scrollingTree, OverflowScrollingNode, nodeID)
+{
+}
+
+ScrollingTreeOverflowScrollingNode::~ScrollingTreeOverflowScrollingNode()
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(ASYNC_SCROLLING)
diff --git a/Source/WebCore/page/scrolling/ScrollingTreeOverflowScrollingNode.h b/Source/WebCore/page/scrolling/ScrollingTreeOverflowScrollingNode.h
new file mode 100644 (file)
index 0000000..f51885f
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ScrollingTreeOverflowScrollingNode_h
+#define ScrollingTreeOverflowScrollingNode_h
+
+#if ENABLE(ASYNC_SCROLLING)
+
+#include "ScrollingTreeScrollingNode.h"
+
+namespace WebCore {
+
+class ScrollingTreeOverflowScrollingNode : public ScrollingTreeScrollingNode {
+public:
+    virtual ~ScrollingTreeOverflowScrollingNode();
+
+    
+protected:
+    ScrollingTreeOverflowScrollingNode(ScrollingTree&, ScrollingNodeID);
+};
+
+SCROLLING_NODE_TYPE_CASTS(ScrollingTreeOverflowScrollingNode, isOverflowScrollingNode());
+
+} // namespace WebCore
+
+#endif // ENABLE(ASYNC_SCROLLING)
+
+#endif // ScrollingTreeOverflowScrollingNode_h
index 6169d33..cf8375c 100644 (file)
@@ -35,12 +35,6 @@ namespace WebCore {
 
 ScrollingTreeScrollingNode::ScrollingTreeScrollingNode(ScrollingTree& scrollingTree, ScrollingNodeType nodeType, ScrollingNodeID nodeID)
     : ScrollingTreeNode(scrollingTree, nodeType, nodeID)
-    , m_frameScaleFactor(1)
-    , m_headerHeight(0)
-    , m_footerHeight(0)
-    , m_synchronousScrollingReasons(0)
-    , m_behaviorForFixed(StickToDocumentBounds)
-    , m_topContentInset(0)
 {
 }
 
@@ -52,14 +46,15 @@ void ScrollingTreeScrollingNode::updateBeforeChildren(const ScrollingStateNode&
 {
     const ScrollingStateScrollingNode& state = toScrollingStateScrollingNode(stateNode);
 
-    if (state.hasChangedProperty(ScrollingStateScrollingNode::ViewportSize))
-        m_viewportSize = state.viewportSize();
+    if (state.hasChangedProperty(ScrollingStateScrollingNode::ScrollableAreaSize))
+        m_scrollableAreaSize = state.scrollableAreaSize();
 
     if (state.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize)) {
         if (scrollingTree().isRubberBandInProgress())
             m_totalContentsSizeForRubberBand = m_totalContentsSize;
         else
             m_totalContentsSizeForRubberBand = state.totalContentsSize();
+
         m_totalContentsSize = state.totalContentsSize();
     }
 
@@ -71,33 +66,42 @@ void ScrollingTreeScrollingNode::updateBeforeChildren(const ScrollingStateNode&
 
     if (state.hasChangedProperty(ScrollingStateScrollingNode::ScrollableAreaParams))
         m_scrollableAreaParameters = state.scrollableAreaParameters();
+}
 
-    if (state.hasChangedProperty(ScrollingStateScrollingNode::FrameScaleFactor))
-        m_frameScaleFactor = state.frameScaleFactor();
-
-    if (state.hasChangedProperty(ScrollingStateScrollingNode::ReasonsForSynchronousScrolling))
-        m_synchronousScrollingReasons = state.synchronousScrollingReasons();
+void ScrollingTreeScrollingNode::updateAfterChildren(const ScrollingStateNode& stateNode)
+{
+    const ScrollingStateScrollingNode& scrollingStateNode = toScrollingStateScrollingNode(stateNode);
+    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition))
+        scrollingTree().scrollingTreeNodeRequestsScroll(scrollingNodeID(), scrollingStateNode.requestedScrollPosition(), scrollingStateNode.requestedScrollPositionRepresentsProgrammaticScroll());
+}
 
-    if (state.hasChangedProperty(ScrollingStateScrollingNode::HeaderHeight))
-        m_headerHeight = state.headerHeight();
+void ScrollingTreeScrollingNode::setScrollPosition(const FloatPoint& scrollPosition)
+{
+    FloatPoint newScrollPosition = scrollPosition;
+    newScrollPosition = newScrollPosition.shrunkTo(maximumScrollPosition());
+    newScrollPosition = newScrollPosition.expandedTo(minimumScrollPosition());
 
-    if (state.hasChangedProperty(ScrollingStateScrollingNode::FooterHeight))
-        m_footerHeight = state.footerHeight();
+    setScrollPositionWithoutContentEdgeConstraints(newScrollPosition);
+}
 
-    if (state.hasChangedProperty(ScrollingStateScrollingNode::BehaviorForFixedElements))
-        m_behaviorForFixed = state.scrollBehaviorForFixedElements();
+void ScrollingTreeScrollingNode::setScrollPositionWithoutContentEdgeConstraints(const FloatPoint& scrollPosition)
+{
+    setScrollLayerPosition(scrollPosition);
+    scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition);
+}
 
-    if (state.hasChangedProperty(ScrollingStateScrollingNode::TopContentInset))
-        m_topContentInset = state.topContentInset();
+FloatPoint ScrollingTreeScrollingNode::minimumScrollPosition() const
+{
+    return FloatPoint();
 }
 
-void ScrollingTreeScrollingNode::updateAfterChildren(const ScrollingStateNode& stateNode)
+FloatPoint ScrollingTreeScrollingNode::maximumScrollPosition() const
 {
-    const ScrollingStateScrollingNode& scrollingStateNode = toScrollingStateScrollingNode(stateNode);
-    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition))
-        scrollingTree().scrollingTreeNodeRequestsScroll(scrollingNodeID(), scrollingStateNode.requestedScrollPosition(), scrollingStateNode.requestedScrollPositionRepresentsProgrammaticScroll());
+    FloatPoint contentSizePoint(totalContentsSize());
+    return FloatPoint(contentSizePoint - scrollableAreaSize()).expandedTo(FloatPoint());
 }
 
+
 } // namespace WebCore
 
 #endif // ENABLE(ASYNC_SCROLLING)
index 49bf8f7..6feecfc 100644 (file)
@@ -36,7 +36,6 @@
 
 namespace WebCore {
 
-class PlatformWheelEvent;
 class ScrollingTree;
 class ScrollingStateScrollingNode;
 
@@ -51,30 +50,30 @@ public:
     virtual void parentScrollPositionDidChange(const FloatRect& /*viewportRect*/, const FloatSize& /*cumulativeDelta*/) override { }
 
     virtual void handleWheelEvent(const PlatformWheelEvent&) = 0;
-    virtual void setScrollPosition(const FloatPoint&) = 0;
-    virtual void setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&) = 0;
+    virtual void setScrollPosition(const FloatPoint&);
+    virtual void setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&);
 
     virtual void updateLayersAfterViewportChange(const FloatRect& viewportRect, double scale) = 0;
     virtual void updateLayersAfterDelegatedScroll(const FloatPoint&) { }
 
-    SynchronousScrollingReasons synchronousScrollingReasons() const { return m_synchronousScrollingReasons; }
-    bool shouldUpdateScrollLayerPositionSynchronously() const { return m_synchronousScrollingReasons; }
-
 protected:
     ScrollingTreeScrollingNode(ScrollingTree&, ScrollingNodeType, ScrollingNodeID);
 
+    virtual FloatPoint minimumScrollPosition() const;
+    virtual FloatPoint maximumScrollPosition() const;
+
+    virtual void setScrollLayerPosition(const FloatPoint&) = 0;
+
     const FloatPoint& scrollPosition() const { return m_scrollPosition; }
-    const FloatSize& viewportSize() const { return m_viewportSize; }
-    const IntSize& totalContentsSize() const { return m_totalContentsSize; }
+    const FloatSize& scrollableAreaSize() const { return m_scrollableAreaSize; }
+    const FloatSize& totalContentsSize() const { return m_totalContentsSize; }
     const IntPoint& scrollOrigin() const { return m_scrollOrigin; }
 
     // If the totalContentsSize changes in the middle of a rubber-band, we still want to use the old totalContentsSize for the sake of
     // computing the stretchAmount(). Using the old value will keep the animation smooth. When there is no rubber-band in progress at
     // all, m_totalContentsSizeForRubberBand should be equivalent to m_totalContentsSize.
-    const IntSize& totalContentsSizeForRubberBand() const { return m_totalContentsSizeForRubberBand; }
-    void setTotalContentsSizeForRubberBand(const IntSize& totalContentsSizeForRubberBand) { m_totalContentsSizeForRubberBand = totalContentsSizeForRubberBand; }
-
-    float frameScaleFactor() const { return m_frameScaleFactor; }
+    const FloatSize& totalContentsSizeForRubberBand() const { return m_totalContentsSizeForRubberBand; }
+    void setTotalContentsSizeForRubberBand(const FloatSize& totalContentsSizeForRubberBand) { m_totalContentsSizeForRubberBand = totalContentsSizeForRubberBand; }
 
     ScrollElasticity horizontalScrollElasticity() const { return m_scrollableAreaParameters.horizontalScrollElasticity; }
     ScrollElasticity verticalScrollElasticity() const { return m_scrollableAreaParameters.verticalScrollElasticity; }
@@ -84,31 +83,14 @@ protected:
 
     bool canHaveScrollbars() const { return m_scrollableAreaParameters.horizontalScrollbarMode != ScrollbarAlwaysOff || m_scrollableAreaParameters.verticalScrollbarMode != ScrollbarAlwaysOff; }
 
-    int headerHeight() const { return m_headerHeight; }
-    int footerHeight() const { return m_footerHeight; }
-
-    ScrollBehaviorForFixedElements scrollBehaviorForFixedElements() const { return m_behaviorForFixed; }
-
-    float topContentInset() const { return m_topContentInset; }
-
 private:
-    FloatSize m_viewportSize;
-    IntSize m_totalContentsSize;
-    IntSize m_totalContentsSizeForRubberBand;
+    FloatSize m_scrollableAreaSize;
+    FloatSize m_totalContentsSize;
+    FloatSize m_totalContentsSizeForRubberBand;
     FloatPoint m_scrollPosition;
     IntPoint m_scrollOrigin;
     
     ScrollableAreaParameters m_scrollableAreaParameters;
-    
-    float m_frameScaleFactor;
-
-    int m_headerHeight;
-    int m_footerHeight;
-
-    SynchronousScrollingReasons m_synchronousScrollingReasons;
-    ScrollBehaviorForFixedElements m_behaviorForFixed;
-
-    float m_topContentInset;
 };
 
 SCROLLING_NODE_TYPE_CASTS(ScrollingTreeScrollingNode, isScrollingNode());
index 4680116..5fc2977 100644 (file)
@@ -36,7 +36,7 @@
 #include "ScrollingStateTree.h"
 #include "ScrollingThread.h"
 #include "ScrollingTreeFixedNode.h"
-#include "ScrollingTreeScrollingNodeIOS.h"
+#include "ScrollingTreeFrameScrollingNodeIOS.h"
 #include "ScrollingTreeStickyNode.h"
 #include "ScrollingTreeIOS.h"
 #include <wtf/Functional.h>
@@ -110,8 +110,10 @@ PassOwnPtr<ScrollingTreeNode> ScrollingCoordinatorIOS::createScrollingTreeNode(S
 
     switch (nodeType) {
     case FrameScrollingNode:
+        return ScrollingTreeFrameScrollingNodeIOS::create(*scrollingTree(), nodeID);
     case OverflowScrollingNode:
-        return ScrollingTreeScrollingNodeIOS::create(*scrollingTree(), nodeType, nodeID);
+        ASSERT_NOT_REACHED();
+        return nullptr;
     case FixedNode:
         return ScrollingTreeFixedNode::create(*scrollingTree(), nodeID);
     case StickyNode:
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef ScrollingTreeScrollingNodeIOS_h
-#define ScrollingTreeScrollingNodeIOS_h
+#ifndef ScrollingTreeFrameScrollingNodeIOS_h
+#define ScrollingTreeFrameScrollingNodeIOS_h
 
-#if ENABLE(ASYNC_SCROLLING)
+#if ENABLE(ASYNC_SCROLLING) && PLATFORM(IOS)
 
-#include "ScrollingTreeScrollingNode.h"
+#include "ScrollingTreeFrameScrollingNode.h"
 #include <wtf/RetainPtr.h>
 
 OBJC_CLASS CALayer;
 
 namespace WebCore {
 
-class ScrollingTreeScrollingNodeIOS : public ScrollingTreeScrollingNode {
+class ScrollingTreeFrameScrollingNodeIOS : public ScrollingTreeFrameScrollingNode {
 public:
-    static PassOwnPtr<ScrollingTreeScrollingNode> create(ScrollingTree&, ScrollingNodeType, ScrollingNodeID);
-    virtual ~ScrollingTreeScrollingNodeIOS();
+    static PassOwnPtr<ScrollingTreeFrameScrollingNodeIOS> create(ScrollingTree&, ScrollingNodeID);
+    virtual ~ScrollingTreeFrameScrollingNodeIOS();
 
 protected:
-    ScrollingTreeScrollingNodeIOS(ScrollingTree&, ScrollingNodeType, ScrollingNodeID);
+    ScrollingTreeFrameScrollingNodeIOS(ScrollingTree&, ScrollingNodeID);
 
     // ScrollingTreeNode member functions.
     virtual void updateBeforeChildren(const ScrollingStateNode&) override;
     virtual void updateAfterChildren(const ScrollingStateNode&) override;
     virtual void handleWheelEvent(const PlatformWheelEvent&) override { }
 
-    CALayer *scrollLayer() const { return m_scrollLayer.get(); }
-
     FloatPoint scrollPosition() const;
     virtual void setScrollPosition(const FloatPoint&) override;
     virtual void setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&) override;
@@ -57,7 +55,7 @@ protected:
     virtual void updateLayersAfterViewportChange(const FloatRect& viewportRect, double scale);
     virtual void updateLayersAfterDelegatedScroll(const FloatPoint&) override;
 
-    void setScrollLayerPosition(const FloatPoint&);
+    virtual void setScrollLayerPosition(const FloatPoint&) override;
 
     FloatPoint minimumScrollPosition() const;
     FloatPoint maximumScrollPosition() const;
@@ -67,9 +65,9 @@ protected:
 
 private:
     void updateChildNodesAfterScroll(const FloatPoint&);
+    CALayer *scrollLayer() const { return m_scrollLayer.get(); }
 
     RetainPtr<CALayer> m_scrollLayer;
-    RetainPtr<CALayer> m_scrolledContentsLayer;
     RetainPtr<CALayer> m_counterScrollingLayer;
     RetainPtr<CALayer> m_headerLayer;
     RetainPtr<CALayer> m_footerLayer;
@@ -78,6 +76,6 @@ private:
 
 } // namespace WebCore
 
-#endif // ENABLE(ASYNC_SCROLLING)
+#endif // ENABLE(ASYNC_SCROLLING) && PLATFORM(IOS)
 
-#endif // ScrollingTreeScrollingNodeIOS_h
+#endif // ScrollingTreeFrameScrollingNodeIOS_h
@@ -24,7 +24,7 @@
  */
 
 #import "config.h"
-#import "ScrollingTreeScrollingNodeIOS.h"
+#import "ScrollingTreeFrameScrollingNodeIOS.h"
 
 #if ENABLE(ASYNC_SCROLLING)
 
 
 namespace WebCore {
 
-PassOwnPtr<ScrollingTreeScrollingNode> ScrollingTreeScrollingNodeIOS::create(ScrollingTree& scrollingTree, ScrollingNodeType nodeType, ScrollingNodeID nodeID)
+PassOwnPtr<ScrollingTreeFrameScrollingNodeIOS> ScrollingTreeFrameScrollingNodeIOS::create(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
 {
-    return adoptPtr(new ScrollingTreeScrollingNodeIOS(scrollingTree, nodeType, nodeID));
+    return adoptPtr(new ScrollingTreeFrameScrollingNodeIOS(scrollingTree, nodeID));
 }
 
-ScrollingTreeScrollingNodeIOS::ScrollingTreeScrollingNodeIOS(ScrollingTree& scrollingTree, ScrollingNodeType nodeType, ScrollingNodeID nodeID)
-    : ScrollingTreeScrollingNode(scrollingTree, nodeType, nodeID)
+ScrollingTreeFrameScrollingNodeIOS::ScrollingTreeFrameScrollingNodeIOS(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
+    : ScrollingTreeFrameScrollingNode(scrollingTree, nodeID)
 {
 }
 
-ScrollingTreeScrollingNodeIOS::~ScrollingTreeScrollingNodeIOS()
+ScrollingTreeFrameScrollingNodeIOS::~ScrollingTreeFrameScrollingNodeIOS()
 {
 }
 
-void ScrollingTreeScrollingNodeIOS::updateBeforeChildren(const ScrollingStateNode& stateNode)
+void ScrollingTreeFrameScrollingNodeIOS::updateBeforeChildren(const ScrollingStateNode& stateNode)
 {
-    ScrollingTreeScrollingNode::updateBeforeChildren(stateNode);
-    const auto& scrollingStateNode = toScrollingStateScrollingNode(stateNode);
+    ScrollingTreeFrameScrollingNode::updateBeforeChildren(stateNode);
+    
+    const auto& scrollingStateNode = toScrollingStateFrameScrollingNode(stateNode);
 
     if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::ScrollLayer))
         m_scrollLayer = scrollingStateNode.layer();
 
-    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer))
-        m_scrolledContentsLayer = scrollingStateNode.scrolledContentsLayer();
-
-    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::CounterScrollingLayer))
+    if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer))
         m_counterScrollingLayer = scrollingStateNode.counterScrollingLayer();
 
-    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::HeaderLayer))
+    if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::HeaderLayer))
         m_headerLayer = scrollingStateNode.headerLayer();
 
-    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::FooterLayer))
+    if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::FooterLayer))
         m_footerLayer = scrollingStateNode.footerLayer();
 
-    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ReasonsForSynchronousScrolling)) {
+    if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::ReasonsForSynchronousScrolling)) {
         if (shouldUpdateScrollLayerPositionSynchronously()) {
             // We're transitioning to the slow "update scroll layer position on the main thread" mode.
             // Initialize the probable main thread scroll position with the current scroll layer position.
@@ -88,18 +86,18 @@ void ScrollingTreeScrollingNodeIOS::updateBeforeChildren(const ScrollingStateNod
     }
 }
 
-void ScrollingTreeScrollingNodeIOS::updateAfterChildren(const ScrollingStateNode& stateNode)
+void ScrollingTreeFrameScrollingNodeIOS::updateAfterChildren(const ScrollingStateNode& stateNode)
 {
-    ScrollingTreeScrollingNode::updateAfterChildren(stateNode);
+    ScrollingTreeFrameScrollingNode::updateAfterChildren(stateNode);
 
-    const auto& scrollingStateNode = toScrollingStateScrollingNode(stateNode);
+    const auto& scrollingStateNode = toScrollingStateFrameScrollingNode(stateNode);
 
     // Update the scroll position after child nodes have been updated, because they need to have updated their constraints before any scrolling happens.
     if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition))
         setScrollPosition(scrollingStateNode.requestedScrollPosition());
 }
 
-FloatPoint ScrollingTreeScrollingNodeIOS::scrollPosition() const
+FloatPoint ScrollingTreeFrameScrollingNodeIOS::scrollPosition() const
 {
     if (shouldUpdateScrollLayerPositionSynchronously())
         return m_probableMainThreadScrollPosition;
@@ -108,7 +106,7 @@ FloatPoint ScrollingTreeScrollingNodeIOS::scrollPosition() const
     return IntPoint(-scrollLayerPosition.x + scrollOrigin().x(), -scrollLayerPosition.y + scrollOrigin().y());
 }
 
-void ScrollingTreeScrollingNodeIOS::setScrollPosition(const FloatPoint& scrollPosition)
+void ScrollingTreeFrameScrollingNodeIOS::setScrollPosition(const FloatPoint& scrollPosition)
 {
     FloatPoint newScrollPosition = scrollPosition;
     newScrollPosition = newScrollPosition.shrunkTo(maximumScrollPosition());
@@ -117,7 +115,7 @@ void ScrollingTreeScrollingNodeIOS::setScrollPosition(const FloatPoint& scrollPo
     setScrollPositionWithoutContentEdgeConstraints(newScrollPosition);
 }
 
-void ScrollingTreeScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints(const FloatPoint& scrollPosition)
+void ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints(const FloatPoint& scrollPosition)
 {
     if (shouldUpdateScrollLayerPositionSynchronously()) {
         m_probableMainThreadScrollPosition = scrollPosition;
@@ -129,7 +127,7 @@ void ScrollingTreeScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstrain
     scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition);
 }
 
-void ScrollingTreeScrollingNodeIOS::setScrollLayerPosition(const FloatPoint& scrollPosition)
+void ScrollingTreeFrameScrollingNodeIOS::setScrollLayerPosition(const FloatPoint& scrollPosition)
 {
     ASSERT(!shouldUpdateScrollLayerPositionSynchronously());
     [m_scrollLayer setPosition:CGPointMake(-scrollPosition.x() + scrollOrigin().x(), -scrollPosition.y() + scrollOrigin().y())];
@@ -137,7 +135,7 @@ void ScrollingTreeScrollingNodeIOS::setScrollLayerPosition(const FloatPoint& scr
     updateChildNodesAfterScroll(scrollPosition);
 }
 
-void ScrollingTreeScrollingNodeIOS::updateLayersAfterViewportChange(const FloatRect& viewportRect, double /*scale*/)
+void ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterViewportChange(const FloatRect& viewportRect, double /*scale*/)
 {
     [m_counterScrollingLayer setPosition:viewportRect.location()];
 
@@ -149,17 +147,17 @@ void ScrollingTreeScrollingNodeIOS::updateLayersAfterViewportChange(const FloatR
         m_children->at(i)->parentScrollPositionDidChange(viewportRect, FloatSize());
 }
 
-void ScrollingTreeScrollingNodeIOS::updateLayersAfterDelegatedScroll(const FloatPoint& scrollPosition)
+void ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterDelegatedScroll(const FloatPoint& scrollPosition)
 {
     updateChildNodesAfterScroll(scrollPosition);
 }
 
-void ScrollingTreeScrollingNodeIOS::updateChildNodesAfterScroll(const FloatPoint& scrollPosition)
+void ScrollingTreeFrameScrollingNodeIOS::updateChildNodesAfterScroll(const FloatPoint& scrollPosition)
 {
     ScrollBehaviorForFixedElements behaviorForFixed = scrollBehaviorForFixedElements();
     FloatPoint scrollOffset = scrollPosition - toIntSize(scrollOrigin());
-    FloatRect viewportRect(FloatPoint(), viewportSize());
-    FloatSize scrollOffsetForFixedChildren = FrameView::scrollOffsetForFixedPosition(enclosingLayoutRect(viewportRect), totalContentsSize(), flooredIntPoint(scrollOffset), scrollOrigin(), frameScaleFactor(), false, behaviorForFixed, headerHeight(), footerHeight());
+    FloatRect viewportRect(FloatPoint(), scrollableAreaSize());
+    FloatSize scrollOffsetForFixedChildren = FrameView::scrollOffsetForFixedPosition(enclosingLayoutRect(viewportRect), roundedLayoutSize(totalContentsSize()), roundedLayoutPoint(scrollOffset), scrollOrigin(), frameScaleFactor(), false, behaviorForFixed, headerHeight(), footerHeight());
 
     [m_counterScrollingLayer setPosition:FloatPoint(scrollOffsetForFixedChildren)];
 
@@ -169,7 +167,7 @@ void ScrollingTreeScrollingNodeIOS::updateChildNodesAfterScroll(const FloatPoint
         // then we should recompute scrollOffsetForFixedChildren for the banner with a scale factor of 1.
         float horizontalScrollOffsetForBanner = scrollOffsetForFixedChildren.width();
         if (frameScaleFactor() != 1)
-            horizontalScrollOffsetForBanner = FrameView::scrollOffsetForFixedPosition(enclosingLayoutRect(viewportRect), totalContentsSize(), flooredIntPoint(scrollOffset), scrollOrigin(), 1, false, behaviorForFixed, headerHeight(), footerHeight()).width();
+            horizontalScrollOffsetForBanner = FrameView::scrollOffsetForFixedPosition(enclosingLayoutRect(viewportRect), roundedLayoutSize(totalContentsSize()), roundedLayoutPoint(scrollOffset), scrollOrigin(), 1, false, behaviorForFixed, headerHeight(), footerHeight()).width();
 
         if (m_headerLayer)
             [m_headerLayer setPosition:FloatPoint(horizontalScrollOffsetForBanner, 0)];
@@ -183,14 +181,14 @@ void ScrollingTreeScrollingNodeIOS::updateChildNodesAfterScroll(const FloatPoint
     
     viewportRect.setLocation(scrollOffset);
     
-    FloatRect viewportConstrainedObjectsRect = FrameView::rectForViewportConstrainedObjects(enclosingLayoutRect(viewportRect), totalContentsSize(), frameScaleFactor(), false, behaviorForFixed);
+    FloatRect viewportConstrainedObjectsRect = FrameView::rectForViewportConstrainedObjects(enclosingLayoutRect(viewportRect), roundedLayoutSize(totalContentsSize()), frameScaleFactor(), false, behaviorForFixed);
     
     size_t size = m_children->size();
     for (size_t i = 0; i < size; ++i)
         m_children->at(i)->parentScrollPositionDidChange(viewportConstrainedObjectsRect, FloatSize());
 }
 
-FloatPoint ScrollingTreeScrollingNodeIOS::minimumScrollPosition() const
+FloatPoint ScrollingTreeFrameScrollingNodeIOS::minimumScrollPosition() const
 {
     FloatPoint position;
     
@@ -200,10 +198,10 @@ FloatPoint ScrollingTreeScrollingNodeIOS::minimumScrollPosition() const
     return position;
 }
 
-FloatPoint ScrollingTreeScrollingNodeIOS::maximumScrollPosition() const
+FloatPoint ScrollingTreeFrameScrollingNodeIOS::maximumScrollPosition() const
 {
-    FloatPoint position(totalContentsSizeForRubberBand().width() - viewportSize().width(),
-        totalContentsSizeForRubberBand().height() - viewportSize().height());
+    FloatPoint position(totalContentsSizeForRubberBand().width() - scrollableAreaSize().width(),
+        totalContentsSizeForRubberBand().height() - scrollableAreaSize().height());
 
     position = position.expandedTo(FloatPoint());
 
@@ -213,12 +211,12 @@ FloatPoint ScrollingTreeScrollingNodeIOS::maximumScrollPosition() const
     return position;
 }
 
-void ScrollingTreeScrollingNodeIOS::scrollBy(const IntSize& offset)
+void ScrollingTreeFrameScrollingNodeIOS::scrollBy(const IntSize& offset)
 {
     setScrollPosition(scrollPosition() + offset);
 }
 
-void ScrollingTreeScrollingNodeIOS::scrollByWithoutContentEdgeConstraints(const IntSize& offset)
+void ScrollingTreeFrameScrollingNodeIOS::scrollByWithoutContentEdgeConstraints(const IntSize& offset)
 {
     setScrollPositionWithoutContentEdgeConstraints(scrollPosition() + offset);
 }
index 74fe21a..f06e83d 100644 (file)
@@ -37,7 +37,7 @@
 #include "ScrollingStateTree.h"
 #include "ScrollingThread.h"
 #include "ScrollingTreeFixedNode.h"
-#include "ScrollingTreeScrollingNodeMac.h"
+#include "ScrollingTreeFrameScrollingNodeMac.h"
 #include "ScrollingTreeStickyNode.h"
 #include "ThreadedScrollingTree.h"
 #include "TiledBacking.h"
@@ -148,7 +148,7 @@ PassOwnPtr<ScrollingTreeNode> ScrollingCoordinatorMac::createScrollingTreeNode(S
 
     switch (nodeType) {
     case FrameScrollingNode:
-        return ScrollingTreeScrollingNodeMac::create(*scrollingTree(), nodeType, nodeID);
+        return ScrollingTreeFrameScrollingNodeMac::create(*scrollingTree(), nodeID);
     case OverflowScrollingNode:
         ASSERT_NOT_REACHED();
         return nullptr;
  */
 
 #include "config.h"
-#include "ScrollingStateScrollingNode.h"
+#include "ScrollingStateFrameScrollingNode.h"
 
 #include "GraphicsLayer.h"
 #include "Scrollbar.h"
 #include "ScrollbarThemeMac.h"
 #include "ScrollingStateTree.h"
 
-#if ENABLE(ASYNC_SCROLLING)
+#if ENABLE(ASYNC_SCROLLING) && PLATFORM(MAC)
 
 namespace WebCore {
-void ScrollingStateScrollingNode::setScrollbarPaintersFromScrollbars(Scrollbar* verticalScrollbar, Scrollbar* horizontalScrollbar)
+    
+void ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars(Scrollbar* verticalScrollbar, Scrollbar* horizontalScrollbar)
 {
     ScrollbarTheme* scrollbarTheme = ScrollbarTheme::theme();
     if (scrollbarTheme->isMockTheme())
@@ -57,4 +58,4 @@ void ScrollingStateScrollingNode::setScrollbarPaintersFromScrollbars(Scrollbar*
 
 } // namespace WebCore
 
-#endif // ENABLE(ASYNC_SCROLLING)
+#endif // ENABLE(ASYNC_SCROLLING) && PLATFORM(MAC)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef ScrollingTreeScrollingNodeMac_h
-#define ScrollingTreeScrollingNodeMac_h
+#ifndef ScrollingTreeFrameScrollingNodeMac_h
+#define ScrollingTreeFrameScrollingNodeMac_h
 
-#if ENABLE(ASYNC_SCROLLING)
+#if ENABLE(ASYNC_SCROLLING) && PLATFORM(MAC)
 
 #include "ScrollElasticityController.h"
 #include "ScrollbarThemeMac.h"
-#include "ScrollingTreeScrollingNode.h"
+#include "ScrollingTreeFrameScrollingNode.h"
 #include <wtf/RetainPtr.h>
 
 OBJC_CLASS CALayer;
 
 namespace WebCore {
 
-class ScrollingTreeScrollingNodeMac : public ScrollingTreeScrollingNode, private ScrollElasticityControllerClient {
+class ScrollingTreeFrameScrollingNodeMac : public ScrollingTreeFrameScrollingNode, private ScrollElasticityControllerClient {
 public:
-    static PassOwnPtr<ScrollingTreeScrollingNode> create(ScrollingTree&, ScrollingNodeType, ScrollingNodeID);
-    virtual ~ScrollingTreeScrollingNodeMac();
+    static PassOwnPtr<ScrollingTreeFrameScrollingNode> create(ScrollingTree&, ScrollingNodeID);
+    virtual ~ScrollingTreeFrameScrollingNodeMac();
 
 private:
-    ScrollingTreeScrollingNodeMac(ScrollingTree&, ScrollingNodeType, ScrollingNodeID);
+    ScrollingTreeFrameScrollingNodeMac(ScrollingTree&, ScrollingNodeID);
 
     // ScrollingTreeNode member functions.
     virtual void updateBeforeChildren(const ScrollingStateNode&) override;
@@ -71,10 +71,10 @@ private:
 
     virtual void updateLayersAfterViewportChange(const FloatRect& viewportRect, double scale) override;
 
-    void setScrollLayerPosition(const FloatPoint&);
+    virtual void setScrollLayerPosition(const FloatPoint&) override;
 
-    FloatPoint minimumScrollPosition() const;
-    FloatPoint maximumScrollPosition() const;
+    virtual FloatPoint minimumScrollPosition() const override;
+    virtual FloatPoint maximumScrollPosition() const override;
 
     void scrollBy(const IntSize&);
     void scrollByWithoutContentEdgeConstraints(const IntSize&);
@@ -101,6 +101,6 @@ private:
 
 } // namespace WebCore
 
-#endif // ENABLE(ASYNC_SCROLLING)
+#endif // ENABLE(ASYNC_SCROLLING) && PLATFORM(MAC)
 
-#endif // ScrollingTreeScrollingNodeMac_h
+#endif // ScrollingTreeFrameScrollingNodeMac_h
@@ -24,9 +24,9 @@
  */
 
 #import "config.h"
-#import "ScrollingTreeScrollingNodeMac.h"
+#import "ScrollingTreeFrameScrollingNodeMac.h"
 
-#if ENABLE(ASYNC_SCROLLING)
+#if ENABLE(ASYNC_SCROLLING) && PLATFORM(MAC)
 
 #import "FrameView.h"
 #import "NSScrollerImpDetails.h"
@@ -50,13 +50,13 @@ static void logThreadedScrollingMode(unsigned synchronousScrollingReasons);
 static void logWheelEventHandlerCountChanged(unsigned);
 
 
-PassOwnPtr<ScrollingTreeScrollingNode> ScrollingTreeScrollingNodeMac::create(ScrollingTree& scrollingTree, ScrollingNodeType nodeType, ScrollingNodeID nodeID)
+PassOwnPtr<ScrollingTreeFrameScrollingNode> ScrollingTreeFrameScrollingNodeMac::create(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
 {
-    return adoptPtr(new ScrollingTreeScrollingNodeMac(scrollingTree, nodeType, nodeID));
+    return adoptPtr(new ScrollingTreeFrameScrollingNodeMac(scrollingTree, nodeID));
 }
 
-ScrollingTreeScrollingNodeMac::ScrollingTreeScrollingNodeMac(ScrollingTree& scrollingTree, ScrollingNodeType nodeType, ScrollingNodeID nodeID)
-    : ScrollingTreeScrollingNode(scrollingTree, nodeType, nodeID)
+ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
+    : ScrollingTreeFrameScrollingNode(scrollingTree, nodeID)
     , m_scrollElasticityController(this)
     , m_verticalScrollbarPainter(0)
     , m_horizontalScrollbarPainter(0)
@@ -64,44 +64,41 @@ ScrollingTreeScrollingNodeMac::ScrollingTreeScrollingNodeMac(ScrollingTree& scro
 {
 }
 
-ScrollingTreeScrollingNodeMac::~ScrollingTreeScrollingNodeMac()
+ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac()
 {
     if (m_snapRubberbandTimer)
         CFRunLoopTimerInvalidate(m_snapRubberbandTimer.get());
 }
 
-void ScrollingTreeScrollingNodeMac::updateBeforeChildren(const ScrollingStateNode& stateNode)
+void ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren(const ScrollingStateNode& stateNode)
 {
-    ScrollingTreeScrollingNode::updateBeforeChildren(stateNode);
-    const auto& scrollingStateNode = toScrollingStateScrollingNode(stateNode);
+    ScrollingTreeFrameScrollingNode::updateBeforeChildren(stateNode);
+    const auto& scrollingStateNode = toScrollingStateFrameScrollingNode(stateNode);
 
     if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::ScrollLayer))
         m_scrollLayer = scrollingStateNode.layer();
-
-    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer))
-        m_scrolledContentsLayer = scrollingStateNode.scrolledContentsLayer();
-
-    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::CounterScrollingLayer))
+    
+    if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer))
         m_counterScrollingLayer = scrollingStateNode.counterScrollingLayer();
 
-    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::InsetClipLayer))
+    if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::InsetClipLayer))
         m_insetClipLayer = scrollingStateNode.insetClipLayer();
 
-    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ContentShadowLayer))
+    if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::ContentShadowLayer))
         m_contentShadowLayer = scrollingStateNode.contentShadowLayer();
 
-    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::HeaderLayer))
+    if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::HeaderLayer))
         m_headerLayer = scrollingStateNode.headerLayer();
 
-    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::FooterLayer))
+    if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::FooterLayer))
         m_footerLayer = scrollingStateNode.footerLayer();
 
-    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::PainterForScrollbar)) {
+    if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::PainterForScrollbar)) {
         m_verticalScrollbarPainter = scrollingStateNode.verticalScrollbarPainter();
         m_horizontalScrollbarPainter = scrollingStateNode.horizontalScrollbarPainter();
     }
 
-    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ReasonsForSynchronousScrolling)) {
+    if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::ReasonsForSynchronousScrolling)) {
         if (shouldUpdateScrollLayerPositionSynchronously()) {
             // We're transitioning to the slow "update scroll layer position on the main thread" mode.
             // Initialize the probable main thread scroll position with the current scroll layer position.
@@ -117,15 +114,15 @@ void ScrollingTreeScrollingNodeMac::updateBeforeChildren(const ScrollingStateNod
             logThreadedScrollingMode(synchronousScrollingReasons());
     }
 
-    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::WheelEventHandlerCount)) {
+    if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::WheelEventHandlerCount)) {
         if (scrollingTree().scrollingPerformanceLoggingEnabled())
             logWheelEventHandlerCountChanged(scrollingStateNode.wheelEventHandlerCount());
     }
 }
 
-void ScrollingTreeScrollingNodeMac::updateAfterChildren(const ScrollingStateNode& stateNode)
+void ScrollingTreeFrameScrollingNodeMac::updateAfterChildren(const ScrollingStateNode& stateNode)
 {
-    ScrollingTreeScrollingNode::updateAfterChildren(stateNode);
+    ScrollingTreeFrameScrollingNode::updateAfterChildren(stateNode);
 
     const auto& scrollingStateNode = toScrollingStateScrollingNode(stateNode);
 
@@ -133,11 +130,13 @@ void ScrollingTreeScrollingNodeMac::updateAfterChildren(const ScrollingStateNode
     if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition))
         setScrollPosition(scrollingStateNode.requestedScrollPosition());
 
-    if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::ScrollLayer) || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize) || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ViewportSize))
+    if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::ScrollLayer)
+        || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize)
+        || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollableAreaSize))
         updateMainFramePinState(scrollPosition());
 }
 
-void ScrollingTreeScrollingNodeMac::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
+void ScrollingTreeFrameScrollingNodeMac::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
 {
     if (!canHaveScrollbars())
         return;
@@ -156,7 +155,7 @@ void ScrollingTreeScrollingNodeMac::handleWheelEvent(const PlatformWheelEvent& w
     scrollingTree().handleWheelEventPhase(wheelEvent.phase());
 }
 
-bool ScrollingTreeScrollingNodeMac::allowsHorizontalStretching()
+bool ScrollingTreeFrameScrollingNodeMac::allowsHorizontalStretching()
 {
     switch (horizontalScrollElasticity()) {
     case ScrollElasticityAutomatic:
@@ -171,7 +170,7 @@ bool ScrollingTreeScrollingNodeMac::allowsHorizontalStretching()
     return false;
 }
 
-bool ScrollingTreeScrollingNodeMac::allowsVerticalStretching()
+bool ScrollingTreeFrameScrollingNodeMac::allowsVerticalStretching()
 {
     switch (verticalScrollElasticity()) {
     case ScrollElasticityAutomatic:
@@ -186,7 +185,7 @@ bool ScrollingTreeScrollingNodeMac::allowsVerticalStretching()
     return false;
 }
 
-IntSize ScrollingTreeScrollingNodeMac::stretchAmount()
+IntSize ScrollingTreeFrameScrollingNodeMac::stretchAmount()
 {
     IntSize stretch;
 
@@ -210,24 +209,24 @@ IntSize ScrollingTreeScrollingNodeMac::stretchAmount()
     return stretch;
 }
 
-bool ScrollingTreeScrollingNodeMac::pinnedInDirection(const FloatSize& delta)
+bool ScrollingTreeFrameScrollingNodeMac::pinnedInDirection(const FloatSize& delta)
 {
     FloatSize limitDelta;
 
     if (fabsf(delta.height()) >= fabsf(delta.width())) {
         if (delta.height() < 0) {
-            // We are trying to scroll up.  Make sure we are not pinned to the top
+            // We are trying to scroll up. Make sure we are not pinned to the top.
             limitDelta.setHeight(scrollPosition().y() - minimumScrollPosition().y());
         } else {
-            // We are trying to scroll down.  Make sure we are not pinned to the bottom
+            // We are trying to scroll down. Make sure we are not pinned to the bottom.
             limitDelta.setHeight(maximumScrollPosition().y() - scrollPosition().y());
         }
     } else if (delta.width()) {
         if (delta.width() < 0) {
-            // We are trying to scroll left.  Make sure we are not pinned to the left
+            // We are trying to scroll left. Make sure we are not pinned to the left.
             limitDelta.setWidth(scrollPosition().x() - minimumScrollPosition().x());
         } else {
-            // We are trying to scroll right.  Make sure we are not pinned to the right
+            // We are trying to scroll right. Make sure we are not pinned to the right.
             limitDelta.setWidth(maximumScrollPosition().x() - scrollPosition().x());
         }
     }
@@ -238,37 +237,37 @@ bool ScrollingTreeScrollingNodeMac::pinnedInDirection(const FloatSize& delta)
     return false;
 }
 
-bool ScrollingTreeScrollingNodeMac::canScrollHorizontally()
+bool ScrollingTreeFrameScrollingNodeMac::canScrollHorizontally()
 {
     return hasEnabledHorizontalScrollbar();
 }
 
-bool ScrollingTreeScrollingNodeMac::canScrollVertically()
+bool ScrollingTreeFrameScrollingNodeMac::canScrollVertically()
 {
     return hasEnabledVerticalScrollbar();
 }
 
-bool ScrollingTreeScrollingNodeMac::shouldRubberBandInDirection(ScrollDirection)
+bool ScrollingTreeFrameScrollingNodeMac::shouldRubberBandInDirection(ScrollDirection)
 {
     return true;
 }
 
-IntPoint ScrollingTreeScrollingNodeMac::absoluteScrollPosition()
+IntPoint ScrollingTreeFrameScrollingNodeMac::absoluteScrollPosition()
 {
     return roundedIntPoint(scrollPosition());
 }
 
-void ScrollingTreeScrollingNodeMac::immediateScrollBy(const FloatSize& offset)
+void ScrollingTreeFrameScrollingNodeMac::immediateScrollBy(const FloatSize& offset)
 {
     scrollBy(roundedIntSize(offset));
 }
 
-void ScrollingTreeScrollingNodeMac::immediateScrollByWithoutContentEdgeConstraints(const FloatSize& offset)
+void ScrollingTreeFrameScrollingNodeMac::immediateScrollByWithoutContentEdgeConstraints(const FloatSize& offset)
 {
     scrollByWithoutContentEdgeConstraints(roundedIntSize(offset));
 }
 
-void ScrollingTreeScrollingNodeMac::startSnapRubberbandTimer()
+void ScrollingTreeFrameScrollingNodeMac::startSnapRubberbandTimer()
 {
     ASSERT(!m_snapRubberbandTimer);
 
@@ -280,7 +279,7 @@ void ScrollingTreeScrollingNodeMac::startSnapRubberbandTimer()
     CFRunLoopAddTimer(CFRunLoopGetCurrent(), m_snapRubberbandTimer.get(), kCFRunLoopDefaultMode);
 }
 
-void ScrollingTreeScrollingNodeMac::stopSnapRubberbandTimer()
+void ScrollingTreeFrameScrollingNodeMac::stopSnapRubberbandTimer()
 {
     if (!m_snapRubberbandTimer)
         return;
@@ -294,7 +293,7 @@ void ScrollingTreeScrollingNodeMac::stopSnapRubberbandTimer()
     m_snapRubberbandTimer = nullptr;
 }
 
-void ScrollingTreeScrollingNodeMac::adjustScrollPositionToBoundsIfNecessary()
+void ScrollingTreeFrameScrollingNodeMac::adjustScrollPositionToBoundsIfNecessary()
 {
     FloatPoint currentScrollPosition = absoluteScrollPosition();
     FloatPoint minPosition = minimumScrollPosition();
@@ -307,7 +306,7 @@ void ScrollingTreeScrollingNodeMac::adjustScrollPositionToBoundsIfNecessary()
     immediateScrollBy(nearestPointWithinBounds - currentScrollPosition);
 }
 
-FloatPoint ScrollingTreeScrollingNodeMac::scrollPosition() const
+FloatPoint ScrollingTreeFrameScrollingNodeMac::scrollPosition() const
 {
     if (shouldUpdateScrollLayerPositionSynchronously())
         return m_probableMainThreadScrollPosition;
@@ -316,7 +315,7 @@ FloatPoint ScrollingTreeScrollingNodeMac::scrollPosition() const
     return IntPoint(-scrollLayerPosition.x + scrollOrigin().x(), -scrollLayerPosition.y + scrollOrigin().y());
 }
 
-void ScrollingTreeScrollingNodeMac::setScrollPosition(const FloatPoint& scrollPosition)
+void ScrollingTreeFrameScrollingNodeMac::setScrollPosition(const FloatPoint& scrollPosition)
 {
     FloatPoint newScrollPosition = scrollPosition;
     newScrollPosition = newScrollPosition.shrunkTo(maximumScrollPosition());
@@ -328,7 +327,7 @@ void ScrollingTreeScrollingNodeMac::setScrollPosition(const FloatPoint& scrollPo
         logExposedUnfilledArea();
 }
 
-void ScrollingTreeScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints(const FloatPoint& scrollPosition)
+void ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints(const FloatPoint& scrollPosition)
 {
     updateMainFramePinState(scrollPosition);
 
@@ -342,18 +341,18 @@ void ScrollingTreeScrollingNodeMac::setScrollPositionWithoutContentEdgeConstrain
     scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition);
 }
 
-void ScrollingTreeScrollingNodeMac::setScrollLayerPosition(const FloatPoint& position)
+void ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition(const FloatPoint& position)
 {
     ASSERT(!shouldUpdateScrollLayerPositionSynchronously());
     m_scrollLayer.get().position = CGPointMake(-position.x() + scrollOrigin().x(), -position.y() + scrollOrigin().y());
 
     ScrollBehaviorForFixedElements behaviorForFixed = scrollBehaviorForFixedElements();
     FloatPoint scrollOffset = position - toFloatSize(scrollOrigin());
-    FloatRect viewportRect(FloatPoint(), viewportSize());
+    FloatRect viewportRect(FloatPoint(), scrollableAreaSize());
     
     // FIXME: scrollOffsetForFixedPosition() needs to do float math.
     FloatSize scrollOffsetForFixedChildren = FrameView::scrollOffsetForFixedPosition(enclosingLayoutRect(viewportRect),
-        totalContentsSize(), flooredIntPoint(scrollOffset), scrollOrigin(), frameScaleFactor(), false, behaviorForFixed, headerHeight(), footerHeight());
+        roundedLayoutSize(totalContentsSize()), roundedLayoutPoint(scrollOffset), scrollOrigin(), frameScaleFactor(), false, behaviorForFixed, headerHeight(), footerHeight());
     
     if (m_counterScrollingLayer)
         m_counterScrollingLayer.get().position = FloatPoint(scrollOffsetForFixedChildren);
@@ -373,14 +372,15 @@ void ScrollingTreeScrollingNodeMac::setScrollLayerPosition(const FloatPoint& pos
         // then we should recompute scrollOffsetForFixedChildren for the banner with a scale factor of 1.
         float horizontalScrollOffsetForBanner = scrollOffsetForFixedChildren.width();
         if (frameScaleFactor() != 1)
-            horizontalScrollOffsetForBanner = FrameView::scrollOffsetForFixedPosition(enclosingLayoutRect(viewportRect), totalContentsSize(), flooredIntPoint(scrollOffset), scrollOrigin(), 1, false, behaviorForFixed, headerHeight(), footerHeight()).width();
+            horizontalScrollOffsetForBanner = FrameView::scrollOffsetForFixedPosition(enclosingLayoutRect(viewportRect), roundedLayoutSize(totalContentsSize()), roundedLayoutPoint(scrollOffset), scrollOrigin(), 1, false, behaviorForFixed, headerHeight(), footerHeight()).width();
 
         if (m_headerLayer)
             m_headerLayer.get().position = FloatPoint(horizontalScrollOffsetForBanner, FrameView::yPositionForHeaderLayer(position, topContentInset));
 
-        if (m_footerLayer)
+        if (m_footerLayer) {
             m_footerLayer.get().position = FloatPoint(horizontalScrollOffsetForBanner,
                 FrameView::yPositionForFooterLayer(position, topContentInset, totalContentsSize().height(), footerHeight()));
+        }
     }
 
     if (m_verticalScrollbarPainter || m_horizontalScrollbarPainter) {
@@ -414,14 +414,14 @@ void ScrollingTreeScrollingNodeMac::setScrollLayerPosition(const FloatPoint& pos
         m_children->at(i)->parentScrollPositionDidChange(viewportRect, FloatSize());
 }
 
-void ScrollingTreeScrollingNodeMac::updateLayersAfterViewportChange(const FloatRect&, double)
+void ScrollingTreeFrameScrollingNodeMac::updateLayersAfterViewportChange(const FloatRect&, double)
 {
     ASSERT_NOT_REACHED();
 }
 
-FloatPoint ScrollingTreeScrollingNodeMac::minimumScrollPosition() const
+FloatPoint ScrollingTreeFrameScrollingNodeMac::minimumScrollPosition() const
 {
-    IntPoint position;
+    FloatPoint position;
     
     if (scrollingTree().rootNode() == this && scrollingTree().scrollPinningBehavior() == PinToBottom)
         position.setY(maximumScrollPosition().y());
@@ -429,11 +429,9 @@ FloatPoint ScrollingTreeScrollingNodeMac::minimumScrollPosition() const
     return position;
 }
 
-FloatPoint ScrollingTreeScrollingNodeMac::maximumScrollPosition() const
+FloatPoint ScrollingTreeFrameScrollingNodeMac::maximumScrollPosition() const
 {
-    FloatPoint position(totalContentsSizeForRubberBand().width() - viewportSize().width(),
-        totalContentsSizeForRubberBand().height() - viewportSize().height());
-
+    FloatPoint position(totalContentsSizeForRubberBand() - scrollableAreaSize());
     position = position.expandedTo(FloatPoint());
 
     if (scrollingTree().rootNode() == this && scrollingTree().scrollPinningBehavior() == PinToTop)
@@ -442,17 +440,17 @@ FloatPoint ScrollingTreeScrollingNodeMac::maximumScrollPosition() const
     return position;
 }
 
-void ScrollingTreeScrollingNodeMac::scrollBy(const IntSize& offset)
+void ScrollingTreeFrameScrollingNodeMac::scrollBy(const IntSize& offset)
 {
     setScrollPosition(scrollPosition() + offset);
 }
 
-void ScrollingTreeScrollingNodeMac::scrollByWithoutContentEdgeConstraints(const IntSize& offset)
+void ScrollingTreeFrameScrollingNodeMac::scrollByWithoutContentEdgeConstraints(const IntSize& offset)
 {
     setScrollPositionWithoutContentEdgeConstraints(scrollPosition() + offset);
 }
 
-void ScrollingTreeScrollingNodeMac::updateMainFramePinState(const FloatPoint& scrollPosition)
+void ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState(const FloatPoint& scrollPosition)
 {
     bool pinnedToTheLeft = scrollPosition.x() <= minimumScrollPosition().x();
     bool pinnedToTheRight = scrollPosition.x() >= maximumScrollPosition().x();
@@ -462,7 +460,7 @@ void ScrollingTreeScrollingNodeMac::updateMainFramePinState(const FloatPoint& sc
     scrollingTree().setMainFramePinState(pinnedToTheLeft, pinnedToTheRight, pinnedToTheTop, pinnedToTheBottom);
 }
 
-void ScrollingTreeScrollingNodeMac::logExposedUnfilledArea()
+void ScrollingTreeFrameScrollingNodeMac::logExposedUnfilledArea()
 {
     Region paintedVisibleTiles;
 
@@ -487,7 +485,7 @@ void ScrollingTreeScrollingNodeMac::logExposedUnfilledArea()
     }
 
     FloatPoint scrollPosition = this->scrollPosition();
-    FloatRect viewPortRect(FloatPoint(), viewportSize());
+    FloatRect viewPortRect(FloatPoint(), scrollableAreaSize());
     unsigned unfilledArea = TileController::blankPixelCountForTiles(tiles, viewPortRect, IntPoint(-scrollPosition.x(), -scrollPosition.y()));
 
     if (unfilledArea || m_lastScrollHadUnfilledPixels)
@@ -527,4 +525,4 @@ void logWheelEventHandlerCountChanged(unsigned count)
 
 } // namespace WebCore
 
-#endif // ENABLE(ASYNC_SCROLLING)
+#endif // ENABLE(ASYNC_SCROLLING) && PLATFORM(MAC)
index b457160..3aec407 100644 (file)
@@ -3664,13 +3664,14 @@ void RenderLayerCompositor::updateScrollCoordinatedLayer(RenderLayer& layer, Scr
             scrolledContentsLayer = m_rootContentLayer.get();
             counterScrollingLayer = fixedRootBackgroundLayer();
             insetClipLayer = clipLayer();
-            scrollingCoordinator->updateScrollingNode(nodeID, scrollingLayer, scrolledContentsLayer, counterScrollingLayer, insetClipLayer);
+            scrollingCoordinator->updateFrameScrollingNode(nodeID, scrollingLayer, counterScrollingLayer, insetClipLayer);
         } else {
             ScrollingCoordinator::ScrollingGeometry scrollingGeometry;
             scrollingGeometry.scrollOrigin = layer.scrollOrigin();
             scrollingGeometry.scrollPosition = layer.scrollPosition();
+            scrollingGeometry.scrollableAreaSize = layer.visibleSize();
             scrollingGeometry.contentSize = layer.contentsSize();
-            scrollingCoordinator->updateScrollingNode(nodeID, scrollingLayer, scrolledContentsLayer, counterScrollingLayer, insetClipLayer, &scrollingGeometry);
+            scrollingCoordinator->updateOverflowScrollingNode(nodeID, scrollingLayer, scrolledContentsLayer, &scrollingGeometry);
         }
     }
 }
index 371de8e..3022563 100644 (file)
@@ -1,3 +1,45 @@
+2014-05-19  Simon Fraser  <simon.fraser@apple.com>
+
+        Split scrolling tree ScrollingNodes into FrameScrollingNodes and OverflowScrollingNodes
+        https://bugs.webkit.org/show_bug.cgi?id=133022
+
+        Reviewed by Sam Weinig.
+        
+        In both the scrolling state tree and the scrolling tree, split the "scrolling nodes"
+        into FrameScrolling and OverflowScrolling nodes.
+        
+        Move what was the "viewportSize" property onto the base class for the scrolling
+        nodes, calling it "scrollableAreaSize".
+        
+        Make minimum/maximumScrollPosition() virtual so we can share more code (and there
+        is more code sharing to be done in future).
+
+        * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
+        (ArgumentCoder<ScrollingStateScrollingNode>::encode):
+        (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
+        (ArgumentCoder<ScrollingStateOverflowScrollingNode>::encode):
+        (ArgumentCoder<ScrollingStateScrollingNode>::decode):
+        (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
+        (ArgumentCoder<ScrollingStateOverflowScrollingNode>::decode):
+        (WebKit::encodeNodeAndDescendants):
+        (WebKit::RemoteScrollingCoordinatorTransaction::decode):
+        (WebKit::RemoteScrollingTreeTextStream::dump):
+        * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
+        (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
+        * UIProcess/Scrolling/RemoteScrollingTree.cpp:
+        (WebKit::RemoteScrollingTree::createNode):
+        * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
+        (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollLayer):
+        (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterViewportChange):
+        * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
+        (WebKit::ScrollingTreeOverflowScrollingNodeIOS::ScrollingTreeOverflowScrollingNodeIOS):
+        (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateBeforeChildren):
+        (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren):
+        (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition):
+        (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll):
+        * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
+        (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
+
 2014-05-19  Alexey Proskuryakov  <ap@apple.com>
 
         [Mac] Fix a typo in plug-in sandbox
index 1bf483e..48a2bb4 100644 (file)
@@ -32,7 +32,8 @@
 #include "WebCoreArgumentCoders.h"
 #include <WebCore/GraphicsLayer.h>
 #include <WebCore/ScrollingStateFixedNode.h>
-#include <WebCore/ScrollingStateScrollingNode.h>
+#include <WebCore/ScrollingStateFrameScrollingNode.h>
+#include <WebCore/ScrollingStateOverflowScrollingNode.h>
 #include <WebCore/ScrollingStateStickyNode.h>
 #include <WebCore/ScrollingStateTree.h>
 #include <WebCore/TextStream.h>
@@ -56,7 +57,17 @@ template<> struct ArgumentCoder<ScrollingStateScrollingNode> {
     static void encode(ArgumentEncoder&, const ScrollingStateScrollingNode&);
     static bool decode(ArgumentDecoder&, ScrollingStateScrollingNode&);
 };
-
+    
+template<> struct ArgumentCoder<ScrollingStateFrameScrollingNode> {
+    static void encode(ArgumentEncoder&, const ScrollingStateFrameScrollingNode&);
+    static bool decode(ArgumentDecoder&, ScrollingStateFrameScrollingNode&);
+};
+    
+template<> struct ArgumentCoder<ScrollingStateOverflowScrollingNode> {
+    static void encode(ArgumentEncoder&, const ScrollingStateOverflowScrollingNode&);
+    static bool decode(ArgumentDecoder&, ScrollingStateOverflowScrollingNode&);
+};
+    
 template<> struct ArgumentCoder<ScrollingStateFixedNode> {
     static void encode(ArgumentEncoder&, const ScrollingStateFixedNode&);
     static bool decode(ArgumentDecoder&, ScrollingStateFixedNode&);
@@ -101,48 +112,59 @@ bool ArgumentCoder<ScrollingStateNode>::decode(ArgumentDecoder& decoder, Scrolli
 }
 
 #define SCROLLING_NODE_ENCODE(property, getter) \
-    if (node.hasChangedProperty(ScrollingStateScrollingNode::property)) \
+    if (node.hasChangedProperty(property)) \
         encoder << node.getter();
 
 #define SCROLLING_NODE_ENCODE_ENUM(property, getter) \
-    if (node.hasChangedProperty(ScrollingStateScrollingNode::property)) \
+    if (node.hasChangedProperty(property)) \
         encoder.encodeEnum(node.getter());
 
 void ArgumentCoder<ScrollingStateScrollingNode>::encode(ArgumentEncoder& encoder, const ScrollingStateScrollingNode& node)
 {
     encoder << static_cast<const ScrollingStateNode&>(node);
     
-    SCROLLING_NODE_ENCODE(ViewportSize, viewportSize)
-    SCROLLING_NODE_ENCODE(TotalContentsSize, totalContentsSize)
-    SCROLLING_NODE_ENCODE(ScrollPosition, scrollPosition)
-    SCROLLING_NODE_ENCODE(ScrollOrigin, scrollOrigin)
-    SCROLLING_NODE_ENCODE(FrameScaleFactor, frameScaleFactor)
-    SCROLLING_NODE_ENCODE(NonFastScrollableRegion, nonFastScrollableRegion)
-    SCROLLING_NODE_ENCODE(WheelEventHandlerCount, wheelEventHandlerCount)
-    SCROLLING_NODE_ENCODE(ReasonsForSynchronousScrolling, synchronousScrollingReasons)
-    SCROLLING_NODE_ENCODE(ScrollableAreaParams, scrollableAreaParameters)
-    SCROLLING_NODE_ENCODE_ENUM(BehaviorForFixedElements, scrollBehaviorForFixedElements)
-    SCROLLING_NODE_ENCODE(RequestedScrollPosition, requestedScrollPosition)
-    SCROLLING_NODE_ENCODE(RequestedScrollPosition, requestedScrollPositionRepresentsProgrammaticScroll)
-    SCROLLING_NODE_ENCODE(HeaderHeight, headerHeight)
-    SCROLLING_NODE_ENCODE(FooterHeight, footerHeight)
-    SCROLLING_NODE_ENCODE(TopContentInset, topContentInset)
-
-    if (node.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer))
-        encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.scrolledContentsLayer());
+    SCROLLING_NODE_ENCODE(ScrollingStateScrollingNode::ScrollableAreaSize, scrollableAreaSize)
+    SCROLLING_NODE_ENCODE(ScrollingStateScrollingNode::TotalContentsSize, totalContentsSize)
+    SCROLLING_NODE_ENCODE(ScrollingStateScrollingNode::ScrollPosition, scrollPosition)
+    SCROLLING_NODE_ENCODE(ScrollingStateScrollingNode::ScrollOrigin, scrollOrigin)
+    SCROLLING_NODE_ENCODE(ScrollingStateScrollingNode::ScrollableAreaParams, scrollableAreaParameters)
+    SCROLLING_NODE_ENCODE(ScrollingStateScrollingNode::RequestedScrollPosition, requestedScrollPosition)
+    SCROLLING_NODE_ENCODE(ScrollingStateScrollingNode::RequestedScrollPosition, requestedScrollPositionRepresentsProgrammaticScroll)
+}
 
-    if (node.hasChangedProperty(ScrollingStateScrollingNode::CounterScrollingLayer))
+void ArgumentCoder<ScrollingStateFrameScrollingNode>::encode(ArgumentEncoder& encoder, const ScrollingStateFrameScrollingNode& node)
+{
+    encoder << static_cast<const ScrollingStateScrollingNode&>(node);
+    
+    SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::FrameScaleFactor, frameScaleFactor)
+    SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::NonFastScrollableRegion, nonFastScrollableRegion)
+    SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::WheelEventHandlerCount, wheelEventHandlerCount)
+    SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::ReasonsForSynchronousScrolling, synchronousScrollingReasons)
+    SCROLLING_NODE_ENCODE_ENUM(ScrollingStateFrameScrollingNode::BehaviorForFixedElements, scrollBehaviorForFixedElements)
+    SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::HeaderHeight, headerHeight)
+    SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::FooterHeight, footerHeight)
+    SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::TopContentInset, topContentInset)
+
+    if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer))
         encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.counterScrollingLayer());
 
-    if (node.hasChangedProperty(ScrollingStateScrollingNode::InsetClipLayer))
+    if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::InsetClipLayer))
         encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.insetClipLayer());
 
-    if (node.hasChangedProperty(ScrollingStateScrollingNode::ContentShadowLayer))
+    if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::ContentShadowLayer))
         encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.contentShadowLayer());
 }
 
+void ArgumentCoder<ScrollingStateOverflowScrollingNode>::encode(ArgumentEncoder& encoder, const ScrollingStateOverflowScrollingNode& node)
+{
+    encoder << static_cast<const ScrollingStateScrollingNode&>(node);
+    
+    if (node.hasChangedProperty(ScrollingStateOverflowScrollingNode::ScrolledContentsLayer))
+        encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.scrolledContentsLayer());
+}
+
 #define SCROLLING_NODE_DECODE(property, type, setter) \
-    if (node.hasChangedProperty(ScrollingStateScrollingNode::property)) { \
+    if (node.hasChangedProperty(property)) { \
         type decodedValue; \
         if (!decoder.decode(decodedValue)) \
             return false; \
@@ -150,7 +172,7 @@ void ArgumentCoder<ScrollingStateScrollingNode>::encode(ArgumentEncoder& encoder
     }
 
 #define SCROLLING_NODE_DECODE_ENUM(property, type, setter) \
-    if (node.hasChangedProperty(ScrollingStateScrollingNode::property)) { \
+    if (node.hasChangedProperty(property)) { \
         type decodedValue; \
         if (!decoder.decodeEnum(decodedValue)) \
             return false; \
@@ -162,17 +184,12 @@ bool ArgumentCoder<ScrollingStateScrollingNode>::decode(ArgumentDecoder& decoder
     if (!decoder.decode(static_cast<ScrollingStateNode&>(node)))
         return false;
 
-    SCROLLING_NODE_DECODE(ViewportSize, FloatSize, setViewportSize);
-    SCROLLING_NODE_DECODE(TotalContentsSize, IntSize, setTotalContentsSize);
-    SCROLLING_NODE_DECODE(ScrollPosition, FloatPoint, setScrollPosition);
-    SCROLLING_NODE_DECODE(ScrollOrigin, IntPoint, setScrollOrigin);
-    SCROLLING_NODE_DECODE(FrameScaleFactor, float, setFrameScaleFactor);
-    SCROLLING_NODE_DECODE(NonFastScrollableRegion, Region, setNonFastScrollableRegion);
-    SCROLLING_NODE_DECODE(WheelEventHandlerCount, int, setWheelEventHandlerCount);
-    SCROLLING_NODE_DECODE(ReasonsForSynchronousScrolling, SynchronousScrollingReasons, setSynchronousScrollingReasons);
-    SCROLLING_NODE_DECODE(ScrollableAreaParams, ScrollableAreaParameters, setScrollableAreaParameters);
-    SCROLLING_NODE_DECODE_ENUM(BehaviorForFixedElements, ScrollBehaviorForFixedElements, setScrollBehaviorForFixedElements);
-
+    SCROLLING_NODE_DECODE(ScrollingStateScrollingNode::ScrollableAreaSize, FloatSize, setScrollableAreaSize);
+    SCROLLING_NODE_DECODE(ScrollingStateScrollingNode::TotalContentsSize, FloatSize, setTotalContentsSize);
+    SCROLLING_NODE_DECODE(ScrollingStateScrollingNode::ScrollPosition, FloatPoint, setScrollPosition);
+    SCROLLING_NODE_DECODE(ScrollingStateScrollingNode::ScrollOrigin, IntPoint, setScrollOrigin);
+    SCROLLING_NODE_DECODE(ScrollingStateScrollingNode::ScrollableAreaParams, ScrollableAreaParameters, setScrollableAreaParameters);
+    
     if (node.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition)) {
         FloatPoint scrollPosition;
         if (!decoder.decode(scrollPosition))
@@ -185,36 +202,58 @@ bool ArgumentCoder<ScrollingStateScrollingNode>::decode(ArgumentDecoder& decoder
         node.setRequestedScrollPosition(scrollPosition, representsProgrammaticScroll);
     }
 
-    SCROLLING_NODE_DECODE(HeaderHeight, int, setHeaderHeight);
-    SCROLLING_NODE_DECODE(FooterHeight, int, setFooterHeight);
-    SCROLLING_NODE_DECODE(TopContentInset, float, setTopContentInset);
+    return true;
+}
+
+bool ArgumentCoder<ScrollingStateFrameScrollingNode>::decode(ArgumentDecoder& decoder, ScrollingStateFrameScrollingNode& node)
+{
+    if (!decoder.decode(static_cast<ScrollingStateScrollingNode&>(node)))
+        return false;
+
+    SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::FrameScaleFactor, float, setFrameScaleFactor);
+    SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::NonFastScrollableRegion, Region, setNonFastScrollableRegion);
+    SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::WheelEventHandlerCount, int, setWheelEventHandlerCount);
+    SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::ReasonsForSynchronousScrolling, SynchronousScrollingReasons, setSynchronousScrollingReasons);
+    SCROLLING_NODE_DECODE_ENUM(ScrollingStateFrameScrollingNode::BehaviorForFixedElements, ScrollBehaviorForFixedElements, setScrollBehaviorForFixedElements);
 
-    if (node.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) {
+    SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::HeaderHeight, int, setHeaderHeight);
+    SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::FooterHeight, int, setFooterHeight);
+    SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::TopContentInset, float, setTopContentInset);
+
+    if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer)) {
         GraphicsLayer::PlatformLayerID layerID;
         if (!decoder.decode(layerID))
             return false;
-        node.setScrolledContentsLayer(layerID);
+        node.setCounterScrollingLayer(layerID);
     }
 
-    if (node.hasChangedProperty(ScrollingStateScrollingNode::CounterScrollingLayer)) {
+    if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::InsetClipLayer)) {
         GraphicsLayer::PlatformLayerID layerID;
         if (!decoder.decode(layerID))
             return false;
-        node.setCounterScrollingLayer(layerID);
+        node.setInsetClipLayer(layerID);
     }
 
-    if (node.hasChangedProperty(ScrollingStateScrollingNode::InsetClipLayer)) {
+    if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::ContentShadowLayer)) {
         GraphicsLayer::PlatformLayerID layerID;
         if (!decoder.decode(layerID))
             return false;
-        node.setInsetClipLayer(layerID);
+        node.setContentShadowLayer(layerID);
     }
 
-    if (node.hasChangedProperty(ScrollingStateScrollingNode::ContentShadowLayer)) {
+    return true;
+}
+
+bool ArgumentCoder<ScrollingStateOverflowScrollingNode>::decode(ArgumentDecoder& decoder, ScrollingStateOverflowScrollingNode& node)
+{
+    if (!decoder.decode(static_cast<ScrollingStateScrollingNode&>(node)))
+        return false;
+
+    if (node.hasChangedProperty(ScrollingStateOverflowScrollingNode::ScrolledContentsLayer)) {
         GraphicsLayer::PlatformLayerID layerID;
         if (!decoder.decode(layerID))
             return false;
-        node.setContentShadowLayer(layerID);
+        node.setScrolledContentsLayer(layerID);
     }
 
     return true;
@@ -272,8 +311,10 @@ static void encodeNodeAndDescendants(IPC::ArgumentEncoder& encoder, const Scroll
 {
     switch (stateNode.nodeType()) {
     case FrameScrollingNode:
+        encoder << toScrollingStateFrameScrollingNode(stateNode);
+        break;
     case OverflowScrollingNode:
-        encoder << toScrollingStateScrollingNode(stateNode);
+        encoder << toScrollingStateOverflowScrollingNode(stateNode);
         break;
     case FixedNode:
         encoder << toScrollingStateFixedNode(stateNode);
@@ -354,8 +395,11 @@ bool RemoteScrollingCoordinatorTransaction::decode(IPC::ArgumentDecoder& decoder
         
         switch (nodeType) {
         case FrameScrollingNode:
+            if (!decoder.decode(*toScrollingStateFrameScrollingNode(newNode)))
+                return false;
+            break;
         case OverflowScrollingNode:
-            if (!decoder.decode(*toScrollingStateScrollingNode(newNode)))
+            if (!decoder.decode(*toScrollingStateOverflowScrollingNode(newNode)))
                 return false;
             break;
         case FixedNode:
@@ -403,6 +447,8 @@ public:
 
     void dump(const ScrollingStateNode&, bool changedPropertiesOnly = true);
     void dump(const ScrollingStateScrollingNode&, bool changedPropertiesOnly = true);
+    void dump(const ScrollingStateFrameScrollingNode&, bool changedPropertiesOnly = true);
+    void dump(const ScrollingStateOverflowScrollingNode&, bool changedPropertiesOnly = true);
     void dump(const ScrollingStateFixedNode&, bool changedPropertiesOnly = true);
     void dump(const ScrollingStateStickyNode&, bool changedPropertiesOnly = true);
 
@@ -488,8 +534,10 @@ void RemoteScrollingTreeTextStream::dump(const ScrollingStateNode& node, bool ch
     
     switch (node.nodeType()) {
     case FrameScrollingNode:
+        dump(toScrollingStateFrameScrollingNode(node), changedPropertiesOnly);
+        break;
     case OverflowScrollingNode:
-        dump(toScrollingStateScrollingNode(node), changedPropertiesOnly);
+        dump(toScrollingStateOverflowScrollingNode(node), changedPropertiesOnly);
         break;
     case FixedNode:
         dump(toScrollingStateFixedNode(node), changedPropertiesOnly);
@@ -499,13 +547,13 @@ void RemoteScrollingTreeTextStream::dump(const ScrollingStateNode& node, bool ch
         break;
     }
 }
-
+    
 void RemoteScrollingTreeTextStream::dump(const ScrollingStateScrollingNode& node, bool changedPropertiesOnly)
 {
     RemoteScrollingTreeTextStream& ts = *this;
-
-    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::ViewportSize))
-        dumpProperty(ts, "viewport-size", node.viewportSize());
+    
+    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::ScrollableAreaSize))
+        dumpProperty(ts, "scrollable-area-size", node.totalContentsSize());
 
     if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize))
         dumpProperty(ts, "total-contents-size", node.totalContentsSize());
@@ -516,7 +564,20 @@ void RemoteScrollingTreeTextStream::dump(const ScrollingStateScrollingNode& node
     if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::ScrollOrigin))
         dumpProperty(ts, "scroll-origin", node.scrollOrigin());
 
-    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::FrameScaleFactor))
+    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::FrameScaleFactor))
+    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition)) {
+        dumpProperty(ts, "requested-scroll-position", node.requestedScrollPosition());
+        dumpProperty(ts, "requested-scroll-position-is-programatic", node.requestedScrollPositionRepresentsProgrammaticScroll());
+    }
+}
+    
+void RemoteScrollingTreeTextStream::dump(const ScrollingStateFrameScrollingNode& node, bool changedPropertiesOnly)
+{
+    RemoteScrollingTreeTextStream& ts = *this;
+    
+    dump(static_cast<const ScrollingStateScrollingNode&>(node), changedPropertiesOnly);
+    
+    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::FrameScaleFactor))
         dumpProperty(ts, "frame-scale-factor", node.frameScaleFactor());
 
     // FIXME: dump nonFastScrollableRegion
@@ -525,38 +586,38 @@ void RemoteScrollingTreeTextStream::dump(const ScrollingStateScrollingNode& node
     // FIXME: dump scrollableAreaParameters
     // FIXME: dump scrollBehaviorForFixedElements
 
-    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition)) {
-        dumpProperty(ts, "requested-scroll-position", node.requestedScrollPosition());
-        dumpProperty(ts, "requested-scroll-position-is-programatic", node.requestedScrollPositionRepresentsProgrammaticScroll());
-    }
-
-    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::HeaderHeight))
+    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::HeaderHeight))
         dumpProperty(ts, "header-height", node.headerHeight());
 
-    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::FooterHeight))
+    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::FooterHeight))
         dumpProperty(ts, "footer-height", node.footerHeight());
 
-    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::TopContentInset))
+    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::TopContentInset))
         dumpProperty(ts, "top-content-inset", node.topContentInset());
 
-    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer))
-        dumpProperty(ts, "scrolled-contents-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.scrolledContentsLayer()));
-
-    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::CounterScrollingLayer))
-        dumpProperty(ts, "counter-scrolling-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.counterScrollingLayer()));
-
-    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::InsetClipLayer))
+    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::InsetClipLayer))
         dumpProperty(ts, "clip-inset-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.insetClipLayer()));
 
-    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::ContentShadowLayer))
+
+    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::ContentShadowLayer))
         dumpProperty(ts, "content-shadow-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.contentShadowLayer()));
 
-    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::HeaderLayer))
+    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::HeaderLayer))
         dumpProperty(ts, "header-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.headerLayer()));
 
-    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::FooterLayer))
+    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::FooterLayer))
         dumpProperty(ts, "footer-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.footerLayer()));
 }
+    
+void RemoteScrollingTreeTextStream::dump(const ScrollingStateOverflowScrollingNode& node, bool changedPropertiesOnly)
+{
+    RemoteScrollingTreeTextStream& ts = *this;
+    
+    dump(static_cast<const ScrollingStateScrollingNode&>(node), changedPropertiesOnly);
+    
+    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateOverflowScrollingNode::ScrolledContentsLayer))
+        dumpProperty(ts, "scrolled-contents-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.scrolledContentsLayer()));
+}
 
 void RemoteScrollingTreeTextStream::dump(const ScrollingStateFixedNode& node, bool changedPropertiesOnly)
 {
index 72a87f5..9e6963d 100644 (file)
@@ -38,6 +38,8 @@
 #include "RemoteScrollingTree.h"
 #include "WebPageProxy.h"
 #include "WebProcessProxy.h"
+#include <WebCore/ScrollingStateFrameScrollingNode.h>
+#include <WebCore/ScrollingStateOverflowScrollingNode.h>
 #include <WebCore/ScrollingStateTree.h>
 #include <WebCore/ScrollingTreeScrollingNode.h>
 
@@ -94,45 +96,44 @@ void RemoteScrollingCoordinatorProxy::updateScrollingTree(const RemoteScrollingC
 void RemoteScrollingCoordinatorProxy::connectStateNodeLayers(ScrollingStateTree& stateTree, const RemoteLayerTreeHost& layerTreeHost, bool& fixedOrStickyLayerChanged)
 {
     for (auto& currNode : stateTree.nodeMap().values()) {
+        if (currNode->hasChangedProperty(ScrollingStateNode::ScrollLayer))
+            currNode->setLayer(layerTreeHost.getLayer(currNode->layer()));
+
         switch (currNode->nodeType()) {
-        case FrameScrollingNode:
-        case OverflowScrollingNode: {
-            ScrollingStateScrollingNode* scrollingStateNode = toScrollingStateScrollingNode(currNode);
+        case FrameScrollingNode: {
+            ScrollingStateFrameScrollingNode* scrollingStateNode = toScrollingStateFrameScrollingNode(currNode);
             
-            if (scrollingStateNode->hasChangedProperty(ScrollingStateNode::ScrollLayer))
-                scrollingStateNode->setLayer(layerTreeHost.getLayer(scrollingStateNode->layer()));
-
-            if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer))
-                scrollingStateNode->setScrolledContentsLayer(layerTreeHost.getLayer(scrollingStateNode->scrolledContentsLayer()));
-
-            if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::CounterScrollingLayer))
+            if (scrollingStateNode->hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer))
                 scrollingStateNode->setCounterScrollingLayer(layerTreeHost.getLayer(scrollingStateNode->counterScrollingLayer()));
 
-            if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::InsetClipLayer))
+            if (scrollingStateNode->hasChangedProperty(ScrollingStateFrameScrollingNode::InsetClipLayer))
                 scrollingStateNode->setInsetClipLayer(layerTreeHost.getLayer(scrollingStateNode->insetClipLayer()));
 
-            if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::ContentShadowLayer))
+            if (scrollingStateNode->hasChangedProperty(ScrollingStateFrameScrollingNode::ContentShadowLayer))
                 scrollingStateNode->setContentShadowLayer(layerTreeHost.getLayer(scrollingStateNode->contentShadowLayer()));
 
             // FIXME: we should never have header and footer layers coming from the WebProcess.
-            if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::HeaderLayer))
+            if (scrollingStateNode->hasChangedProperty(ScrollingStateFrameScrollingNode::HeaderLayer))
                 scrollingStateNode->setHeaderLayer(layerTreeHost.getLayer(scrollingStateNode->headerLayer()));
 
-            if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::FooterLayer))
+            if (scrollingStateNode->hasChangedProperty(ScrollingStateFrameScrollingNode::FooterLayer))
                 scrollingStateNode->setFooterLayer(layerTreeHost.getLayer(scrollingStateNode->footerLayer()));
             break;
         }
+        case OverflowScrollingNode: {
+            ScrollingStateOverflowScrollingNode* scrollingStateNode = toScrollingStateOverflowScrollingNode(currNode);
+
+            if (scrollingStateNode->hasChangedProperty(ScrollingStateOverflowScrollingNode::ScrolledContentsLayer))
+                scrollingStateNode->setScrolledContentsLayer(layerTreeHost.getLayer(scrollingStateNode->scrolledContentsLayer()));
+            break;
+        }
         case FixedNode:
-            if (currNode->hasChangedProperty(ScrollingStateNode::ScrollLayer)) {
-                currNode->setLayer(layerTreeHost.getLayer(currNode->layer()));
+            if (currNode->hasChangedProperty(ScrollingStateNode::ScrollLayer))
                 fixedOrStickyLayerChanged = true;
-            }
             break;
         case StickyNode:
-            if (currNode->hasChangedProperty(ScrollingStateNode::ScrollLayer)) {
-                currNode->setLayer(layerTreeHost.getLayer(currNode->layer()));
+            if (currNode->hasChangedProperty(ScrollingStateNode::ScrollLayer))
                 fixedOrStickyLayerChanged = true;
-            }
             break;
         }
     }
index 7858589..59e764d 100644 (file)
@@ -35,9 +35,9 @@
 
 #if PLATFORM(IOS)
 #include "ScrollingTreeOverflowScrollingNodeIOS.h"
-#include <WebCore/ScrollingTreeScrollingNodeIOS.h>
+#include <WebCore/ScrollingTreeFrameScrollingNodeIOS.h>
 #else
-#include <WebCore/ScrollingTreeScrollingNodeMac.h>
+#include <WebCore/ScrollingTreeFrameScrollingNodeMac.h>
 #endif
 
 using namespace WebCore;
@@ -92,15 +92,16 @@ PassOwnPtr<ScrollingTreeNode> RemoteScrollingTree::createNode(ScrollingNodeType
     switch (nodeType) {
     case FrameScrollingNode:
 #if PLATFORM(IOS)
-        return ScrollingTreeScrollingNodeIOS::create(*this, nodeType, nodeID);
+        return ScrollingTreeFrameScrollingNodeIOS::create(*this, nodeID);
 #else
-        return ScrollingTreeScrollingNodeMac::create(*this, nodeType, nodeID);
+        return ScrollingTreeFrameScrollingNodeMac::create(*this, nodeID);
 #endif
     case OverflowScrollingNode:
 #if PLATFORM(IOS)
         return ScrollingTreeOverflowScrollingNodeIOS::create(*this, nodeID);
 #else
-        return ScrollingTreeScrollingNodeMac::create(*this, nodeType, nodeID);
+        ASSERT_NOT_REACHED();
+        return nullptr;
 #endif
     case FixedNode:
         return ScrollingTreeFixedNode::create(*this, nodeID);
index 6e0c86f..40c8559 100644 (file)
 #ifndef ScrollingTreeOverflowScrollingNodeIOS_h
 #define ScrollingTreeOverflowScrollingNodeIOS_h
 
-#if PLATFORM(IOS)
-#if ENABLE(ASYNC_SCROLLING)
+#if ENABLE(ASYNC_SCROLLING) && PLATFORM(IOS)
 
 #include <WebCore/ScrollingCoordinator.h>
-#include <WebCore/ScrollingTreeScrollingNodeIOS.h>
+#include <WebCore/ScrollingTreeOverflowScrollingNode.h>
 
 OBJC_CLASS WKOverflowScrollViewDelegate;
 
 namespace WebKit {
 
-class ScrollingTreeOverflowScrollingNodeIOS : public WebCore::ScrollingTreeScrollingNodeIOS {
+class ScrollingTreeOverflowScrollingNodeIOS : public WebCore::ScrollingTreeOverflowScrollingNode {
 public:
     static PassOwnPtr<ScrollingTreeOverflowScrollingNodeIOS> create(WebCore::ScrollingTree&, WebCore::ScrollingNodeID);
     virtual ~ScrollingTreeOverflowScrollingNodeIOS();
 
     void scrollViewDidScroll(const WebCore::FloatPoint&, bool inUserInteration);
+    
+    CALayer *scrollLayer() const { return m_scrollLayer.get(); }
 
 private:
     ScrollingTreeOverflowScrollingNodeIOS(WebCore::ScrollingTree&, WebCore::ScrollingNodeID);
 
     virtual void updateBeforeChildren(const WebCore::ScrollingStateNode&) override;
     virtual void updateAfterChildren(const WebCore::ScrollingStateNode&) override;
+    
+    virtual void setScrollLayerPosition(const WebCore::FloatPoint&) override;
+
+    virtual void updateLayersAfterViewportChange(const WebCore::FloatRect& viewportRect, double scale) { }
+    virtual void handleWheelEvent(const WebCore::PlatformWheelEvent&) override { }
+
+    void updateChildNodesAfterScroll(const WebCore::FloatPoint&);
+    
+    RetainPtr<CALayer> m_scrollLayer;
+    RetainPtr<CALayer> m_scrolledContentsLayer;
 
     RetainPtr<WKOverflowScrollViewDelegate> m_scrollViewDelegate;
 };
 
 } // namespace WebKit
 
-#endif // ENABLE(ASYNC_SCROLLING)
-#endif // PLATFORM(IOS)
+#endif // ENABLE(ASYNC_SCROLLING) && PLATFORM(IOS)
 
 #endif // ScrollingTreeOverflowScrollingNodeIOS_h
index d836a95..049ea0d 100644 (file)
@@ -29,8 +29,9 @@
 #if PLATFORM(IOS)
 #if ENABLE(ASYNC_SCROLLING)
 
+#import <QuartzCore/QuartzCore.h>
 #import <WebCore/BlockExceptions.h>
-#import <WebCore/ScrollingStateScrollingNode.h>
+#import <WebCore/ScrollingStateOverflowScrollingNode.h>
 #import <WebCore/ScrollingTree.h>
 #import <UIKit/UIScrollView.h>
 
@@ -92,7 +93,7 @@ PassOwnPtr<ScrollingTreeOverflowScrollingNodeIOS> ScrollingTreeOverflowScrolling
 }
 
 ScrollingTreeOverflowScrollingNodeIOS::ScrollingTreeOverflowScrollingNodeIOS(WebCore::ScrollingTree& scrollingTree, WebCore::ScrollingNodeID nodeID)
-    : ScrollingTreeScrollingNodeIOS(scrollingTree, OverflowScrollingNode, nodeID)
+    : ScrollingTreeOverflowScrollingNode(scrollingTree, nodeID)
 {
 }
 
@@ -117,14 +118,21 @@ void ScrollingTreeOverflowScrollingNodeIOS::updateBeforeChildren(const WebCore::
         END_BLOCK_OBJC_EXCEPTIONS
     }
 
-    ScrollingTreeScrollingNodeIOS::updateBeforeChildren(stateNode);
+    ScrollingTreeOverflowScrollingNode::updateBeforeChildren(stateNode);
+
+    const auto& scrollingStateNode = toScrollingStateOverflowScrollingNode(stateNode);
+    if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::ScrollLayer))
+        m_scrollLayer = scrollingStateNode.layer();
+
+    if (scrollingStateNode.hasChangedProperty(ScrollingStateOverflowScrollingNode::ScrolledContentsLayer))
+        m_scrolledContentsLayer = scrollingStateNode.scrolledContentsLayer();
 }
 
 void ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren(const ScrollingStateNode& stateNode)
 {
-    ScrollingTreeScrollingNodeIOS::updateAfterChildren(stateNode);
+    ScrollingTreeOverflowScrollingNode::updateAfterChildren(stateNode);
 
-    const auto& scrollingStateNode = toScrollingStateScrollingNode(stateNode);
+    const auto& scrollingStateNode = toScrollingStateOverflowScrollingNode(stateNode);
 
     if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollLayer)
         || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize)
@@ -150,6 +158,21 @@ void ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren(const ScrollingS
     }
 }
 
+void ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition(const FloatPoint& scrollPosition)
+{
+    [m_scrollLayer setPosition:CGPointMake(-scrollPosition.x() + scrollOrigin().x(), -scrollPosition.y() + scrollOrigin().y())];
+
+    updateChildNodesAfterScroll(scrollPosition);
+}
+
+void ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll(const FloatPoint&)
+{
+    if (!m_children)
+        return;
+
+    // FIXME: this needs to adjust child fixed/sticky nodes.
+}
+
 void ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll(const FloatPoint& scrollPosition, bool inUserInteration)
 {
     scrollingTree().scrollPositionChangedViaDelegatedScrolling(scrollingNodeID(), scrollPosition, inUserInteration);
index e10ab39..d9cf2ab 100644 (file)
@@ -31,6 +31,8 @@
 
 #include "LayerRepresentation.h"
 #include "RemoteLayerTreeHost.h"
+#include <WebCore/ScrollingStateFrameScrollingNode.h>
+#include <WebCore/ScrollingStateOverflowScrollingNode.h>
 #include <WebCore/ScrollingStateTree.h>
 #include <UIKit/UIView.h>
 
@@ -47,24 +49,30 @@ void RemoteScrollingCoordinatorProxy::connectStateNodeLayers(ScrollingStateTree&
 {
     for (auto& currNode : stateTree.nodeMap().values()) {
         switch (currNode->nodeType()) {
-        case FrameScrollingNode:
         case OverflowScrollingNode: {
-            ScrollingStateScrollingNode* scrollingStateNode = toScrollingStateScrollingNode(currNode);
+            ScrollingStateOverflowScrollingNode* scrollingStateNode = toScrollingStateOverflowScrollingNode(currNode);
             
             if (scrollingStateNode->hasChangedProperty(ScrollingStateNode::ScrollLayer))
                 scrollingStateNode->setLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(scrollingStateNode->layer())));
-
-            if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer))
+            
+            if (scrollingStateNode->hasChangedProperty(ScrollingStateOverflowScrollingNode::ScrolledContentsLayer))
                 scrollingStateNode->setScrolledContentsLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(scrollingStateNode->scrolledContentsLayer())));
+            break;
+        };
+        case FrameScrollingNode: {
+            ScrollingStateFrameScrollingNode* scrollingStateNode = toScrollingStateFrameScrollingNode(currNode);
+            
+            if (scrollingStateNode->hasChangedProperty(ScrollingStateNode::ScrollLayer))
+                scrollingStateNode->setLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(scrollingStateNode->layer())));
 
-            if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::CounterScrollingLayer))
+            if (scrollingStateNode->hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer))
                 scrollingStateNode->setCounterScrollingLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(scrollingStateNode->counterScrollingLayer())));
 
             // FIXME: we should never have header and footer layers coming from the WebProcess.
-            if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::HeaderLayer))
+            if (scrollingStateNode->hasChangedProperty(ScrollingStateFrameScrollingNode::HeaderLayer))
                 scrollingStateNode->setHeaderLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(scrollingStateNode->headerLayer())));
 
-            if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::FooterLayer))
+            if (scrollingStateNode->hasChangedProperty(ScrollingStateFrameScrollingNode::FooterLayer))
                 scrollingStateNode->setFooterLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(scrollingStateNode->footerLayer())));
             break;
         }