[CoordinatedGraphics] Use ScrollingStateTree to handle fixed elements positioning...
authormikhail.pozdnyakov@intel.com <mikhail.pozdnyakov@intel.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Apr 2013 13:16:20 +0000 (13:16 +0000)
committermikhail.pozdnyakov@intel.com <mikhail.pozdnyakov@intel.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Apr 2013 13:16:20 +0000 (13:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=114353

Reviewed by Noam Rosenthal.

ScrollingCoordinatorCoordinatedGraphics should implement threaded scrolling interface and
re-use threaded scrolling approach (ScrollingStateTree and ViewportConstraints) to handle
fixed/sticky elements positioning while scrolling. The rationals are below.

Before the change ScrollingCoordinatorCoordinatedGraphics was implementing Chromium-specific
interface which is going to be removed eventually as there is no ScrollingCoordinatorChromium
existing.

Tested by existing manual tests (fixed-position.html for example.

* CMakeLists.txt:
* Target.pri:
    Included ScrollingStateTree files.

* page/scrolling/ScrollingStateFixedNode.cpp:
* page/scrolling/ScrollingStateFixedNode.h:
* page/scrolling/ScrollingStateNode.cpp:
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingStateScrollingNode.cpp:
* page/scrolling/ScrollingStateScrollingNode.h:
* page/scrolling/ScrollingStateStickyNode.cpp:
* page/scrolling/ScrollingStateStickyNode.h:
* page/scrolling/ScrollingStateTree.cpp:
* page/scrolling/ScrollingStateTree.h:
    Removed ENABLE(THREADED_SCROLLING) code guards.

* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
(WebCore::ScrollingCoordinatorCoordinatedGraphics::ScrollingCoordinatorCoordinatedGraphics):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::~ScrollingCoordinatorCoordinatedGraphics):
(WebCore):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::attachToStateTree):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::detachFromStateTree):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::clearStateTree):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::updateViewportConstrainedNode):
* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h:
    ScrollingCoordinatorCoordinatedGraphics is using threaded scrolling approach to handle fixed
    elements positioning while scrolling.

(WebCore):
(ScrollingCoordinatorCoordinatedGraphics):
* page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp: Added.
(WebCore):
(WebCore::ScrollingStateNode::platformScrollLayer):
(WebCore::ScrollingStateNode::setScrollPlatformLayer):
(WebCore::ScrollingStateNode::setScrollLayer):
* page/scrolling/coordinatedgraphics/ScrollingStateScrollingNodeCoordinatedGraphics.cpp: Added.
(WebCore):
(WebCore::ScrollingStateScrollingNode::counterScrollingPlatformLayer):
(WebCore::ScrollingStateScrollingNode::setCounterScrollingLayer):

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

17 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Target.pri
Source/WebCore/page/scrolling/ScrollingStateFixedNode.cpp
Source/WebCore/page/scrolling/ScrollingStateFixedNode.h
Source/WebCore/page/scrolling/ScrollingStateNode.cpp
Source/WebCore/page/scrolling/ScrollingStateNode.h
Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp
Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h
Source/WebCore/page/scrolling/ScrollingStateStickyNode.cpp
Source/WebCore/page/scrolling/ScrollingStateStickyNode.h
Source/WebCore/page/scrolling/ScrollingStateTree.cpp
Source/WebCore/page/scrolling/ScrollingStateTree.h
Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp
Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h
Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp [new file with mode: 0644]
Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingStateScrollingNodeCoordinatedGraphics.cpp [new file with mode: 0644]

