Remove remnants of iOS WK1 scrolling tree code
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 24 Feb 2019 00:03:37 +0000 (00:03 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 24 Feb 2019 00:03:37 +0000 (00:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194980

Reviewed by Sam Weinig.

Source/WebCore:

Remove ScrollingTreeIOS and ScrollingCoordinatorIOS which were never instantiated,
to reduce maintenance costs and simplify.

Merge ScrollingTreeFrameScrollingNodeIOS into ScrollingTreeFrameScrollingNodeRemoteIOS
since that was the only concrete subclass, removing code which never applies to iOS WK2
(e.g. the synchronous scrolling code path).

* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/FrameView.h:
* page/scrolling/ScrollingCoordinator.cpp:
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
* page/scrolling/ScrollingTreeNode.h:
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::handleWheelEvent):
* page/scrolling/ScrollingTreeScrollingNode.h:
(WebCore::ScrollingTreeScrollingNode::updateLayersAfterDelegatedScroll): Deleted.
(WebCore::ScrollingTreeScrollingNode::scrollableAreaSize const): Deleted.
(WebCore::ScrollingTreeScrollingNode::totalContentsSize const): Deleted.
(WebCore::ScrollingTreeScrollingNode::horizontalSnapOffsets const): Deleted.
(WebCore::ScrollingTreeScrollingNode::verticalSnapOffsets const): Deleted.
(WebCore::ScrollingTreeScrollingNode::horizontalSnapOffsetRanges const): Deleted.
(WebCore::ScrollingTreeScrollingNode::verticalSnapOffsetRanges const): Deleted.
(WebCore::ScrollingTreeScrollingNode::currentHorizontalSnapPointIndex const): Deleted.
(WebCore::ScrollingTreeScrollingNode::currentVerticalSnapPointIndex const): Deleted.
(WebCore::ScrollingTreeScrollingNode::setCurrentHorizontalSnapPointIndex): Deleted.
(WebCore::ScrollingTreeScrollingNode::setCurrentVerticalSnapPointIndex): Deleted.
(WebCore::ScrollingTreeScrollingNode::useDarkAppearanceForScrollbars const): Deleted.
(WebCore::ScrollingTreeScrollingNode::lastCommittedScrollPosition const): Deleted.
(WebCore::ScrollingTreeScrollingNode::reachableContentsSize const): Deleted.
(WebCore::ScrollingTreeScrollingNode::parentRelativeScrollableRect const): Deleted.
(WebCore::ScrollingTreeScrollingNode::scrollOrigin const): Deleted.
(WebCore::ScrollingTreeScrollingNode::totalContentsSizeForRubberBand const): Deleted.
(WebCore::ScrollingTreeScrollingNode::setTotalContentsSizeForRubberBand): Deleted.
(WebCore::ScrollingTreeScrollingNode::horizontalScrollElasticity const): Deleted.
(WebCore::ScrollingTreeScrollingNode::verticalScrollElasticity const): Deleted.
(WebCore::ScrollingTreeScrollingNode::hasEnabledHorizontalScrollbar const): Deleted.
(WebCore::ScrollingTreeScrollingNode::hasEnabledVerticalScrollbar const): Deleted.
(WebCore::ScrollingTreeScrollingNode::canHaveScrollbars const): Deleted.
(WebCore::ScrollingTreeScrollingNode::expectsWheelEventTestTrigger const): Deleted.
(WebCore::ScrollingTreeScrollingNode::scrollContainerLayer const): Deleted.
(WebCore::ScrollingTreeScrollingNode::scrolledContentsLayer const): Deleted.
* page/scrolling/ios/ScrollingCoordinatorIOS.h: Removed.
* page/scrolling/ios/ScrollingCoordinatorIOS.mm: Removed.
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h: Removed.
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: Removed.
* page/scrolling/ios/ScrollingTreeIOS.cpp: Removed.
* page/scrolling/ios/ScrollingTreeIOS.h: Removed.
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):

Source/WebKit:

Remove ScrollingTreeIOS and ScrollingCoordinatorIOS which were never instantiated.

Merge ScrollingTreeFrameScrollingNodeIOS into ScrollingTreeFrameScrollingNodeRemoteIOS,
removing code which never applies to iOS WK2 (e.g. the synchronous scrolling code path).

* UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::ScrollingTreeFrameScrollingNodeRemoteIOS):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::minimumScrollPosition const):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::maximumScrollPosition const):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollPosition):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:

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

22 files changed:
Source/WebCore/ChangeLog
Source/WebCore/SourcesCocoa.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/page/FrameView.h
Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
Source/WebCore/page/scrolling/ScrollingTree.h
Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h
Source/WebCore/page/scrolling/ScrollingTreeNode.h
Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp
Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h
Source/WebCore/page/scrolling/ios/ScrollingCoordinatorIOS.h [deleted file]
Source/WebCore/page/scrolling/ios/ScrollingCoordinatorIOS.mm [deleted file]
Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h [deleted file]
Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm [deleted file]
Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.cpp [deleted file]
Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.h [deleted file]
Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp
Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h
Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm
Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h

index c2fe28e..cb43f8e 100644 (file)
@@ -1,3 +1,62 @@
+2019-02-23  Simon Fraser  <simon.fraser@apple.com>
+
+        Remove remnants of iOS WK1 scrolling tree code
+        https://bugs.webkit.org/show_bug.cgi?id=194980
+
+        Reviewed by Sam Weinig.
+
+        Remove ScrollingTreeIOS and ScrollingCoordinatorIOS which were never instantiated,
+        to reduce maintenance costs and simplify.
+
+        Merge ScrollingTreeFrameScrollingNodeIOS into ScrollingTreeFrameScrollingNodeRemoteIOS
+        since that was the only concrete subclass, removing code which never applies to iOS WK2
+        (e.g. the synchronous scrolling code path).
+
+        * SourcesCocoa.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * page/FrameView.h:
+        * page/scrolling/ScrollingCoordinator.cpp:
+        * page/scrolling/ScrollingTree.h:
+        * page/scrolling/ScrollingTreeFrameScrollingNode.h:
+        * page/scrolling/ScrollingTreeNode.h:
+        * page/scrolling/ScrollingTreeScrollingNode.cpp:
+        (WebCore::ScrollingTreeScrollingNode::handleWheelEvent):
+        * page/scrolling/ScrollingTreeScrollingNode.h:
+        (WebCore::ScrollingTreeScrollingNode::updateLayersAfterDelegatedScroll): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::scrollableAreaSize const): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::totalContentsSize const): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::horizontalSnapOffsets const): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::verticalSnapOffsets const): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::horizontalSnapOffsetRanges const): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::verticalSnapOffsetRanges const): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::currentHorizontalSnapPointIndex const): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::currentVerticalSnapPointIndex const): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::setCurrentHorizontalSnapPointIndex): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::setCurrentVerticalSnapPointIndex): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::useDarkAppearanceForScrollbars const): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::lastCommittedScrollPosition const): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::reachableContentsSize const): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::parentRelativeScrollableRect const): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::scrollOrigin const): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::totalContentsSizeForRubberBand const): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::setTotalContentsSizeForRubberBand): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::horizontalScrollElasticity const): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::verticalScrollElasticity const): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::hasEnabledHorizontalScrollbar const): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::hasEnabledVerticalScrollbar const): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::canHaveScrollbars const): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::expectsWheelEventTestTrigger const): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::scrollContainerLayer const): Deleted.
+        (WebCore::ScrollingTreeScrollingNode::scrolledContentsLayer const): Deleted.
+        * page/scrolling/ios/ScrollingCoordinatorIOS.h: Removed.
+        * page/scrolling/ios/ScrollingCoordinatorIOS.mm: Removed.
+        * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h: Removed.
+        * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: Removed.
+        * page/scrolling/ios/ScrollingTreeIOS.cpp: Removed.
+        * page/scrolling/ios/ScrollingTreeIOS.h: Removed.
+        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
+
 2019-02-23  Justin Fan  <justin_fan@apple.com>
 
         [WebGPU] Buffer updates part 1: async mapping functions, unmap, and destroy
