[GTK][WPE] Initial ASYNC_SCROLLING support
https://bugs.webkit.org/show_bug.cgi?id=184961

Reviewed by Carlos Garcia Campos.

.:

* Source/cmake/OptionsGTK.cmake: Enable ASYNC_SCROLLING as a private option.
* Source/cmake/OptionsWPE.cmake: Ditto.

Source/WebCore:

Add CoordinatedGraphics-specific code that will be required for async
scrolling support. The ScrollingCoordinatorCoordinatedGraphics and
ScrollingTreeCoordinatedGraphics classes are mostly complete already,
but the new ScrollingTreeNode-inheriting classes will need further
work that will have to be done in parallel with other improvements
planned for the CoordinatedGraphics subsystem.

While the build-time flag is enabled, the feature is still not enabled
at runtime due to being marked as unsupported by the DrawingArea
implementation in the WebKit layer. It would also not work yet if it
were enabled due to the before-mentioned pending changes.

Various build fixes that address non-Cocoa usage of ASYNC_SCROLLING
code are included.

* Sources.txt: Add AsyncScrollingCoordinator.cpp to build.
* SourcesCocoa.txt:
* SourcesGTK.txt: Add new files to build.
* SourcesWPE.txt: Ditto.
* page/scrolling/AsyncScrollingCoordinator.cpp:
Guard setStateScrollingNodeSnapOffsetsAsFloat() with CSS_SCROLL_SNAP.
* page/scrolling/ScrollingTree.h:
* page/scrolling/ThreadedScrollingTree.cpp:
* page/scrolling/ThreadedScrollingTree.h:
currentSnapPointIndicesDidChange() method is only invoked in
Cocoa-specific code, and its implementation calls Cocoa-specific method
on the AsyncScrollingCoordinator class.
* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
(WebCore::ScrollingCoordinator::create):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::ScrollingCoordinatorCoordinatedGraphics):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::~ScrollingCoordinatorCoordinatedGraphics):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::pageDestroyed):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::commitTreeStateIfNeeded):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::handleWheelEvent):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::scheduleTreeStateCommit):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::commitTreeState):
* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h: Added.
* page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp: Added.
(WebCore::ScrollingTreeCoordinatedGraphics::create):
(WebCore::ScrollingTreeCoordinatedGraphics::ScrollingTreeCoordinatedGraphics):
(WebCore::ScrollingTreeCoordinatedGraphics::createScrollingTreeNode):
* page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.h: Added.
* page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp: Added.
(WebCore::ScrollingTreeFixedNode::create):
(WebCore::ScrollingTreeFixedNode::ScrollingTreeFixedNode):
(WebCore::ScrollingTreeFixedNode::~ScrollingTreeFixedNode):
(WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
* page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.h: Added.
* page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp: Added.
(WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::create):
(WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::ScrollingTreeFrameScrollingNodeCoordinatedGraphics):
(WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::handleWheelEvent):
(WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::scrollPosition const):
(WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollPosition):
(WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollPositionWithoutContentEdgeConstraints):
(WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollLayerPosition):
(WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::updateLayersAfterViewportChange):
* page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h: Added.
* page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp: Added.
(WebCore::ScrollingTreeStickyNode::create):
(WebCore::ScrollingTreeStickyNode::ScrollingTreeStickyNode):
(WebCore::ScrollingTreeStickyNode::~ScrollingTreeStickyNode):
(WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
* page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.h: Added.
* platform/PlatformWheelEvent.h: Enable PlatformWheelEventPhase code
for WPE. Guard latching-specific methods under ASYNC_SCROLLING.
* platform/TextureMapper.cmake: Two build targets have been moved to
SourcesGTK.txt and SourcesWPE.txt.

Source/WebKit:

Guard RemoteScrollingCoordinator and RemoteScrollingCoordinatorProxy
usage in WebChromeClient and WebPageProxy, respectively, with
PLATFORM(COCOA) in addition to the ASYNC_SCROLLING guards.

Despite enabling the code at build-time, the feature (as intended) is
not yet used because of the DrawingArea rejection in the WebPage
constructor.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::initializeWebPage):
(WebKit::WebPageProxy::handleWheelEvent):
(WebKit::WebPageProxy::updateTouchEventTracking):
* UIProcess/WebPageProxy.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::createScrollingCoordinator const):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@231043 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/ChangeLog b/ChangeLog
index 4b6b5a8..c4bb8f5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2018-04-26  Zan Dobersek  <zdobersek@igalia.com>
+
+        [GTK][WPE] Initial ASYNC_SCROLLING support
+        https://bugs.webkit.org/show_bug.cgi?id=184961
+
+        Reviewed by Carlos Garcia Campos.
+
+        * Source/cmake/OptionsGTK.cmake: Enable ASYNC_SCROLLING as a private option.
+        * Source/cmake/OptionsWPE.cmake: Ditto.
+
 2018-04-25  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         [WPE] Build and link against latest WPEBackend and WPEBackend-fdo
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index b60aae2..b7324bc 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,81 @@
+2018-04-26  Zan Dobersek  <zdobersek@igalia.com>
+
+        [GTK][WPE] Initial ASYNC_SCROLLING support
+        https://bugs.webkit.org/show_bug.cgi?id=184961
+
+        Reviewed by Carlos Garcia Campos.
+
+        Add CoordinatedGraphics-specific code that will be required for async
+        scrolling support. The ScrollingCoordinatorCoordinatedGraphics and
+        ScrollingTreeCoordinatedGraphics classes are mostly complete already,
+        but the new ScrollingTreeNode-inheriting classes will need further
+        work that will have to be done in parallel with other improvements
+        planned for the CoordinatedGraphics subsystem.
+
+        While the build-time flag is enabled, the feature is still not enabled
+        at runtime due to being marked as unsupported by the DrawingArea
+        implementation in the WebKit layer. It would also not work yet if it
+        were enabled due to the before-mentioned pending changes.
+
+        Various build fixes that address non-Cocoa usage of ASYNC_SCROLLING
+        code are included.
+
+        * Sources.txt: Add AsyncScrollingCoordinator.cpp to build.
+        * SourcesCocoa.txt:
+        * SourcesGTK.txt: Add new files to build.
+        * SourcesWPE.txt: Ditto.
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        Guard setStateScrollingNodeSnapOffsetsAsFloat() with CSS_SCROLL_SNAP.
+        * page/scrolling/ScrollingTree.h:
+        * page/scrolling/ThreadedScrollingTree.cpp:
+        * page/scrolling/ThreadedScrollingTree.h:
+        currentSnapPointIndicesDidChange() method is only invoked in
+        Cocoa-specific code, and its implementation calls Cocoa-specific method
+        on the AsyncScrollingCoordinator class.
+        * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
+        (WebCore::ScrollingCoordinator::create):
+        (WebCore::ScrollingCoordinatorCoordinatedGraphics::ScrollingCoordinatorCoordinatedGraphics):
+        (WebCore::ScrollingCoordinatorCoordinatedGraphics::~ScrollingCoordinatorCoordinatedGraphics):
+        (WebCore::ScrollingCoordinatorCoordinatedGraphics::pageDestroyed):
+        (WebCore::ScrollingCoordinatorCoordinatedGraphics::commitTreeStateIfNeeded):
+        (WebCore::ScrollingCoordinatorCoordinatedGraphics::handleWheelEvent):
+        (WebCore::ScrollingCoordinatorCoordinatedGraphics::scheduleTreeStateCommit):
+        (WebCore::ScrollingCoordinatorCoordinatedGraphics::commitTreeState):
+        * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h: Added.
+        * page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp: Added.
+        (WebCore::ScrollingTreeCoordinatedGraphics::create):
+        (WebCore::ScrollingTreeCoordinatedGraphics::ScrollingTreeCoordinatedGraphics):
+        (WebCore::ScrollingTreeCoordinatedGraphics::createScrollingTreeNode):
+        * page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.h: Added.
+        * page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp: Added.
+        (WebCore::ScrollingTreeFixedNode::create):
+        (WebCore::ScrollingTreeFixedNode::ScrollingTreeFixedNode):
+        (WebCore::ScrollingTreeFixedNode::~ScrollingTreeFixedNode):
+        (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
+        (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
+        * page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.h: Added.
+        * page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp: Added.
+        (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::create):
+        (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::ScrollingTreeFrameScrollingNodeCoordinatedGraphics):
+        (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::handleWheelEvent):
+        (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::scrollPosition const):
+        (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollPosition):
+        (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollPositionWithoutContentEdgeConstraints):
+        (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollLayerPosition):
+        (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::updateLayersAfterViewportChange):
+        * page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h: Added.
+        * page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp: Added.
+        (WebCore::ScrollingTreeStickyNode::create):
+        (WebCore::ScrollingTreeStickyNode::ScrollingTreeStickyNode):
+        (WebCore::ScrollingTreeStickyNode::~ScrollingTreeStickyNode):
+        (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
+        (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
+        * page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.h: Added.
+        * platform/PlatformWheelEvent.h: Enable PlatformWheelEventPhase code
+        for WPE. Guard latching-specific methods under ASYNC_SCROLLING.
+        * platform/TextureMapper.cmake: Two build targets have been moved to
+        SourcesGTK.txt and SourcesWPE.txt.
+
 2018-04-25  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         [WPE] Build and link against latest WPEBackend and WPEBackend-fdo
diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt
index 038853e..4bac2c0 100644
--- a/Source/WebCore/Sources.txt
+++ b/Source/WebCore/Sources.txt
@@ -1436,6 +1436,7 @@
 page/csp/ContentSecurityPolicySourceList.cpp
 page/csp/ContentSecurityPolicySourceListDirective.cpp
 
+page/scrolling/AsyncScrollingCoordinator.cpp
 page/scrolling/AxisScrollSnapOffsets.cpp
 page/scrolling/ScrollLatchingState.cpp
 page/scrolling/ScrollingConstraints.cpp
diff --git a/Source/WebCore/SourcesCocoa.txt b/Source/WebCore/SourcesCocoa.txt
index a0363302..26fb2f0 100644
--- a/Source/WebCore/SourcesCocoa.txt
+++ b/Source/WebCore/SourcesCocoa.txt
@@ -140,7 +140,6 @@
 page/mac/TextIndicatorWindow.mm
 page/mac/WheelEventDeltaFilterMac.mm
 
-page/scrolling/AsyncScrollingCoordinator.cpp
 page/scrolling/ScrollingMomentumCalculator.cpp
 
 page/scrolling/cocoa/ScrollingStateNode.mm
diff --git a/Source/WebCore/SourcesGTK.txt b/Source/WebCore/SourcesGTK.txt
index ffca9a2..92acd0b 100644
--- a/Source/WebCore/SourcesGTK.txt
+++ b/Source/WebCore/SourcesGTK.txt
@@ -46,6 +46,13 @@
 page/linux/ResourceUsageOverlayLinux.cpp
 page/linux/ResourceUsageThreadLinux.cpp
 
+page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp
+page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp
+page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp
+page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp
+page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp
+page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp
+
 page/scrolling/generic/ScrollingThreadGeneric.cpp
 
 platform/ScrollAnimationKinetic.cpp
diff --git a/Source/WebCore/SourcesWPE.txt b/Source/WebCore/SourcesWPE.txt
index e861dae..fc0019b 100644
--- a/Source/WebCore/SourcesWPE.txt
+++ b/Source/WebCore/SourcesWPE.txt
@@ -32,6 +32,10 @@
 page/linux/ResourceUsageThreadLinux.cpp
 
 page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp
+page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp
+page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp
+page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp
+page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp
 page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp
 
 page/scrolling/generic/ScrollingThreadGeneric.cpp
diff --git a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
index e2ecd5a..0bf3197 100644
--- a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
+++ b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
@@ -64,6 +64,7 @@
     scheduleTreeStateCommit();
 }
 
+#if ENABLE(CSS_SCROLL_SNAP)
 static inline void setStateScrollingNodeSnapOffsetsAsFloat(ScrollingStateScrollingNode& node, ScrollEventAxis axis, const Vector<LayoutUnit>* snapOffsets, const Vector<ScrollOffsetRange<LayoutUnit>>* snapOffsetRanges, float deviceScaleFactor)
 {
     // FIXME: Incorporate current page scale factor in snapping to device pixel. Perhaps we should just convert to float here and let UI process do the pixel snapping?
@@ -88,6 +89,7 @@
         node.setVerticalSnapOffsetRanges(snapOffsetRangesAsFloat);
     }
 }
+#endif
 
 void AsyncScrollingCoordinator::setEventTrackingRegionsDirty()
 {
diff --git a/Source/WebCore/page/scrolling/ScrollingTree.h b/Source/WebCore/page/scrolling/ScrollingTree.h
index 194014a..1d9deaa 100644
--- a/Source/WebCore/page/scrolling/ScrollingTree.h
+++ b/Source/WebCore/page/scrolling/ScrollingTree.h
@@ -91,8 +91,6 @@
     // and call scrollingTreeNodeDidScroll().
     WEBCORE_EXPORT virtual void scrollPositionChangedViaDelegatedScrolling(ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, bool inUserInteraction);
 
-    WEBCORE_EXPORT virtual void currentSnapPointIndicesDidChange(ScrollingNodeID, unsigned horizontal, unsigned vertical) = 0;
-
     WEBCORE_EXPORT virtual void reportSynchronousScrollingReasonsChanged(MonotonicTime, SynchronousScrollingReasons) { }
     WEBCORE_EXPORT virtual void reportExposedUnfilledArea(MonotonicTime, unsigned /* unfilledArea */) { }
 
@@ -114,6 +112,10 @@
     virtual void removeTestDeferralForReason(WheelEventTestTrigger::ScrollableAreaIdentifier, WheelEventTestTrigger::DeferTestTriggerReason) { }
 #endif
 
+#if PLATFORM(COCOA)
+    WEBCORE_EXPORT virtual void currentSnapPointIndicesDidChange(ScrollingNodeID, unsigned horizontal, unsigned vertical) = 0;
+#endif
+
     // Can be called from any thread. Will update what edges allow rubber-banding.
     WEBCORE_EXPORT void setCanRubberBandState(bool canRubberBandAtLeft, bool canRubberBandAtRight, bool canRubberBandAtTop, bool canRubberBandAtBottom);
 
diff --git a/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp b/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp
index f85e64d..5c7ba80 100644
--- a/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp
+++ b/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp
@@ -31,10 +31,8 @@
 #include "AsyncScrollingCoordinator.h"
 #include "PlatformWheelEvent.h"
 #include "ScrollingThread.h"
-#include "ScrollingTreeFixedNode.h"
 #include "ScrollingTreeNode.h"
 #include "ScrollingTreeScrollingNode.h"
-#include "ScrollingTreeStickyNode.h"
 #include <wtf/RunLoop.h>
 
 namespace WebCore {
@@ -119,6 +117,7 @@
     });
 }
 
+#if PLATFORM(COCOA)
 void ThreadedScrollingTree::currentSnapPointIndicesDidChange(ScrollingNodeID nodeID, unsigned horizontal, unsigned vertical)
 {
     if (!m_scrollingCoordinator)
@@ -128,6 +127,7 @@
         scrollingCoordinator->setActiveScrollSnapIndices(nodeID, horizontal, vertical);
     });
 }