index 4618325..2280898 100644 (file)
@@ -1822,7 +1822,14 @@ set(WebCore_SOURCES
 
     page/scrolling/ScrollingConstraints.cpp
     page/scrolling/ScrollingCoordinator.cpp
+    page/scrolling/ScrollingStateFixedNode.cpp
+    page/scrolling/ScrollingStateNode.cpp
+    page/scrolling/ScrollingStateScrollingNode.cpp
+    page/scrolling/ScrollingStateStickyNode.cpp
+    page/scrolling/ScrollingStateTree.cpp
     page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp
+    page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp
+    page/scrolling/coordinatedgraphics/ScrollingStateScrollingNodeCoordinatedGraphics.cpp
 
     platform/Arena.cpp
     platform/AsyncFileSystem.cpp
index 43b866b..4c20f1a 100644 (file)
@@ -1,3 +1,60 @@
+2013-04-11  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
+
+        [CoordinatedGraphics] Use ScrollingStateTree to handle fixed elements positioning while scrolling
+        https://bugs.webkit.org/show_bug.cgi?id=114353
+
+        Reviewed by Noam Rosenthal.
+        
+        ScrollingCoordinatorCoordinatedGraphics should implement threaded scrolling interface and
+        re-use threaded scrolling approach (ScrollingStateTree and ViewportConstraints) to handle
+        fixed/sticky elements positioning while scrolling. The rationals are below.
+
+        Before the change ScrollingCoordinatorCoordinatedGraphics was implementing Chromium-specific
+        interface which is going to be removed eventually as there is no ScrollingCoordinatorChromium
+        existing.
+
+        Tested by existing manual tests (fixed-position.html for example.
+
+        * CMakeLists.txt:
+        * Target.pri:
+            Included ScrollingStateTree files.
+
+        * page/scrolling/ScrollingStateFixedNode.cpp:
+        * page/scrolling/ScrollingStateFixedNode.h:
+        * page/scrolling/ScrollingStateNode.cpp:
+        * page/scrolling/ScrollingStateNode.h:
+        * page/scrolling/ScrollingStateScrollingNode.cpp:
+        * page/scrolling/ScrollingStateScrollingNode.h:
+        * page/scrolling/ScrollingStateStickyNode.cpp:
+        * page/scrolling/ScrollingStateStickyNode.h:
+        * page/scrolling/ScrollingStateTree.cpp:
+        * page/scrolling/ScrollingStateTree.h:
+            Removed ENABLE(THREADED_SCROLLING) code guards.
+
+        * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
+        (WebCore::ScrollingCoordinatorCoordinatedGraphics::ScrollingCoordinatorCoordinatedGraphics):
+        (WebCore::ScrollingCoordinatorCoordinatedGraphics::~ScrollingCoordinatorCoordinatedGraphics):
+        (WebCore):
+        (WebCore::ScrollingCoordinatorCoordinatedGraphics::attachToStateTree):
+        (WebCore::ScrollingCoordinatorCoordinatedGraphics::detachFromStateTree):
+        (WebCore::ScrollingCoordinatorCoordinatedGraphics::clearStateTree):
+        (WebCore::ScrollingCoordinatorCoordinatedGraphics::updateViewportConstrainedNode):
+        * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h:
+            ScrollingCoordinatorCoordinatedGraphics is using threaded scrolling approach to handle fixed
+            elements positioning while scrolling.
+
+        (WebCore):
+        (ScrollingCoordinatorCoordinatedGraphics):
+        * page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp: Added.
+        (WebCore):
+        (WebCore::ScrollingStateNode::platformScrollLayer):
+        (WebCore::ScrollingStateNode::setScrollPlatformLayer):
+        (WebCore::ScrollingStateNode::setScrollLayer):
+        * page/scrolling/coordinatedgraphics/ScrollingStateScrollingNodeCoordinatedGraphics.cpp: Added.
+        (WebCore):
+        (WebCore::ScrollingStateScrollingNode::counterScrollingPlatformLayer):
+        (WebCore::ScrollingStateScrollingNode::setCounterScrollingLayer):
+
 2013-04-11  Allan Sandfeld Jensen  <allan.jensen@digia.com>
 
         [Qt] EventHandler should handle Space and BackSpace 
index c8a4a94..4984403 100644 (file)
@@ -4142,6 +4142,13 @@ enable?(CANVAS_PROXY) {
 
 use?(3D_GRAPHICS) {
     HEADERS += \
+        page/scrolling/ScrollingConstraints.h \
+        page/scrolling/ScrollingCoordinator.h \
+        page/scrolling/ScrollingStateFixedNode.h \
+        page/scrolling/ScrollingStateNode.h \
+        page/scrolling/ScrollingStateScrollingNode.h \
+        page/scrolling/ScrollingStateStickyNode.h \
+        page/scrolling/ScrollingStateTree.h \
         page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h \
         platform/graphics/cpu/arm/GraphicsContext3DNEON.h \
         platform/graphics/ANGLEWebKitBridge.h \
@@ -4167,7 +4174,16 @@ use?(3D_GRAPHICS) {
         platform/graphics/texmap/coordinated/UpdateAtlas.h
 
     SOURCES += \
+        page/scrolling/ScrollingConstraints.cpp \
+        page/scrolling/ScrollingCoordinator.cpp \
+        page/scrolling/ScrollingStateFixedNode.cpp \
+        page/scrolling/ScrollingStateNode.cpp \
+        page/scrolling/ScrollingStateScrollingNode.cpp \
+        page/scrolling/ScrollingStateStickyNode.cpp \
+        page/scrolling/ScrollingStateTree.cpp \
         page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp \
+        page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp \
+        page/scrolling/coordinatedgraphics/ScrollingStateScrollingNodeCoordinatedGraphics.cpp \
         platform/graphics/ANGLEWebKitBridge.cpp \
         platform/graphics/GraphicsContext3D.cpp \
         platform/graphics/gpu/DrawingBuffer.cpp \
index cef3cb4..775ab93 100644 (file)
@@ -31,8 +31,6 @@
 #include "TextStream.h"
 #include <wtf/OwnPtr.h>
 
-#if ENABLE(THREADED_SCROLLING)
-
 namespace WebCore {
 
 PassOwnPtr<ScrollingStateFixedNode> ScrollingStateFixedNode::create(ScrollingStateTree* stateTree, ScrollingNodeID nodeID)
@@ -112,5 +110,3 @@ void ScrollingStateFixedNode::dumpProperties(TextStream& ts, int indent) const
 }
 
 } // namespace WebCore
-
-#endif // ENABLE(THREADED_SCROLLING)
index 61a2aec..ba01f56 100644 (file)
@@ -26,8 +26,6 @@
 #ifndef ScrollingStateFixedNode_h
 #define ScrollingStateFixedNode_h
 
-#if ENABLE(THREADED_SCROLLING)
-
 #include "ScrollingConstraints.h"
 #include "ScrollingStateNode.h"
 
@@ -76,6 +74,4 @@ void toScrollingStateFixedNode(const ScrollingStateFixedNode*);
 
 } // namespace WebCore
 
-#endif // ENABLE(THREADED_SCROLLING)
-
 #endif // ScrollingStateFixedNode_h
index 8e32b46..636ea3a 100644 (file)
@@ -32,8 +32,6 @@
 
 #include <wtf/text/WTFString.h>
 
-#if ENABLE(THREADED_SCROLLING)
-
 namespace WebCore {
 
 ScrollingStateNode::ScrollingStateNode(ScrollingStateTree* scrollingStateTree, ScrollingNodeID nodeID)
@@ -147,5 +145,3 @@ String ScrollingStateNode::scrollingStateTreeAsText() const
 }
 
 } // namespace WebCore
-
-#endif // ENABLE(THREADED_SCROLLING)
index 6f93e4b..4868c9c 100644 (file)
@@ -26,8 +26,6 @@
 #ifndef ScrollingStateNode_h
 #define ScrollingStateNode_h
 
-#if ENABLE(THREADED_SCROLLING)
-
 #include "PlatformLayer.h"
 #include "ScrollingCoordinator.h"
 #include <wtf/OwnPtr.h>
@@ -117,6 +115,4 @@ private:
 
 } // namespace WebCore
 
-#endif // ENABLE(THREADED_SCROLLING)
-
 #endif // ScrollingStateNode_h
index 23989bd..d0945fe 100644 (file)
@@ -30,8 +30,6 @@
 #include "TextStream.h"
 #include <wtf/OwnPtr.h>
 
-#if ENABLE(THREADED_SCROLLING)
-
 namespace WebCore {
 
 PassOwnPtr<ScrollingStateScrollingNode> ScrollingStateScrollingNode::create(ScrollingStateTree* stateTree, ScrollingNodeID nodeID)
@@ -284,5 +282,3 @@ void ScrollingStateScrollingNode::dumpProperties(TextStream& ts, int indent) con
 }
 
 } // namespace WebCore