index 2aa2367..79d53ee 100644 (file)
@@ -149,10 +149,6 @@ page/scrolling/cocoa/ScrollingStateNode.mm
 page/scrolling/cocoa/ScrollingTreeFixedNode.mm
 page/scrolling/cocoa/ScrollingTreeStickyNode.mm
 
-page/scrolling/ios/ScrollingCoordinatorIOS.mm
-page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm
-page/scrolling/ios/ScrollingTreeIOS.cpp
-
 page/scrolling/mac/ScrollingCoordinatorMac.mm
 page/scrolling/mac/ScrollingMomentumCalculatorMac.mm
 page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm
index 99907dd..ef0ecfd 100644 (file)
                0FA24D7A162DF91900A3F4C0 /* GraphicsLayerUpdater.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FA24D78162DF91900A3F4C0 /* GraphicsLayerUpdater.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0FB6252F18DE1B1500A07C05 /* GeometryUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB6252D18DE1B1500A07C05 /* GeometryUtilities.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0FB8890F167D30160010CDA5 /* ScrollingStateStickyNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB8890D167D30160010CDA5 /* ScrollingStateStickyNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               0FC4E40D187F82E10045882C /* ScrollingCoordinatorIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC4E407187F82E10045882C /* ScrollingCoordinatorIOS.h */; };