+#endif
 
 #if PLATFORM(MAC)
 void ThreadedScrollingTree::handleWheelEventPhase(PlatformWheelEventPhase phase)
diff --git a/Source/WebCore/page/scrolling/ThreadedScrollingTree.h b/Source/WebCore/page/scrolling/ThreadedScrollingTree.h
index 46f643c..db3c3d5 100644
--- a/Source/WebCore/page/scrolling/ThreadedScrollingTree.h
+++ b/Source/WebCore/page/scrolling/ThreadedScrollingTree.h
@@ -58,7 +58,6 @@
     explicit ThreadedScrollingTree(AsyncScrollingCoordinator&);
 
     void scrollingTreeNodeDidScroll(ScrollingNodeID, const FloatPoint& scrollPosition, const std::optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction = ScrollingLayerPositionAction::Sync) override;
-    void currentSnapPointIndicesDidChange(ScrollingNodeID, unsigned horizontal, unsigned vertical) override;
 #if PLATFORM(MAC)
     void handleWheelEventPhase(PlatformWheelEventPhase) override;
     void setActiveScrollSnapIndices(ScrollingNodeID, unsigned horizontalIndex, unsigned verticalIndex) override;
@@ -66,6 +65,10 @@
     void removeTestDeferralForReason(WheelEventTestTrigger::ScrollableAreaIdentifier, WheelEventTestTrigger::DeferTestTriggerReason) override;
 #endif
 