-
-#endif // ENABLE(THREADED_SCROLLING)
index 435136f..e764872 100644 (file)
@@ -26,8 +26,6 @@
 #ifndef ScrollingStateScrollingNode_h
 #define ScrollingStateScrollingNode_h
 
-#if ENABLE(THREADED_SCROLLING)
-
 #include "IntRect.h"
 #include "Region.h"
 #include "ScrollTypes.h"
@@ -172,6 +170,4 @@ void toScrollingStateScrollingNode(const ScrollingStateScrollingNode*);
 
 } // namespace WebCore
 
-#endif // ENABLE(THREADED_SCROLLING)
-
 #endif // ScrollingStateScrollingNode_h
index d28ab8b..83e1b73 100644 (file)
@@ -31,8 +31,6 @@
 #include "TextStream.h"
 #include <wtf/OwnPtr.h>
 
-#if ENABLE(THREADED_SCROLLING)
-
 namespace WebCore {
 
 PassOwnPtr<ScrollingStateStickyNode> ScrollingStateStickyNode::create(ScrollingStateTree* stateTree, ScrollingNodeID nodeID)
@@ -131,5 +129,3 @@ void ScrollingStateStickyNode::dumpProperties(TextStream& ts, int indent) const
 }
 
 } // namespace WebCore