-               0FC4E410187F82E10045882C /* ScrollingTreeIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC4E40A187F82E10045882C /* ScrollingTreeIOS.h */; };
-               0FC4E411187F82E10045882C /* ScrollingTreeFrameScrollingNodeIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC4E40B187F82E10045882C /* ScrollingTreeFrameScrollingNodeIOS.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0FCF332F0F2B9A25004B6795 /* WebLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCF332B0F2B9A25004B6795 /* WebLayer.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0FD3080F117CF7E700A791F7 /* RenderFrameBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD3080D117CF7E700A791F7 /* RenderFrameBase.h */; };
                0FD308D6117D168500A791F7 /* RenderIFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD308D4117D168400A791F7 /* RenderIFrame.h */; };
                0FB8890D167D30160010CDA5 /* ScrollingStateStickyNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingStateStickyNode.h; sourceTree = "<group>"; };
                0FC05168219B5EBE0031C39E /* ScrollingTreeOverflowScrollingNodeMac.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollingTreeOverflowScrollingNodeMac.mm; sourceTree = "<group>"; };
                0FC0516A219B5EBE0031C39E /* ScrollingTreeOverflowScrollingNodeMac.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeOverflowScrollingNodeMac.h; sourceTree = "<group>"; };
-               0FC4E407187F82E10045882C /* ScrollingCoordinatorIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingCoordinatorIOS.h; sourceTree = "<group>"; };
-               0FC4E408187F82E10045882C /* ScrollingCoordinatorIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollingCoordinatorIOS.mm; sourceTree = "<group>"; };
-               0FC4E409187F82E10045882C /* ScrollingTreeIOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollingTreeIOS.cpp; sourceTree = "<group>"; };
-               0FC4E40A187F82E10045882C /* ScrollingTreeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeIOS.h; sourceTree = "<group>"; };
-               0FC4E40B187F82E10045882C /* ScrollingTreeFrameScrollingNodeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeFrameScrollingNodeIOS.h; sourceTree = "<group>"; };
-               0FC4E40C187F82E10045882C /* ScrollingTreeFrameScrollingNodeIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = 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>"; };
                        tabWidth = 4;
                        usesTabs = 0;
                };
-               0FC4E406187F82D30045882C /* ios */ = {
-                       isa = PBXGroup;
-                       children = (
-                               0FC4E407187F82E10045882C /* ScrollingCoordinatorIOS.h */,
-                               0FC4E408187F82E10045882C /* ScrollingCoordinatorIOS.mm */,
-                               0FC4E40B187F82E10045882C /* ScrollingTreeFrameScrollingNodeIOS.h */,
-                               0FC4E40C187F82E10045882C /* ScrollingTreeFrameScrollingNodeIOS.mm */,
-                               0FC4E409187F82E10045882C /* ScrollingTreeIOS.cpp */,
-                               0FC4E40A187F82E10045882C /* ScrollingTreeIOS.h */,
-                       );
-                       path = ios;
-                       sourceTree = "<group>";
-               };
                0FE5FBC91C3DD5060007A2CA /* displaylists */ = {
                        isa = PBXGroup;
                        children = (
                        isa = PBXGroup;
                        children = (
                                93EF7D531954E98F00DFB71D /* cocoa */,
-                               0FC4E406187F82D30045882C /* ios */,
                                1AF62EE214DA22A70041556C /* mac */,
                                0FFD4D5E18651FA300512F6E /* AsyncScrollingCoordinator.cpp */,
                                0FFD4D5F18651FA300512F6E /* AsyncScrollingCoordinator.h */,
                                1AA84F05143BA7BD0051D153 /* ScrollController.h in Headers */,
                                0F605AED15F94848004DF0C0 /* ScrollingConstraints.h in Headers */,
                                1AF62EE814DA22A70041556C /* ScrollingCoordinator.h in Headers */,
-                               0FC4E40D187F82E10045882C /* ScrollingCoordinatorIOS.h in Headers */,
                                9391A991162746CB00297330 /* ScrollingCoordinatorMac.h in Headers */,
                                712DBA4921F8AD83008F36B2 /* ScrollingCoordinatorTypes.h in Headers */,
                                51C61B0B1DE536E7008A212D /* ScrollingMomentumCalculator.h in Headers */,
                                0F94B6472208FE3600157014 /* ScrollingTreeFixedNode.h in Headers */,
                                0FD41E6821F80C0E000C006D /* ScrollingTreeFrameHostingNode.h in Headers */,
                                0FEA3E88191B3BD7000F1B55 /* ScrollingTreeFrameScrollingNode.h in Headers */,
-                               0FC4E411187F82E10045882C /* ScrollingTreeFrameScrollingNodeIOS.h in Headers */,
                                93C4A4151629DF5A00C3EB6E /* ScrollingTreeFrameScrollingNodeMac.h in Headers */,
-                               0FC4E410187F82E10045882C /* ScrollingTreeIOS.h in Headers */,
                                0FE5806419327A6200DE32EB /* ScrollingTreeMac.h in Headers */,
                                1AAADDE414DC8C8F00AF64B3 /* ScrollingTreeNode.h in Headers */,
                                0FEA3E80191B3169000F1B55 /* ScrollingTreeOverflowScrollingNode.h in Headers */,
index 2173dac..e0d1878 100644 (file)
@@ -305,7 +305,7 @@ public:
     LayoutPoint scrollPositionForFixedPosition() const;
     
     // Static function can be called from another thread.
-    static LayoutPoint scrollPositionForFixedPosition(const LayoutRect& visibleContentRect, const LayoutSize& totalContentsSize, const LayoutPoint& scrollPosition, const LayoutPoint& scrollOrigin, float frameScaleFactor, bool fixedElementsLayoutRelativeToFrame, ScrollBehaviorForFixedElements, int headerHeight, int footerHeight);
+    WEBCORE_EXPORT static LayoutPoint scrollPositionForFixedPosition(const LayoutRect& visibleContentRect, const LayoutSize& totalContentsSize, const LayoutPoint& scrollPosition, const LayoutPoint& scrollOrigin, float frameScaleFactor, bool fixedElementsLayoutRelativeToFrame, ScrollBehaviorForFixedElements, int headerHeight, int footerHeight);
 
     WEBCORE_EXPORT static LayoutSize expandedLayoutViewportSize(const LayoutSize& baseLayoutViewportSize, const LayoutSize& documentSize, double heightExpansionFactor);
 
index 22f9fc2..cb8afa8 100644 (file)
@@ -47,7 +47,7 @@
 
 namespace WebCore {
 
-#if !PLATFORM(COCOA) && !USE(COORDINATED_GRAPHICS)
+#if !PLATFORM(MAC) && !USE(COORDINATED_GRAPHICS)
 Ref<ScrollingCoordinator> ScrollingCoordinator::create(Page* page)
 {
     return adoptRef(*new ScrollingCoordinator(page));
index 68ba220..00345c0 100644 (file)
@@ -126,7 +126,7 @@ public:
     bool isHandlingProgrammaticScroll();
     
     void setScrollPinningBehavior(ScrollPinningBehavior);
-    ScrollPinningBehavior scrollPinningBehavior();
+    WEBCORE_EXPORT ScrollPinningBehavior scrollPinningBehavior();
 
     WEBCORE_EXPORT bool willWheelEventStartSwipeGesture(const PlatformWheelEvent&);
 
index 945da24..8f5a464 100644 (file)
@@ -35,7 +35,7 @@ class PlatformWheelEvent;
 class ScrollingTree;
 class ScrollingStateScrollingNode;
 
-class ScrollingTreeFrameScrollingNode : public ScrollingTreeScrollingNode {
+class WEBCORE_EXPORT ScrollingTreeFrameScrollingNode : public ScrollingTreeScrollingNode {
 public:
     virtual ~ScrollingTreeFrameScrollingNode();
 
@@ -44,8 +44,6 @@ public:
     // FIXME: We should implement this when we support ScrollingTreeScrollingNodes as children.
     void updateLayersAfterAncestorChange(const ScrollingTreeNode& /*changedNode*/, const FloatRect& /*fixedPositionRect*/, const FloatSize& /*cumulativeDelta*/) override { }
 
-    ScrollingEventResult handleWheelEvent(const PlatformWheelEvent&) override = 0;
-
     void updateLayersAfterViewportChange(const FloatRect& fixedPositionRect, double scale) override = 0;
     void updateLayersAfterDelegatedScroll(const FloatPoint&) override { }
 
@@ -76,10 +74,10 @@ protected:
     ScrollBehaviorForFixedElements scrollBehaviorForFixedElements() const { return m_behaviorForFixed; }
 
 private:
-    WEBCORE_EXPORT LayoutPoint parentToLocalPoint(LayoutPoint) const final;
-    WEBCORE_EXPORT LayoutPoint localToContentsPoint(LayoutPoint) const final;
+    LayoutPoint parentToLocalPoint(LayoutPoint) const final;
+    LayoutPoint localToContentsPoint(LayoutPoint) const final;
 
-    WEBCORE_EXPORT void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const override;
+    void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const override;
 
     FloatRect m_layoutViewport;
     FloatPoint m_minLayoutViewportOrigin;
index 6754a27..e9f58aa 100644 (file)
@@ -63,7 +63,7 @@ public:
     ScrollingTreeNode* parent() const { return m_parent; }
     void setParent(ScrollingTreeNode* parent) { m_parent = parent; }
     
-    bool isRootNode() const;
+    WEBCORE_EXPORT bool isRootNode() const;
 
     Vector<RefPtr<ScrollingTreeNode>>* children() { return m_children.get(); }
     const Vector<RefPtr<ScrollingTreeNode>>* children() const { return m_children.get(); }
index 6ccb6fd..45dafcc 100644 (file)
@@ -122,6 +122,11 @@ void ScrollingTreeScrollingNode::updateLayersAfterAncestorChange(const Scrolling
         child->updateLayersAfterAncestorChange(changedNode, fixedPositionRect, cumulativeDelta);
 }
 
+ScrollingEventResult ScrollingTreeScrollingNode::handleWheelEvent(const PlatformWheelEvent&)
+{
+    return ScrollingEventResult::DidNotHandleEvent;
+}
+
 void ScrollingTreeScrollingNode::setScrollPosition(const FloatPoint& scrollPosition, ScrollPositionClamp clamp)
 {
     FloatPoint newScrollPosition = scrollPosition;
index cb1ec97..b78483c 100644 (file)
@@ -38,7 +38,7 @@ namespace WebCore {
 class ScrollingTree;
 class ScrollingStateScrollingNode;
 
-class ScrollingTreeScrollingNode : public ScrollingTreeNode {
+class WEBCORE_EXPORT ScrollingTreeScrollingNode : public ScrollingTreeNode {
     friend class ScrollingTreeScrollingNodeDelegate;
 #if PLATFORM(MAC)
     friend class ScrollingTreeScrollingNodeDelegateMac;
@@ -47,13 +47,13 @@ class ScrollingTreeScrollingNode : public ScrollingTreeNode {
 public:
     virtual ~ScrollingTreeScrollingNode();
 
-    WEBCORE_EXPORT void commitStateBeforeChildren(const ScrollingStateNode&) override;
-    WEBCORE_EXPORT void commitStateAfterChildren(const ScrollingStateNode&) override;
+    void commitStateBeforeChildren(const ScrollingStateNode&) override;
+    void commitStateAfterChildren(const ScrollingStateNode&) override;
 
-    WEBCORE_EXPORT void updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta) override;
+    void updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta) override;
 
-    virtual ScrollingEventResult handleWheelEvent(const PlatformWheelEvent&) = 0;
-    WEBCORE_EXPORT virtual void setScrollPosition(const FloatPoint&, ScrollPositionClamp = ScrollPositionClamp::ToContentEdges);
+    virtual ScrollingEventResult handleWheelEvent(const PlatformWheelEvent&);
+    virtual void setScrollPosition(const FloatPoint&, ScrollPositionClamp = ScrollPositionClamp::ToContentEdges);
 
     void scrollBy(const FloatSize&, ScrollPositionClamp = ScrollPositionClamp::ToContentEdges);
 
@@ -78,13 +78,13 @@ public:
     bool useDarkAppearanceForScrollbars() const { return m_scrollableAreaParameters.useDarkAppearanceForScrollbars; }
 
     bool scrollLimitReached(const PlatformWheelEvent&) const;
-    WEBCORE_EXPORT ScrollingTreeScrollingNode* scrollingNodeForPoint(LayoutPoint) const override;
+    ScrollingTreeScrollingNode* scrollingNodeForPoint(LayoutPoint) const override;
 
 protected:
     ScrollingTreeScrollingNode(ScrollingTree&, ScrollingNodeType, ScrollingNodeID);
 
-    WEBCORE_EXPORT virtual FloatPoint minimumScrollPosition() const;
-    WEBCORE_EXPORT virtual FloatPoint maximumScrollPosition() const;
+    virtual FloatPoint minimumScrollPosition() const;
+    virtual FloatPoint maximumScrollPosition() const;
 
     FloatPoint clampScrollPosition(const FloatPoint&) const;
 
@@ -116,10 +116,10 @@ protected:
     CALayer *scrolledContentsLayer() const { return m_scrolledContentsLayer.get(); }
 #endif
 
-    WEBCORE_EXPORT LayoutPoint parentToLocalPoint(LayoutPoint) const override;
-    WEBCORE_EXPORT LayoutPoint localToContentsPoint(LayoutPoint) const override;
+    LayoutPoint parentToLocalPoint(LayoutPoint) const override;
+    LayoutPoint localToContentsPoint(LayoutPoint) const override;
 
-    WEBCORE_EXPORT void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const override;
+    void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const override;
 
 private:
     FloatSize m_scrollableAreaSize;
diff --git a/Source/WebCore/page/scrolling/ios/ScrollingCoordinatorIOS.h b/Source/WebCore/page/scrolling/ios/ScrollingCoordinatorIOS.h
deleted file mode 100644 (file)
index 9cf639e..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * 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.
- */
-
-#pragma once
-
-#if ENABLE(ASYNC_SCROLLING) && PLATFORM(IOS_FAMILY)
-
-#include "AsyncScrollingCoordinator.h"
-
-namespace WebCore {
-
-class Scrollbar;
-class ScrollingStateNode;
-class ScrollingStateScrollingNode;
-class ScrollingStateTree;
-class ThreadedScrollingTree;
-
-class ScrollingCoordinatorIOS : public AsyncScrollingCoordinator {
-public:
-    explicit ScrollingCoordinatorIOS(Page*);
-    virtual ~ScrollingCoordinatorIOS();
-
-    void pageDestroyed() override;
-
-    void commitTreeStateIfNeeded() override;
-
-    // Handle the wheel event on the scrolling thread. Returns whether the event was handled or not.
-    ScrollingEventResult handleWheelEvent(FrameView&, const PlatformWheelEvent&) override { return ScrollingEventResult::DidNotHandleEvent; }
-
-private:
-    void scheduleTreeStateCommit() override;
-
-    void commitTreeState();
-
-    Timer m_scrollingStateTreeCommitterTimer;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(ASYNC_SCROLLING) && PLATFORM(IOS_FAMILY)
diff --git a/Source/WebCore/page/scrolling/ios/ScrollingCoordinatorIOS.mm b/Source/WebCore/page/scrolling/ios/ScrollingCoordinatorIOS.mm
deleted file mode 100644 (file)
index 8b08a13..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * 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"
-
-#if ENABLE(ASYNC_SCROLLING) && PLATFORM(IOS_FAMILY)
-
-#import "ScrollingCoordinatorIOS.h"
-
-#include "Frame.h"
-#include "FrameView.h"
-#include "Page.h"
-#include "Region.h"
-#include "ScrollingStateTree.h"
-#include "ScrollingThread.h"
-#include "ScrollingTreeFixedNode.h"
-#include "ScrollingTreeFrameScrollingNodeIOS.h"
-#include "ScrollingTreeStickyNode.h"
-#include "ScrollingTreeIOS.h"
-#include <wtf/MainThread.h>
-
-namespace WebCore {
-
-Ref<ScrollingCoordinator> ScrollingCoordinator::create(Page* page)
-{
-    return adoptRef(*new ScrollingCoordinatorIOS(page));
-}
-
-ScrollingCoordinatorIOS::ScrollingCoordinatorIOS(Page* page)
-    : AsyncScrollingCoordinator(page)
-    , m_scrollingStateTreeCommitterTimer(*this, &ScrollingCoordinatorIOS::commitTreeState)
-{
-    setScrollingTree(ScrollingTreeIOS::create(*this));
-}
-
-ScrollingCoordinatorIOS::~ScrollingCoordinatorIOS()
-{
-    ASSERT(!scrollingTree());
-}
-
-void ScrollingCoordinatorIOS::pageDestroyed()
-{
-    AsyncScrollingCoordinator::pageDestroyed();
-
-    m_scrollingStateTreeCommitterTimer.stop();
-
-    // Invalidating the scrolling tree will break the reference cycle between the ScrollingCoordinator and ScrollingTree objects.
-    releaseScrollingTree();
-}
-
-void ScrollingCoordinatorIOS::commitTreeStateIfNeeded()
-{
-    if (!scrollingStateTree()->hasChangedProperties())
-        return;
-
-    commitTreeState();
-    m_scrollingStateTreeCommitterTimer.stop();
-}
-
-void ScrollingCoordinatorIOS::scheduleTreeStateCommit()
-{
-    ASSERT(scrollingStateTree()->hasChangedProperties());
-
-    if (m_scrollingStateTreeCommitterTimer.isActive())
-        return;
-
-    m_scrollingStateTreeCommitterTimer.startOneShot(0_s);
-}
-
-void ScrollingCoordinatorIOS::commitTreeState()
-{
-    ASSERT(scrollingStateTree()->hasChangedProperties());
-
-    scrollingStateTree()->commit(LayerRepresentation::PlatformLayerRepresentation);
-    // FIXME: figure out how to commit.
-}
-
-
-} // namespace WebCore
-
-#endif // ENABLE(ASYNC_SCROLLING) && PLATFORM(IOS_FAMILY)
diff --git a/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h b/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h
deleted file mode 100644 (file)
index f2fa210..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * 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.
- */
-
-#pragma once
-
-#if ENABLE(ASYNC_SCROLLING) && PLATFORM(IOS_FAMILY)
-
-#include "ScrollingTreeFrameScrollingNode.h"
-#include <wtf/RetainPtr.h>
-
-OBJC_CLASS CALayer;
-
-namespace WebCore {
-
-class WEBCORE_EXPORT ScrollingTreeFrameScrollingNodeIOS : public ScrollingTreeFrameScrollingNode {
-public:
-    static Ref<ScrollingTreeFrameScrollingNodeIOS> create(ScrollingTree&, ScrollingNodeType, ScrollingNodeID);
-    virtual ~ScrollingTreeFrameScrollingNodeIOS();
-
-protected:
-    ScrollingTreeFrameScrollingNodeIOS(ScrollingTree&, ScrollingNodeType, ScrollingNodeID);
-
-    // ScrollingTreeNode member functions.
-    void commitStateBeforeChildren(const ScrollingStateNode&) override;
-    void commitStateAfterChildren(const ScrollingStateNode&) override;
-
-    ScrollingEventResult handleWheelEvent(const PlatformWheelEvent&) override;
-
-    FloatPoint scrollPosition() const override;
-
-    void updateLayersAfterViewportChange(const FloatRect& fixedPositionRect, double scale) override;
-    void updateLayersAfterDelegatedScroll(const FloatPoint&) override;
-    void updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta) override;
-
-    void setScrollPosition(const FloatPoint&, ScrollPositionClamp = ScrollPositionClamp::ToContentEdges) override;
-    void setScrollLayerPosition(const FloatPoint&, const FloatRect& layoutViewport) override;
-
-    FloatPoint minimumScrollPosition() const override;
-    FloatPoint maximumScrollPosition() const override;
-
-private:
-    void updateChildNodesAfterScroll(const FloatPoint&);
-
-    RetainPtr<CALayer> m_counterScrollingLayer;
-    RetainPtr<CALayer> m_headerLayer;
-    RetainPtr<CALayer> m_footerLayer;
-    FloatPoint m_probableMainThreadScrollPosition;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(ASYNC_SCROLLING) && PLATFORM(IOS_FAMILY)
diff --git a/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm b/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm
deleted file mode 100644 (file)
index 9aaaab8..0000000
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * 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.
- */
-
-#import "config.h"
-#import "ScrollingTreeFrameScrollingNodeIOS.h"
-
-#if ENABLE(ASYNC_SCROLLING) && PLATFORM(IOS_FAMILY)
-
-#import "FrameView.h"
-#import "ScrollingCoordinator.h"
-#import "ScrollingStateFrameScrollingNode.h"
-#import "ScrollingStateTree.h"
-#import "ScrollingTree.h"
-#import "TileController.h"
-#import "WebLayer.h"
-#import <QuartzCore/QuartzCore.h>
-
-namespace WebCore {
-
-Ref<ScrollingTreeFrameScrollingNodeIOS> ScrollingTreeFrameScrollingNodeIOS::create(ScrollingTree& scrollingTree, ScrollingNodeType nodeType, ScrollingNodeID nodeID)
-{
-    return adoptRef(*new ScrollingTreeFrameScrollingNodeIOS(scrollingTree, nodeType, nodeID));
-}
-
-ScrollingTreeFrameScrollingNodeIOS::ScrollingTreeFrameScrollingNodeIOS(ScrollingTree& scrollingTree, ScrollingNodeType nodeType, ScrollingNodeID nodeID)
-    : ScrollingTreeFrameScrollingNode(scrollingTree, nodeType, nodeID)
-{
-}
-
-ScrollingTreeFrameScrollingNodeIOS::~ScrollingTreeFrameScrollingNodeIOS()
-{
-}
-
-void ScrollingTreeFrameScrollingNodeIOS::commitStateBeforeChildren(const ScrollingStateNode& stateNode)
-{
-    ScrollingTreeFrameScrollingNode::commitStateBeforeChildren(stateNode);
-    
-    const auto& scrollingStateNode = downcast<ScrollingStateFrameScrollingNode>(stateNode);
-
-    if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer))
-        m_counterScrollingLayer = scrollingStateNode.counterScrollingLayer();
-
-    if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::HeaderLayer))
-        m_headerLayer = scrollingStateNode.headerLayer();
-
-    if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::FooterLayer))
-        m_footerLayer = scrollingStateNode.footerLayer();
-
-    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.
-            if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition))
-                m_probableMainThreadScrollPosition = scrollingStateNode.requestedScrollPosition();
-            else {
-                CGPoint scrollLayerPosition = scrolledContentsLayer().position;
-                m_probableMainThreadScrollPosition = IntPoint(-scrollLayerPosition.x, -scrollLayerPosition.y);
-            }
-        }
-    }
-}
-
-void ScrollingTreeFrameScrollingNodeIOS::commitStateAfterChildren(const ScrollingStateNode& stateNode)
-{
-    ScrollingTreeFrameScrollingNode::commitStateAfterChildren(stateNode);
-
-    const auto& scrollingStateNode = downcast<ScrollingStateFrameScrollingNode>(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());
-}
-
-ScrollingEventResult ScrollingTreeFrameScrollingNodeIOS::handleWheelEvent(const PlatformWheelEvent&)
-{
-    return ScrollingEventResult::DidNotHandleEvent;
-}
-
-FloatPoint ScrollingTreeFrameScrollingNodeIOS::scrollPosition() const
-{
-    if (shouldUpdateScrollLayerPositionSynchronously())
-        return m_probableMainThreadScrollPosition;
-
-    return -scrolledContentsLayer().position;
-}
-
-void ScrollingTreeFrameScrollingNodeIOS::setScrollPosition(const FloatPoint& position, ScrollPositionClamp clamp)
-{
-    auto scrollPosition = position;
-    if (clamp == ScrollPositionClamp::ToContentEdges)
-        scrollPosition = clampScrollPosition(scrollPosition);
-
-    if (shouldUpdateScrollLayerPositionSynchronously()) {
-        m_probableMainThreadScrollPosition = scrollPosition;
-        scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition, WTF::nullopt, ScrollingLayerPositionAction::Set);
-        return;
-    }
-
-    FloatRect layoutViewport; // FIXME: implement for iOS WK1.
-    setScrollLayerPosition(scrollPosition, layoutViewport);
-    scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition, WTF::nullopt);
-}
-
-void ScrollingTreeFrameScrollingNodeIOS::setScrollLayerPosition(const FloatPoint& scrollPosition, const FloatRect&)
-{
-    ASSERT(!shouldUpdateScrollLayerPositionSynchronously());
-    [scrolledContentsLayer() setPosition:-scrollPosition];
-
-    updateChildNodesAfterScroll(scrollPosition);
-}
-
-void ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterViewportChange(const FloatRect& fixedPositionRect, double /*scale*/)
-{
-    // Note: we never currently have a m_counterScrollingLayer (which is used for background-attachment:fixed) on iOS.
-    [m_counterScrollingLayer setPosition:fixedPositionRect.location()];
-
-    if (!m_children)
-        return;
-
-    for (auto& child : *m_children)
-        child->updateLayersAfterAncestorChange(*this, fixedPositionRect, FloatSize());
-}
-
-void ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect&, const FloatSize&)
-{
-    if (!m_children)
-        return;
-
-    FloatRect fixedPositionRect(scrollPosition(), scrollableAreaSize());
-    for (auto& child : *m_children)
-        child->updateLayersAfterAncestorChange(changedNode, fixedPositionRect, FloatSize());
-}
-
-void ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterDelegatedScroll(const FloatPoint& scrollPosition)
-{
-    updateChildNodesAfterScroll(scrollPosition);
-}
-
-void ScrollingTreeFrameScrollingNodeIOS::updateChildNodesAfterScroll(const FloatPoint& scrollPosition)
-{
-    ScrollBehaviorForFixedElements behaviorForFixed = scrollBehaviorForFixedElements();
-    FloatRect viewportRect(scrollPosition, scrollableAreaSize());
-    FloatPoint scrollPositionForFixedChildren = FrameView::scrollPositionForFixedPosition(enclosingLayoutRect(viewportRect), LayoutSize(totalContentsSize()), LayoutPoint(scrollPosition), scrollOrigin(), frameScaleFactor(), fixedElementsLayoutRelativeToFrame(), behaviorForFixed, headerHeight(), footerHeight());
-
-    [m_counterScrollingLayer setPosition:scrollPositionForFixedChildren];
-
-    if (m_headerLayer || m_footerLayer) {
-        // Generally the banners should have the same horizontal-position computation as a fixed element. However,
-        // the banners are not affected by the frameScaleFactor(), so if there is currently a non-1 frameScaleFactor()
-        // then we should recompute scrollPositionForFixedChildren for the banner with a scale factor of 1.
-        float horizontalScrollOffsetForBanner = scrollPositionForFixedChildren.x();
-        if (frameScaleFactor() != 1)
-            horizontalScrollOffsetForBanner = FrameView::scrollPositionForFixedPosition(enclosingLayoutRect(viewportRect), LayoutSize(totalContentsSize()), LayoutPoint(scrollPosition), scrollOrigin(), 1, fixedElementsLayoutRelativeToFrame(), behaviorForFixed, headerHeight(), footerHeight()).x();
-
-        if (m_headerLayer)
-            [m_headerLayer setPosition:FloatPoint(horizontalScrollOffsetForBanner, 0)];
-
-        if (m_footerLayer)
-            [m_footerLayer setPosition:FloatPoint(horizontalScrollOffsetForBanner, totalContentsSize().height() - footerHeight())];
-    }
-    
-    if (!m_children)
-        return;
-
-
-    FloatRect fixedPositionRect;
-    if (!parent())
-        fixedPositionRect = scrollingTree().fixedPositionRect();
-    else
-        fixedPositionRect = FloatRect(scrollPosition, scrollableAreaSize());
-
-    for (auto& child : *m_children)
-        child->updateLayersAfterAncestorChange(*this, fixedPositionRect, FloatSize());
-}
-
-FloatPoint ScrollingTreeFrameScrollingNodeIOS::minimumScrollPosition() const
-{
-    FloatPoint position = ScrollableArea::scrollPositionFromOffset(FloatPoint(), toFloatSize(scrollOrigin()));
-    
-    if (scrollingTree().rootNode() == this && scrollingTree().scrollPinningBehavior() == PinToBottom)
-        position.setY(maximumScrollPosition().y());
-
-    return position;
-}
-
-FloatPoint ScrollingTreeFrameScrollingNodeIOS::maximumScrollPosition() const
-{
-    FloatPoint position = ScrollableArea::scrollPositionFromOffset(FloatPoint(totalContentsSizeForRubberBand() - scrollableAreaSize()), toFloatSize(scrollOrigin()));
-    position = position.expandedTo(FloatPoint());
-
-    if (scrollingTree().rootNode() == this && scrollingTree().scrollPinningBehavior() == PinToTop)
-        position.setY(minimumScrollPosition().y());
-
-    return position;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(ASYNC_SCROLLING) && PLATFORM(IOS_FAMILY)
diff --git a/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.cpp b/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.cpp
deleted file mode 100644 (file)
index ac9e861..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * 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 "ScrollingTreeIOS.h"
-
-#if ENABLE(ASYNC_SCROLLING) && PLATFORM(IOS_FAMILY)
-
-#include "AsyncScrollingCoordinator.h"
-#include "PlatformWheelEvent.h"
-#include "ScrollingThread.h"
-#include "ScrollingTreeFixedNode.h"
-#include "ScrollingTreeFrameHostingNode.h"
-#include "ScrollingTreeFrameScrollingNodeIOS.h"
-#include "ScrollingTreeNode.h"
-#include "ScrollingTreeScrollingNode.h"
-#include "ScrollingTreeStickyNode.h"
-#include <wtf/MainThread.h>
-
-namespace WebCore {
-
-Ref<ScrollingTreeIOS> ScrollingTreeIOS::create(AsyncScrollingCoordinator& scrollingCoordinator)
-{
-    return adoptRef(*new ScrollingTreeIOS(scrollingCoordinator));
-}
-
-ScrollingTreeIOS::ScrollingTreeIOS(AsyncScrollingCoordinator& scrollingCoordinator)
-    : m_scrollingCoordinator(&scrollingCoordinator)
-{
-}
-
-ScrollingTreeIOS::~ScrollingTreeIOS()
-{
-    // invalidate() should have cleared m_scrollingCoordinator.
-    ASSERT(!m_scrollingCoordinator);
-}
-
-void ScrollingTreeIOS::invalidate()
-{
-    // Invalidate is dispatched by the ScrollingCoordinator class on the ScrollingThread
-    // to break the reference cycle between ScrollingTree and ScrollingCoordinator when the
-    // ScrollingCoordinator's page is destroyed.
-    ASSERT(ScrollingThread::isCurrentThread());
-
-    // Since this can potentially be the last reference to the scrolling coordinator,
-    // we need to release it on the main thread since it has member variables (such as timers)
-    // that expect to be destroyed from the main thread.
-    callOnMainThread([scrollingCoordinator = WTFMove(m_scrollingCoordinator)] {
-    });
-}
-
-void ScrollingTreeIOS::scrollingTreeNodeDidScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, const Optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction scrollingLayerPositionAction)
-{
-    if (!m_scrollingCoordinator)
-        return;
-
-    if (nodeID == rootNode()->scrollingNodeID())
-        setMainFrameScrollPosition(scrollPosition);
-
-    callOnMainThread([scrollingCoordinator = m_scrollingCoordinator, nodeID, scrollPosition, layoutViewportOrigin, localIsHandlingProgrammaticScroll = isHandlingProgrammaticScroll(), scrollingLayerPositionAction] {
-        scrollingCoordinator->scheduleUpdateScrollPositionAfterAsyncScroll(nodeID, scrollPosition, layoutViewportOrigin, localIsHandlingProgrammaticScroll, scrollingLayerPositionAction);
-    });
-}
-
-Ref<ScrollingTreeNode> ScrollingTreeIOS::createScrollingTreeNode(ScrollingNodeType nodeType, ScrollingNodeID nodeID)
-{
-    switch (nodeType) {
-    case ScrollingNodeType::MainFrame:
-    case ScrollingNodeType::Subframe:
-        return ScrollingTreeFrameScrollingNodeIOS::create(*this, nodeType, nodeID);
-    case ScrollingNodeType::FrameHosting:
-        return ScrollingTreeFrameHostingNode::create(*this, nodeID);
-    case ScrollingNodeType::Overflow:
-        ASSERT_NOT_REACHED();
-        break;
-    case ScrollingNodeType::Fixed:
-        return ScrollingTreeFixedNode::create(*this, nodeID);
-    case ScrollingNodeType::Sticky:
-        return ScrollingTreeStickyNode::create(*this, nodeID);
-    }
-    ASSERT_NOT_REACHED();
-    return ScrollingTreeFixedNode::create(*this, nodeID);
-}
-
-FloatRect ScrollingTreeIOS::fixedPositionRect()
-{
-    // When ScrollingTreeIOS starts being used for WK1 on iOS, this needs to get the customFixedPositionRect from
-    // the ScrollingCoordinator.
-    ASSERT_NOT_REACHED();
-    return FloatRect();
-}
-
-void ScrollingTreeIOS::currentSnapPointIndicesDidChange(WebCore::ScrollingNodeID nodeID, unsigned horizontal, unsigned vertical)
-{
-    if (!m_scrollingCoordinator)
-        return;
-    
-    callOnMainThread([scrollingCoordinator = m_scrollingCoordinator, nodeID, horizontal, vertical] {
-        scrollingCoordinator->setActiveScrollSnapIndices(nodeID, horizontal, vertical);
-    });
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(ASYNC_SCROLLING) && PLATFORM(IOS_FAMILY)
diff --git a/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.h b/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.h
deleted file mode 100644 (file)
index e9035d0..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * 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.
- */
-
-#pragma once
-
-#if ENABLE(ASYNC_SCROLLING) && PLATFORM(IOS_FAMILY)
-
-#include "ScrollingStateTree.h"
-#include "ScrollingTree.h"
-
-namespace WebCore {
-
-class AsyncScrollingCoordinator;
-
-class ScrollingTreeIOS final : public ScrollingTree {
-public:
-    static Ref<ScrollingTreeIOS> create(AsyncScrollingCoordinator&);
-    virtual ~ScrollingTreeIOS();
-
-private:
-    explicit ScrollingTreeIOS(AsyncScrollingCoordinator&);
-
-    bool isScrollingTreeIOS() const final { return true; }
-
-    // No wheel events on iOS
-    ScrollingEventResult handleWheelEvent(const PlatformWheelEvent&) final { return ScrollingEventResult::DidNotHandleEvent; }
-    ScrollingEventResult tryToHandleWheelEvent(const PlatformWheelEvent&) final { return ScrollingEventResult::DidNotHandleEvent; }
-
-    void invalidate() final;
-
-    Ref<ScrollingTreeNode> createScrollingTreeNode(ScrollingNodeType, ScrollingNodeID) final;
-    void scrollingTreeNodeDidScroll(ScrollingNodeID, const FloatPoint& scrollPosition, const Optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction = ScrollingLayerPositionAction::Sync) final;
-    void currentSnapPointIndicesDidChange(WebCore::ScrollingNodeID, unsigned horizontal, unsigned vertical) final;
-    FloatRect fixedPositionRect() final;
-
-    RefPtr<AsyncScrollingCoordinator> m_scrollingCoordinator;
-};
-
-} // namespace WebCore
-
-SPECIALIZE_TYPE_TRAITS_SCROLLING_TREE(WebCore::ScrollingTreeIOS, isScrollingTreeIOS())
-
-#endif // ENABLE(ASYNC_SCROLLING) && PLATFORM(IOS_FAMILY)
index 211ac8d..3b66c6a 100644 (file)
@@ -237,8 +237,7 @@ void ScrollingTreeFrameScrollingNodeMac::setScrollPosition(const FloatPoint& pos
     // FIXME: wrong if we're not the main frame.
     updateMainFramePinState(scrollPosition);
 
-    FloatPoint visibleContentOrigin = scrollPosition;
-    FloatRect newLayoutViewport = layoutViewportForScrollPosition(visibleContentOrigin, frameScaleFactor());
+    FloatRect newLayoutViewport = layoutViewportForScrollPosition(scrollPosition, frameScaleFactor());
     setLayoutViewport(newLayoutViewport);
     auto layoutViewportOrigin = newLayoutViewport.location();
 
index f15f266..7e8eff3 100644 (file)
@@ -1,3 +1,32 @@
+2019-02-23  Simon Fraser  <simon.fraser@apple.com>
+
+        Remove remnants of iOS WK1 scrolling tree code
+        https://bugs.webkit.org/show_bug.cgi?id=194980
+
+        Reviewed by Sam Weinig.
+
+        Remove ScrollingTreeIOS and ScrollingCoordinatorIOS which were never instantiated.
+
+        Merge ScrollingTreeFrameScrollingNodeIOS into ScrollingTreeFrameScrollingNodeRemoteIOS,
+        removing code which never applies to iOS WK2 (e.g. the synchronous scrolling code path).
+
+        * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
+        * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
+        * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
+        (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::ScrollingTreeFrameScrollingNodeRemoteIOS):
+        (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
+        (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
+        (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::minimumScrollPosition const):
+        (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::maximumScrollPosition const):
+        (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const):
+        (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollPosition):
+        (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition):
+        (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll):
+        (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll):
+        (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange):
+        (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
+        * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
+
 2019-02-23  Keith Miller  <keith_miller@apple.com>
 
         Add new mac target numbers
index f30e25c..8d50ec9 100644 (file)
@@ -37,7 +37,6 @@
 #if PLATFORM(IOS_FAMILY)
 #include "ScrollingTreeFrameScrollingNodeRemoteIOS.h"
 #include "ScrollingTreeOverflowScrollingNodeIOS.h"
-#include <WebCore/ScrollingTreeFrameScrollingNodeIOS.h>
 #else
 #include "ScrollingTreeFrameScrollingNodeRemoteMac.h"
 #endif
index e4feb81..ddd86c4 100644 (file)
 
 #if ENABLE(ASYNC_SCROLLING) && PLATFORM(IOS_FAMILY)
 
-#include <WebCore/ScrollingTreeFrameScrollingNodeIOS.h>
+#include <WebCore/ScrollingTreeFrameScrollingNode.h>
 
 namespace WebKit {
 
 class ScrollingTreeScrollingNodeDelegateIOS;
 
-class ScrollingTreeFrameScrollingNodeRemoteIOS : public WebCore::ScrollingTreeFrameScrollingNodeIOS {
+class ScrollingTreeFrameScrollingNodeRemoteIOS : public WebCore::ScrollingTreeFrameScrollingNode {
 public:
     static Ref<ScrollingTreeFrameScrollingNodeRemoteIOS> create(WebCore::ScrollingTree&, WebCore::ScrollingNodeType, WebCore::ScrollingNodeID);
     virtual ~ScrollingTreeFrameScrollingNodeRemoteIOS();
@@ -44,13 +44,24 @@ private:
     void commitStateBeforeChildren(const WebCore::ScrollingStateNode&) override;
     void commitStateAfterChildren(const WebCore::ScrollingStateNode&) override;
 
+    FloatPoint minimumScrollPosition() const override;
+    FloatPoint maximumScrollPosition() const override;
+
     WebCore::FloatPoint scrollPosition() const override;
+    void setScrollPosition(const WebCore::FloatPoint&, WebCore::ScrollPositionClamp = WebCore::ScrollPositionClamp::ToContentEdges) override;
     void setScrollLayerPosition(const WebCore::FloatPoint&, const WebCore::FloatRect& layoutViewport) override;
 
+    void updateChildNodesAfterScroll(const FloatPoint&);
+
     void updateLayersAfterDelegatedScroll(const WebCore::FloatPoint& scrollPosition) override;
+    void updateLayersAfterViewportChange(const WebCore::FloatRect& fixedPositionRect, double scale) override;
     void updateLayersAfterAncestorChange(const WebCore::ScrollingTreeNode& changedNode, const WebCore::FloatRect& fixedPositionRect, const WebCore::FloatSize& cumulativeDelta) override;
 
     std::unique_ptr<ScrollingTreeScrollingNodeDelegateIOS> m_scrollingNodeDelegate;
+
+    RetainPtr<CALayer> m_counterScrollingLayer;
+    RetainPtr<CALayer> m_headerLayer;
+    RetainPtr<CALayer> m_footerLayer;
 };
 
 } // namespace WebKit
index 78ab20e..5fb10a2 100644 (file)
@@ -40,7 +40,7 @@ Ref<ScrollingTreeFrameScrollingNodeRemoteIOS> ScrollingTreeFrameScrollingNodeRem
 }
 
 ScrollingTreeFrameScrollingNodeRemoteIOS::ScrollingTreeFrameScrollingNodeRemoteIOS(ScrollingTree& scrollingTree, ScrollingNodeType nodeType, ScrollingNodeID nodeID)
-    : ScrollingTreeFrameScrollingNodeIOS(scrollingTree, nodeType, nodeID)
+    : ScrollingTreeFrameScrollingNode(scrollingTree, nodeType, nodeID)
 {
 }
 
@@ -50,7 +50,18 @@ ScrollingTreeFrameScrollingNodeRemoteIOS::~ScrollingTreeFrameScrollingNodeRemote
 
 void ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren(const ScrollingStateNode& stateNode)
 {
-    ScrollingTreeFrameScrollingNodeIOS::commitStateBeforeChildren(stateNode);
+    ScrollingTreeFrameScrollingNode::commitStateBeforeChildren(stateNode);
+    
+    const auto& scrollingStateNode = downcast<ScrollingStateFrameScrollingNode>(stateNode);
+
+    if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer))
+        m_counterScrollingLayer = scrollingStateNode.counterScrollingLayer();
+
+    if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::HeaderLayer))
+        m_headerLayer = scrollingStateNode.headerLayer();
+
+    if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::FooterLayer))
+        m_footerLayer = scrollingStateNode.footerLayer();
 
     if (stateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollContainerLayer)) {
         if (scrollContainerLayer())
@@ -65,19 +76,37 @@ void ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren(const S
 
 void ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren(const ScrollingStateNode& stateNode)
 {
-    ScrollingTreeFrameScrollingNodeIOS::commitStateAfterChildren(stateNode);
+    ScrollingTreeFrameScrollingNode::commitStateAfterChildren(stateNode);
+
+    const auto& scrollingStateNode = downcast<ScrollingStateFrameScrollingNode>(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());
 
     if (m_scrollingNodeDelegate)
         m_scrollingNodeDelegate->commitStateAfterChildren(downcast<ScrollingStateScrollingNode>(stateNode));
 }
 
-void ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta)
+FloatPoint ScrollingTreeFrameScrollingNodeRemoteIOS::minimumScrollPosition() const
 {
-    if (m_scrollingNodeDelegate) {
-        m_scrollingNodeDelegate->updateLayersAfterAncestorChange(changedNode, fixedPositionRect, cumulativeDelta);
-        return;
-    }
-    ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterAncestorChange(changedNode, fixedPositionRect, cumulativeDelta);
+    FloatPoint position = ScrollableArea::scrollPositionFromOffset(FloatPoint(), toFloatSize(scrollOrigin()));
+    
+    if (isRootNode() && scrollingTree().scrollPinningBehavior() == PinToBottom)
+        position.setY(maximumScrollPosition().y());
+
+    return position;
+}
+
+FloatPoint ScrollingTreeFrameScrollingNodeRemoteIOS::maximumScrollPosition() const
+{
+    FloatPoint position = ScrollableArea::scrollPositionFromOffset(FloatPoint(totalContentsSizeForRubberBand() - scrollableAreaSize()), toFloatSize(scrollOrigin()));
+    position = position.expandedTo(FloatPoint());
+
+    if (isRootNode() && scrollingTree().scrollPinningBehavior() == PinToTop)
+        position.setY(minimumScrollPosition().y());
+
+    return position;
 }
 
 FloatPoint ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition() const
@@ -85,7 +114,21 @@ FloatPoint ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition() const
     if (m_scrollingNodeDelegate)
         return m_scrollingNodeDelegate->scrollPosition();
 
-    return ScrollingTreeFrameScrollingNodeIOS::scrollPosition();
+    return -scrolledContentsLayer().position;
+}
+
+void ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollPosition(const FloatPoint& position, ScrollPositionClamp clamp)
+{
+    auto scrollPosition = position;
+    if (clamp == ScrollPositionClamp::ToContentEdges)
+        scrollPosition = clampScrollPosition(scrollPosition);
+
+    FloatRect newLayoutViewport = layoutViewportForScrollPosition(scrollPosition, frameScaleFactor());
+    setLayoutViewport(newLayoutViewport);
+    auto layoutViewportOrigin = newLayoutViewport.location();
+
+    setScrollLayerPosition(scrollPosition, layoutViewport());
+    scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition, layoutViewportOrigin);
 }
 
 void ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition(const FloatPoint& scrollPosition, const FloatRect& layoutViewport)