+#if PLATFORM(COCOA)
+    void currentSnapPointIndicesDidChange(ScrollingNodeID, unsigned horizontal, unsigned vertical) override;
+#endif
+
     void reportExposedUnfilledArea(MonotonicTime, unsigned unfilledArea) override;
     void reportSynchronousScrollingReasonsChanged(MonotonicTime, SynchronousScrollingReasons) override;
 
diff --git a/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp
index b1a4775..d23f378 100644
--- a/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp
+++ b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp
@@ -1,39 +1,94 @@
 /*
- * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ * Copyright (C) 2018 Igalia S.L.
  *
  * 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.
+ * 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 THE COPYRIGHT HOLDERS ``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 THE COPYRIGHT HOLDERS OR
- * 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
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * HOLDER OR 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 "ScrollingCoordinator.h"
+#include "ScrollingCoordinatorCoordinatedGraphics.h"
 
 #if USE(COORDINATED_GRAPHICS)
 
+#include "ScrollingThread.h"
+#include "ScrollingTreeCoordinatedGraphics.h"
+
 namespace WebCore {
 
 Ref<ScrollingCoordinator> ScrollingCoordinator::create(Page* page)
 {
-    // FIXME: Return an object implementing AsyncScrollingCoordinator.
-    return adoptRef(*new ScrollingCoordinator(page));
+    return adoptRef(*new ScrollingCoordinatorCoordinatedGraphics(page));
+}
+
+ScrollingCoordinatorCoordinatedGraphics::ScrollingCoordinatorCoordinatedGraphics(Page* page)
+    : AsyncScrollingCoordinator(page)
+    , m_scrollingStateTreeCommitterTimer(RunLoop::main(), this, &ScrollingCoordinatorCoordinatedGraphics::commitTreeState)
+{
+    setScrollingTree(ScrollingTreeCoordinatedGraphics::create(*this));
+}
+
+ScrollingCoordinatorCoordinatedGraphics::~ScrollingCoordinatorCoordinatedGraphics()
+{
+    ASSERT(!scrollingTree());
+}
+
+void ScrollingCoordinatorCoordinatedGraphics::pageDestroyed()
+{
+    AsyncScrollingCoordinator::pageDestroyed();
+
+    m_scrollingStateTreeCommitterTimer.stop();
+
+    releaseScrollingTree();
+}
+
+void ScrollingCoordinatorCoordinatedGraphics::commitTreeStateIfNeeded()
+{
+    commitTreeState();
+    m_scrollingStateTreeCommitterTimer.stop();
+}
+
+bool ScrollingCoordinatorCoordinatedGraphics::handleWheelEvent(FrameView&, const PlatformWheelEvent&)
+{
+    return false;
+}
+
+void ScrollingCoordinatorCoordinatedGraphics::scheduleTreeStateCommit()
+{
+    if (!m_scrollingStateTreeCommitterTimer.isActive())
+        m_scrollingStateTreeCommitterTimer.startOneShot(0_s);
+}
+
+void ScrollingCoordinatorCoordinatedGraphics::commitTreeState()
+{
+    if (!scrollingStateTree()->hasChangedProperties())
+        return;
+
+    RefPtr<ThreadedScrollingTree> threadedScrollingTree = downcast<ThreadedScrollingTree>(scrollingTree());
+
+    auto treeState = scrollingStateTree()->commit(LayerRepresentation::PlatformLayerRepresentation);
+    ScrollingThread::dispatch([threadedScrollingTree, treeState = WTFMove(treeState)]() mutable {
+        threadedScrollingTree->commitTreeState(WTFMove(treeState));
+    });
 }
 
 } // namespace WebCore
diff --git a/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h
new file mode 100644
index 0000000..8257422
--- /dev/null
+++ b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2018 Igalia S.L.
+ *
+ * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * HOLDER OR 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) && USE(COORDINATED_GRAPHICS)
+
+#include "AsyncScrollingCoordinator.h"
+
+#include <wtf/RunLoop.h>
+
+namespace WebCore {
+
+class ScrollingCoordinatorCoordinatedGraphics final : public AsyncScrollingCoordinator {
+public:
+    explicit ScrollingCoordinatorCoordinatedGraphics(Page*);
+    virtual ~ScrollingCoordinatorCoordinatedGraphics();
+
+    void pageDestroyed() override;
+
+    void commitTreeStateIfNeeded() override;
+
+    bool handleWheelEvent(FrameView&, const PlatformWheelEvent&) override;
+
+private:
+    void scheduleTreeStateCommit() override;
+
+    void commitTreeState();
+
+    RunLoop::Timer<ScrollingCoordinatorCoordinatedGraphics> m_scrollingStateTreeCommitterTimer;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(ASYNC_SCROLLING) && USE(COORDINATED_GRAPHICS)
diff --git a/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp
new file mode 100644
index 0000000..6bfca4d
--- /dev/null
+++ b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2018 Igalia S.L.
+ *
+ * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * HOLDER OR 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 "ScrollingTreeCoordinatedGraphics.h"
+
+#if ENABLE(ASYNC_SCROLLING) && USE(COORDINATED_GRAPHICS)
+
+#include "ScrollingTreeFixedNode.h"
+#include "ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h"
+#include "ScrollingTreeStickyNode.h"
+
+namespace WebCore {
+
+Ref<ScrollingTreeCoordinatedGraphics> ScrollingTreeCoordinatedGraphics::create(AsyncScrollingCoordinator& scrollingCoordinator)
+{
+    return adoptRef(*new ScrollingTreeCoordinatedGraphics(scrollingCoordinator));
+}
+
+ScrollingTreeCoordinatedGraphics::ScrollingTreeCoordinatedGraphics(AsyncScrollingCoordinator& scrollingCoordinator)
+    : ThreadedScrollingTree(scrollingCoordinator)
+{
+}
+
+Ref<ScrollingTreeNode> ScrollingTreeCoordinatedGraphics::createScrollingTreeNode(ScrollingNodeType nodeType, ScrollingNodeID nodeID)
+{
+    switch (nodeType) {
+    case MainFrameScrollingNode:
+    case SubframeScrollingNode:
+        return ScrollingTreeFrameScrollingNodeCoordinatedGraphics::create(*this, nodeType, nodeID);
+    case OverflowScrollingNode:
+        // Should not be reached -- caught by ASSERT_NOT_REACHED() below.
+        break;
+    case FixedNode:
+        return ScrollingTreeFixedNode::create(*this, nodeID);
+    case StickyNode:
+        return ScrollingTreeStickyNode::create(*this, nodeID);
+    }
+
+    RELEASE_ASSERT_NOT_REACHED();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(ASYNC_SCROLLING) && USE(COORDINATED_GRAPHICS)
diff --git a/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.h b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.h
new file mode 100644
index 0000000..45bb645
--- /dev/null
+++ b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2018 Igalia S.L.
+ *
+ * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * HOLDER OR 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) && USE(COORDINATED_GRAPHICS)
+
+#include "ThreadedScrollingTree.h"
+
+namespace WebCore {
+
+class ScrollingTreeCoordinatedGraphics final : public ThreadedScrollingTree {
+public:
+    static Ref<ScrollingTreeCoordinatedGraphics> create(AsyncScrollingCoordinator&);
+
+private:
+    explicit ScrollingTreeCoordinatedGraphics(AsyncScrollingCoordinator&);
+
+    Ref<ScrollingTreeNode> createScrollingTreeNode(ScrollingNodeType, ScrollingNodeID) override;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(ASYNC_SCROLLING) && USE(COORDINATED_GRAPHICS)
diff --git a/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp
new file mode 100644
index 0000000..2408170
--- /dev/null
+++ b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2018 Igalia S.L.
+ *
+ * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * HOLDER OR 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 "ScrollingTreeFixedNode.h"
+
+#if ENABLE(ASYNC_SCROLLING) && USE(COORDINATED_GRAPHICS)
+
+namespace WebCore {
+
+Ref<ScrollingTreeFixedNode> ScrollingTreeFixedNode::create(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
+{
+    return adoptRef(*new ScrollingTreeFixedNode(scrollingTree, nodeID));
+}
+
+ScrollingTreeFixedNode::ScrollingTreeFixedNode(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
+    : ScrollingTreeNode(scrollingTree, FixedNode, nodeID)
+{
+    scrollingTree.fixedOrStickyNodeAdded();
+}
+
+ScrollingTreeFixedNode::~ScrollingTreeFixedNode()
+{
+    scrollingTree().fixedOrStickyNodeRemoved();
+}
+
+void ScrollingTreeFixedNode::commitStateBeforeChildren(const ScrollingStateNode&)
+{
+}
+
+void ScrollingTreeFixedNode::updateLayersAfterAncestorChange(const ScrollingTreeNode&, const FloatRect&, const FloatSize&)
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(ASYNC_SCROLLING) && USE(COORDINATED_GRAPHICS)
diff --git a/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.h b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.h
new file mode 100644
index 0000000..d0aa879
--- /dev/null
+++ b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2018 Igalia S.L.
+ *
+ * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * HOLDER OR 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) && USE(COORDINATED_GRAPHICS)
+
+#include "ScrollingTreeNode.h"
+
+namespace WebCore {
+
+class ScrollingTreeFixedNode final : public ScrollingTreeNode {
+public:
+    static Ref<ScrollingTreeFixedNode> create(ScrollingTree&, ScrollingNodeID);
+    virtual ~ScrollingTreeFixedNode();
+
+private:
+    ScrollingTreeFixedNode(ScrollingTree&, ScrollingNodeID);
+
+    void commitStateBeforeChildren(const ScrollingStateNode&) override;
+    void updateLayersAfterAncestorChange(const ScrollingTreeNode&, const FloatRect&, const FloatSize&) override;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(ASYNC_SCROLLING) && USE(COORDINATED_GRAPHICS)
diff --git a/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp
new file mode 100644
index 0000000..ecc6f31
--- /dev/null
+++ b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2018 Igalia S.L.
+ *
+ * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * HOLDER OR 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 "ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h"
+
+#if ENABLE(ASYNC_SCROLLING) && USE(COORDINATED_GRAPHICS)
+
+namespace WebCore {
+
+Ref<ScrollingTreeFrameScrollingNode> ScrollingTreeFrameScrollingNodeCoordinatedGraphics::create(ScrollingTree& scrollingTree, ScrollingNodeType nodeType, ScrollingNodeID nodeID)
+{
+    return adoptRef(*new ScrollingTreeFrameScrollingNodeCoordinatedGraphics(scrollingTree, nodeType, nodeID));
+}
+
+ScrollingTreeFrameScrollingNodeCoordinatedGraphics::ScrollingTreeFrameScrollingNodeCoordinatedGraphics(ScrollingTree& scrollingTree, ScrollingNodeType nodeType, ScrollingNodeID nodeID)
+    : ScrollingTreeFrameScrollingNode(scrollingTree, nodeType, nodeID)
+{
+}
+
+ScrollingTreeFrameScrollingNodeCoordinatedGraphics::~ScrollingTreeFrameScrollingNodeCoordinatedGraphics() = default;
+
+void ScrollingTreeFrameScrollingNodeCoordinatedGraphics::handleWheelEvent(const PlatformWheelEvent&)
+{
+}
+
+FloatPoint ScrollingTreeFrameScrollingNodeCoordinatedGraphics::scrollPosition() const
+{
+    return { };
+}
+
+void ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollPosition(const FloatPoint&)
+{
+}
+
+void ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&)
+{
+}
+
+void ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollLayerPosition(const FloatPoint&, const FloatRect&)
+{
+}
+
+void ScrollingTreeFrameScrollingNodeCoordinatedGraphics::updateLayersAfterViewportChange(const FloatRect&, double)
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(ASYNC_SCROLLING) && USE(COORDINATED_GRAPHICS)
diff --git a/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h
new file mode 100644
index 0000000..65086cc
--- /dev/null
+++ b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2018 Igalia S.L.
+ *
+ * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * HOLDER OR 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) && USE(COORDINATED_GRAPHICS)
+
+#include "ScrollingTreeFrameScrollingNode.h"
+
+namespace WebCore {
+
+class ScrollingTreeFrameScrollingNodeCoordinatedGraphics final : public ScrollingTreeFrameScrollingNode {
+public:
+    static Ref<ScrollingTreeFrameScrollingNode> create(ScrollingTree&, ScrollingNodeType, ScrollingNodeID);
+    virtual ~ScrollingTreeFrameScrollingNodeCoordinatedGraphics();
+
+private:
+    ScrollingTreeFrameScrollingNodeCoordinatedGraphics(ScrollingTree&, ScrollingNodeType, ScrollingNodeID);
+
+    void handleWheelEvent(const PlatformWheelEvent&) override;
+
+    FloatPoint scrollPosition() const override;
+    void setScrollPosition(const FloatPoint&) override;
+    void setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&) override;
+    void setScrollLayerPosition(const FloatPoint&, const FloatRect&) override;
+
+    void updateLayersAfterViewportChange(const FloatRect&, double) override;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(ASYNC_SCROLLING) && USE(COORDINATED_GRAPHICS)
diff --git a/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp
new file mode 100644
index 0000000..25a7689
--- /dev/null
+++ b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2018 Igalia S.L.
+ *
+ * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * HOLDER OR 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 "ScrollingTreeStickyNode.h"
+
+#if ENABLE(ASYNC_SCROLLING) && USE(COORDINATED_GRAPHICS)
+
+namespace WebCore {
+
+Ref<ScrollingTreeStickyNode> ScrollingTreeStickyNode::create(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
+{
+    return adoptRef(*new ScrollingTreeStickyNode(scrollingTree, nodeID));
+}
+
+ScrollingTreeStickyNode::ScrollingTreeStickyNode(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
+    : ScrollingTreeNode(scrollingTree, StickyNode, nodeID)
+{
+    scrollingTree.fixedOrStickyNodeAdded();
+}
+
+ScrollingTreeStickyNode::~ScrollingTreeStickyNode()
+{
+    scrollingTree().fixedOrStickyNodeRemoved();
+}
+
+void ScrollingTreeStickyNode::commitStateBeforeChildren(const ScrollingStateNode&)
+{
+}
+
+void ScrollingTreeStickyNode::updateLayersAfterAncestorChange(const ScrollingTreeNode&, const FloatRect&, const FloatSize&)
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(ASYNC_SCROLLING) && USE(COORDINATED_GRAPHICS)
diff --git a/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.h b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.h
new file mode 100644
index 0000000..f3133a7
--- /dev/null
+++ b/Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2018 Igalia S.L.
+ *
+ * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * HOLDER OR 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) && USE(COORDINATED_GRAPHICS)
+
+#include "ScrollingTreeNode.h"
+
+namespace WebCore {
+
+class ScrollingTreeStickyNode final : public ScrollingTreeNode {
+public:
+    static Ref<ScrollingTreeStickyNode> create(ScrollingTree&, ScrollingNodeID);
+    virtual ~ScrollingTreeStickyNode();
+
+private:
+    ScrollingTreeStickyNode(ScrollingTree&, ScrollingNodeID);
+
+    void commitStateBeforeChildren(const ScrollingStateNode&) override;
+    void updateLayersAfterAncestorChange(const ScrollingTreeNode&, const FloatRect&, const FloatSize&) override;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(ASYNC_SCROLLING) && USE(COORDINATED_GRAPHICS)
diff --git a/Source/WebCore/platform/PlatformWheelEvent.h b/Source/WebCore/platform/PlatformWheelEvent.h
index c1b6a2a..e1d2d3b 100644
--- a/Source/WebCore/platform/PlatformWheelEvent.h
+++ b/Source/WebCore/platform/PlatformWheelEvent.h
@@ -48,7 +48,7 @@
     ScrollByPixelWheelEvent,
 };
 
-#if PLATFORM(COCOA) || PLATFORM(GTK)
+#if PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE)
 
 enum PlatformWheelEventPhase : uint8_t {
     PlatformWheelEventPhaseNone = 0,
@@ -135,6 +135,9 @@
     unsigned scrollCount() const { return m_scrollCount; }
     float unacceleratedScrollingDeltaX() const { return m_unacceleratedScrollingDeltaX; }
     float unacceleratedScrollingDeltaY() const { return m_unacceleratedScrollingDeltaY; }
+#endif
+
+#if ENABLE(ASYNC_SCROLLING)
     bool useLatchedEventElement() const;
     bool shouldConsiderLatching() const;
     bool shouldResetLatching() const;
@@ -143,7 +146,7 @@
     bool useLatchedEventElement() const { return false; }
 #endif
 
-#if PLATFORM(COCOA) || PLATFORM(GTK)
+#if PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE)
     PlatformWheelEventPhase phase() const { return m_phase; }
     PlatformWheelEventPhase momentumPhase() const { return m_momentumPhase; }
     bool isEndOfNonMomentumScroll() const;
@@ -168,7 +171,7 @@
     // Scrolling velocity in pixels per second.
     FloatSize m_scrollingVelocity;
 
-#if PLATFORM(COCOA) || PLATFORM(GTK)
+#if PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE)
     PlatformWheelEventPhase m_phase { PlatformWheelEventPhaseNone };
     PlatformWheelEventPhase m_momentumPhase { PlatformWheelEventPhaseNone };
 #endif
@@ -180,7 +183,7 @@
 #endif
 };
 
-#if PLATFORM(COCOA)
+#if ENABLE(ASYNC_SCROLLING)
 
 inline bool PlatformWheelEvent::useLatchedEventElement() const
 {
diff --git a/Source/WebCore/platform/TextureMapper.cmake b/Source/WebCore/platform/TextureMapper.cmake
index ea926ce..6eab6a0 100644
--- a/Source/WebCore/platform/TextureMapper.cmake
+++ b/Source/WebCore/platform/TextureMapper.cmake
@@ -30,9 +30,6 @@
         "${WEBCORE_DIR}/platform/graphics/texmap/coordinated"
     )
     list(APPEND WebCore_SOURCES
-        page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp
-        page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp
-
         platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp
         platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp
 
diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog
index 7d22fdb..1669993 100644
--- a/Source/WebKit/ChangeLog
+++ b/Source/WebKit/ChangeLog
@@ -1,3 +1,26 @@
+2018-04-26  Zan Dobersek  <zdobersek@igalia.com>
+
+        [GTK][WPE] Initial ASYNC_SCROLLING support
+        https://bugs.webkit.org/show_bug.cgi?id=184961
+
+        Reviewed by Carlos Garcia Campos.
+
+        Guard RemoteScrollingCoordinator and RemoteScrollingCoordinatorProxy
+        usage in WebChromeClient and WebPageProxy, respectively, with
+        PLATFORM(COCOA) in addition to the ASYNC_SCROLLING guards.
+
+        Despite enabling the code at build-time, the feature (as intended) is
+        not yet used because of the DrawingArea rejection in the WebPage
+        constructor.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::initializeWebPage):
+        (WebKit::WebPageProxy::handleWheelEvent):
+        (WebKit::WebPageProxy::updateTouchEventTracking):
+        * UIProcess/WebPageProxy.h:
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::createScrollingCoordinator const):
+
 2018-04-25  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         [WPE] Build and link against latest WPEBackend and WPEBackend-fdo
diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp
index bbc52aa..d72ce2e 100644
--- a/Source/WebKit/UIProcess/WebPageProxy.cpp
+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp
@@ -156,7 +156,7 @@
 #include "APIApplicationManifest.h"
 #endif
 
-#if ENABLE(ASYNC_SCROLLING)
+#if ENABLE(ASYNC_SCROLLING) && PLATFORM(COCOA)
 #include "RemoteScrollingCoordinatorProxy.h"
 #endif
 
@@ -804,7 +804,7 @@
     m_drawingArea = m_pageClient.createDrawingAreaProxy();
     ASSERT(m_drawingArea);
 
-#if ENABLE(ASYNC_SCROLLING)
+#if ENABLE(ASYNC_SCROLLING) && PLATFORM(COCOA)
     if (m_drawingArea->type() == DrawingAreaTypeRemoteLayerTree) {
         m_scrollingCoordinatorProxy = std::make_unique<RemoteScrollingCoordinatorProxy>(*this);
 #if PLATFORM(IOS)
@@ -2016,7 +2016,7 @@
 
 void WebPageProxy::handleWheelEvent(const NativeWebWheelEvent& event)
 {
-#if ENABLE(ASYNC_SCROLLING)
+#if ENABLE(ASYNC_SCROLLING) && PLATFORM(COCOA)
     if (m_scrollingCoordinatorProxy && m_scrollingCoordinatorProxy->handleWheelEvent(platform(event)))
         return;
 #endif
@@ -2190,7 +2190,7 @@
 
 void WebPageProxy::updateTouchEventTracking(const WebTouchEvent& touchStartEvent)
 {
-#if ENABLE(ASYNC_SCROLLING)
+#if ENABLE(ASYNC_SCROLLING) && PLATFORM(COCOA)
     const EventNames& names = eventNames();
     for (auto& touchPoint : touchStartEvent.touchPoints()) {
         IntPoint location = touchPoint.location();
diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h
index b53445f..0dd9f0c 100644
--- a/Source/WebKit/UIProcess/WebPageProxy.h
+++ b/Source/WebKit/UIProcess/WebPageProxy.h
@@ -347,7 +347,7 @@
     NSArray *dataDetectionResults() { return m_dataDetectionResults.get(); }
 #endif
         
-#if ENABLE(ASYNC_SCROLLING)
+#if ENABLE(ASYNC_SCROLLING) && PLATFORM(COCOA)
     RemoteScrollingCoordinatorProxy* scrollingCoordinatorProxy() const { return m_scrollingCoordinatorProxy.get(); }
 #endif
 
@@ -1780,7 +1780,7 @@
     bool m_isLoadingAlternateHTMLStringForFailingProvisionalLoad { false };
 
     std::unique_ptr<DrawingAreaProxy> m_drawingArea;
-#if ENABLE(ASYNC_SCROLLING)
+#if ENABLE(ASYNC_SCROLLING) && PLATFORM(COCOA)
     std::unique_ptr<RemoteScrollingCoordinatorProxy> m_scrollingCoordinatorProxy;
 #endif
 
diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
index 621ea39..0a3ea5f 100644
--- a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
@@ -928,9 +928,13 @@
 RefPtr<ScrollingCoordinator> WebChromeClient::createScrollingCoordinator(Page& page) const
 {
     ASSERT_UNUSED(page, m_page.corePage() == &page);
+#if PLATFORM(COCOA)
     if (m_page.drawingArea()->type() != DrawingAreaTypeRemoteLayerTree)
         return nullptr;
     return RemoteScrollingCoordinator::create(&m_page);
+#else
+    return nullptr;
+#endif
 }
 
 #endif
diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake
index 8f15fe4..9abecc9 100644
--- a/Source/cmake/OptionsGTK.cmake
+++ b/Source/cmake/OptionsGTK.cmake
@@ -121,6 +121,7 @@
 # without approval from a GTK+ reviewer. There must be strong reason to support
 # changing the value of the option.
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCELERATED_2D_CANVAS PUBLIC OFF)
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ASYNC_SCROLLING PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_DRAG_SUPPORT PUBLIC ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_GEOLOCATION PUBLIC ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ICONDATABASE PUBLIC ON)
diff --git a/Source/cmake/OptionsWPE.cmake b/Source/cmake/OptionsWPE.cmake
index c5dc4df..4dc17a9 100644
--- a/Source/cmake/OptionsWPE.cmake
+++ b/Source/cmake/OptionsWPE.cmake
@@ -31,6 +31,7 @@
 # we need a value different from the default defined in WebKitFeatures.cmake.
 # Changing these options is completely unsupported.
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCESSIBILITY PRIVATE ON)
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ASYNC_SCROLLING PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_FULLSCREEN_API PRIVATE OFF)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_GEOLOCATION PRIVATE OFF)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MHTML PRIVATE ON)