-
-#endif // ENABLE(THREADED_SCROLLING)
index b2cf754..f65378c 100644 (file)
@@ -26,8 +26,6 @@
 #ifndef ScrollingStateStickyNode_h
 #define ScrollingStateStickyNode_h
 
-#if ENABLE(THREADED_SCROLLING)
-
 #include "ScrollingConstraints.h"
 #include "ScrollingStateNode.h"
 
@@ -76,6 +74,4 @@ void toScrollingStateStickyNode(const ScrollingStateStickyNode*);
 
 } // namespace WebCore
 
-#endif // ENABLE(THREADED_SCROLLING)
-
 #endif // ScrollingStateStickyNode_h
index 56d6e7e..0818186 100644 (file)
@@ -25,8 +25,6 @@
  
 #include "config.h"
 
-#if ENABLE(THREADED_SCROLLING)
-
 #include "ScrollingStateTree.h"
 
 #include "ScrollingStateFixedNode.h"
@@ -181,5 +179,3 @@ ScrollingStateNode* ScrollingStateTree::stateNodeForID(ScrollingNodeID scrollLay
 }
 
 } // namespace WebCore
-
-#endif // ENABLE(THREADED_SCROLLING)
index 5d6d82b..ed7b6e5 100644 (file)
@@ -26,8 +26,6 @@
 #ifndef ScrollingStateTree_h
 #define ScrollingStateTree_h
 
-#if ENABLE(THREADED_SCROLLING)
-
 #include "ScrollingStateScrollingNode.h"
 #include <wtf/OwnPtr.h>
 #include <wtf/PassOwnPtr.h>
@@ -79,6 +77,4 @@ private:
 
 } // namespace WebCore
 
-#endif // ENABLE(THREADED_SCROLLING)
-
 #endif // ScrollingStateTree_h
index 9d8ec47..40b3492 100644 (file)
 #include "ScrollingCoordinatorCoordinatedGraphics.h"
 
 #include "CoordinatedGraphicsLayer.h"
+#include "FrameView.h"
 #include "Page.h"