@@ -94,7 +137,46 @@ void ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition(const Floa
         m_scrollingNodeDelegate->setScrollLayerPosition(scrollPosition);
         return;
     }
-    ScrollingTreeFrameScrollingNodeIOS::setScrollLayerPosition(scrollPosition, layoutViewport);
+
+    [scrolledContentsLayer() setPosition:-scrollPosition];
+    updateChildNodesAfterScroll(scrollPosition);
+}
+
+void ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll(const FloatPoint& scrollPosition)
+{
+    ScrollBehaviorForFixedElements behaviorForFixed = scrollBehaviorForFixedElements();
+    FloatRect viewportRect(scrollPosition, scrollableAreaSize());
+    FloatPoint scrollPositionForFixedChildren = FrameView::scrollPositionForFixedPosition(enclosingLayoutRect(viewportRect), LayoutSize(totalContentsSize()), LayoutPoint(scrollPosition), scrollOrigin(), frameScaleFactor(), fixedElementsLayoutRelativeToFrame(), behaviorForFixed, headerHeight(), footerHeight());
+
+    [m_counterScrollingLayer setPosition:scrollPositionForFixedChildren];
+
+    if (m_headerLayer || m_footerLayer) {
+        // Generally the banners should have the same horizontal-position computation as a fixed element. However,
+        // the banners are not affected by the frameScaleFactor(), so if there is currently a non-1 frameScaleFactor()
+        // then we should recompute scrollPositionForFixedChildren for the banner with a scale factor of 1.
+        float horizontalScrollOffsetForBanner = scrollPositionForFixedChildren.x();
+        if (frameScaleFactor() != 1)
+            horizontalScrollOffsetForBanner = FrameView::scrollPositionForFixedPosition(enclosingLayoutRect(viewportRect), LayoutSize(totalContentsSize()), LayoutPoint(scrollPosition), scrollOrigin(), 1, fixedElementsLayoutRelativeToFrame(), behaviorForFixed, headerHeight(), footerHeight()).x();
+
+        if (m_headerLayer)
+            [m_headerLayer setPosition:FloatPoint(horizontalScrollOffsetForBanner, 0)];
+
+        if (m_footerLayer)
+            [m_footerLayer setPosition:FloatPoint(horizontalScrollOffsetForBanner, totalContentsSize().height() - footerHeight())];
+    }
+    
+    if (!m_children)
+        return;
+
+
+    FloatRect fixedPositionRect;
+    if (!parent())
+        fixedPositionRect = scrollingTree().fixedPositionRect();
+    else
+        fixedPositionRect = FloatRect(scrollPosition, scrollableAreaSize());
+
+    for (auto& child : *m_children)
+        child->updateLayersAfterAncestorChange(*this, fixedPositionRect, FloatSize());
 }
 
 void ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll(const FloatPoint& scrollPosition)
@@ -103,9 +185,36 @@ void ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll(
         m_scrollingNodeDelegate->updateChildNodesAfterScroll(scrollPosition);
         return;
     }
-    ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterDelegatedScroll(scrollPosition);
+
+    updateChildNodesAfterScroll(scrollPosition);
 }
 
+void ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange(const FloatRect& fixedPositionRect, double /*scale*/)
+{
+    // Note: we never currently have a m_counterScrollingLayer (which is used for background-attachment:fixed) on iOS.
+    [m_counterScrollingLayer setPosition:fixedPositionRect.location()];
+
+    if (!m_children)
+        return;
+
+    for (auto& child : *m_children)
+        child->updateLayersAfterAncestorChange(*this, fixedPositionRect, FloatSize());
 }
 
+void ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta)
+{
+    if (m_scrollingNodeDelegate) {
+        m_scrollingNodeDelegate->updateLayersAfterAncestorChange(changedNode, fixedPositionRect, cumulativeDelta);
+        return;
+    }
+
+    if (!m_children)
+        return;
+
+    FloatRect currFrameFixedPositionRect(scrollPosition(), scrollableAreaSize()); // FIXME: use up-to-date layout viewport.
+    for (auto& child : *m_children)
+        child->updateLayersAfterAncestorChange(changedNode, currFrameFixedPositionRect, { });
+}
+
+}
 #endif
index b3aeaa9..04dafa3 100644 (file)
@@ -53,8 +53,6 @@ private:
 
     void updateLayersAfterAncestorChange(const WebCore::ScrollingTreeNode& changedNode, const WebCore::FloatRect& fixedPositionRect, const WebCore::FloatSize& cumulativeDelta) override;
 
-    WebCore::ScrollingEventResult handleWheelEvent(const WebCore::PlatformWheelEvent&) override { return WebCore::ScrollingEventResult::DidNotHandleEvent; }
-
     std::unique_ptr<ScrollingTreeScrollingNodeDelegateIOS> m_scrollingNodeDelegate;
 };