+#include "RenderLayer.h"
+#include "RenderLayerBacking.h"
+#include "ScrollingConstraints.h"
+#include "ScrollingStateFixedNode.h"
+#include "ScrollingStateScrollingNode.h"
+#include "ScrollingStateStickyNode.h"
+#include "ScrollingStateTree.h"
 #include "Settings.h"
 
 namespace WebCore {
 
 ScrollingCoordinatorCoordinatedGraphics::ScrollingCoordinatorCoordinatedGraphics(Page* page)
     : ScrollingCoordinator(page)
+    , m_scrollingStateTree(ScrollingStateTree::create())
 {
 }
 
-void ScrollingCoordinatorCoordinatedGraphics::setLayerIsFixedToContainerLayer(GraphicsLayer* layer, bool enable)
+ScrollingCoordinatorCoordinatedGraphics::~ScrollingCoordinatorCoordinatedGraphics()
 {
-    if (!m_page->settings()->acceleratedCompositingForFixedPositionEnabled())
+}
+
+ScrollingNodeID ScrollingCoordinatorCoordinatedGraphics::attachToStateTree(ScrollingNodeType nodeType, ScrollingNodeID newNodeID, ScrollingNodeID parentID)
+{
+    return m_scrollingStateTree->attachNode(nodeType, newNodeID, parentID);
+}
+
+void ScrollingCoordinatorCoordinatedGraphics::detachFromStateTree(ScrollingNodeID nodeID)
+{
+    ScrollingStateNode* node = m_scrollingStateTree->stateNodeForID(nodeID);
+    if (node && node->isFixedNode())
+        toCoordinatedGraphicsLayer(node->graphicsLayer())->setFixedToViewport(false);
+
+    m_scrollingStateTree->detachNode(nodeID);
+}
+
+void ScrollingCoordinatorCoordinatedGraphics::clearStateTree()
+{
+    m_scrollingStateTree->clear();
+}
+
+void ScrollingCoordinatorCoordinatedGraphics::updateViewportConstrainedNode(ScrollingNodeID nodeID, const ViewportConstraints& constraints, GraphicsLayer* graphicsLayer)
+{
+    ASSERT(supportsFixedPositionLayers());
+
+    ScrollingStateNode* node = m_scrollingStateTree->stateNodeForID(nodeID);
+    if (!node)
         return;
-    toCoordinatedGraphicsLayer(layer)->setFixedToViewport(enable);
+
+    switch (constraints.constraintType()) {
+    case ViewportConstraints::FixedPositionConstaint: {
+        toCoordinatedGraphicsLayer(graphicsLayer)->setFixedToViewport(true); // FIXME : Use constraints!
+        ScrollingStateFixedNode* fixedNode = toScrollingStateFixedNode(node);
+        fixedNode->setScrollLayer(graphicsLayer);
+        break;
+    }
+    case ViewportConstraints::StickyPositionConstraint:
+        break; // FIXME : Support sticky elements.
+    default:
+        ASSERT_NOT_REACHED();
+    }
 }
 
 void ScrollingCoordinatorCoordinatedGraphics::scrollableAreaScrollLayerDidChange(ScrollableArea* scrollableArea)
index 6748e4e..6e84bc0 100644 (file)
 
 namespace WebCore {
 
+class ScrollingStateTree;
+
 class ScrollingCoordinatorCoordinatedGraphics : public ScrollingCoordinator {
 public:
     explicit ScrollingCoordinatorCoordinatedGraphics(Page*);
+    virtual ~ScrollingCoordinatorCoordinatedGraphics();
+
+    virtual bool supportsFixedPositionLayers() const OVERRIDE { return true; }
+
+    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 bool supportsFixedPositionLayers() const { return true; }
+    virtual void scrollableAreaScrollLayerDidChange(ScrollableArea*) OVERRIDE;
+    virtual void willDestroyScrollableArea(ScrollableArea*) OVERRIDE;
 
-    virtual void setLayerIsFixedToContainerLayer(GraphicsLayer*, bool);
-    virtual void scrollableAreaScrollLayerDidChange(ScrollableArea*);
-    virtual void willDestroyScrollableArea(ScrollableArea*);
+private:
+    OwnPtr<ScrollingStateTree> m_scrollingStateTree;
 };
 
 } // namespace WebCore
 
 #endif // USE(COORDINATED_GRAPHICS)
 
-#endif
+#endif // ScrollingCoordinatorCoordinatedGraphics_h
diff --git a/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp
new file mode 100644 (file)
index 0000000..f2e48b5
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2013 Intel Corporation. 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 "ScrollingStateNode.h"
+
+#include "GraphicsLayer.h"
+#include "NotImplemented.h"
+#include "ScrollingStateTree.h"
+
+#if USE(COORDINATED_GRAPHICS)
+
+namespace WebCore {
+
+PlatformLayer* ScrollingStateNode::platformScrollLayer() const
+{
+    notImplemented();
+    return 0;
+}
+
+void ScrollingStateNode::setScrollPlatformLayer(PlatformLayer*)
+{
+    notImplemented();
+}
+
+void ScrollingStateNode::setScrollLayer(GraphicsLayer* graphicsLayer)
+{
+    m_graphicsLayer = graphicsLayer;
+}
+
+} // namespace WebCore
+
+#endif // USE(COORDINATED_GRAPHICS)
diff --git a/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingStateScrollingNodeCoordinatedGraphics.cpp b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingStateScrollingNodeCoordinatedGraphics.cpp
new file mode 100644 (file)
index 0000000..53e6ac4
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2013 Intel Corporation. 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 "ScrollingStateScrollingNode.h"
+
+#include "GraphicsLayer.h"
+
+#if USE(COORDINATED_GRAPHICS)
+
+namespace WebCore {
+
+PlatformLayer* ScrollingStateScrollingNode::counterScrollingPlatformLayer() const
+{
+    ASSERT_NOT_REACHED(); // ScrollingStateTree in coord graphics is used only to handle constrained elements.
+    return 0;
+}
+
+void ScrollingStateScrollingNode::setCounterScrollingLayer(GraphicsLayer*)
+{
+    ASSERT_NOT_REACHED(); // ScrollingStateTree in coord graphics is used only to handle constrained elements.
+}
+
+} // namespace WebCore
+
+#endif // USE(COORDINATED_GRAPHICS)