<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[169733] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/169733">169733</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2014-06-09 17:37:06 -0700 (Mon, 09 Jun 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Work towards having frames in the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=133665

Reviewed by Tim Horton.

Source/WebCore:
Optionally (based on Setting) create nodes in the scrolling tree for frames which
contain async-scrollable content. This will be used on iOS/WK2 to support accelerated
overflow-scroll in iframes. The setting allows for testing on OS X.

The change breaks an assumption in ScrollingCoordinator/AsyncScrollingCoordinator
that we're always dealing with the main frame, and changes logic in RenderLayerCompositor
so that we can connect the scrolling tree across frame boundaries. RenderLayerCompositor
maintains a m_subframeScrollLayersNeedReattach flag that gets set whenever we add or remove
scroll-coordinated layers in the current frame. When set, after updating compositing
layers we walk child frames, and, if they have scrolling nodes, re-attach them to the
scrolling tree (which will find the new ancestor node).

Tests: platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed.html
       platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame.html

* WebCore.exp.in:
* page/FrameView.cpp:
(WebCore::FrameView::scrollLayerID): Use the new &quot;for role&quot; way of getting the node ID.
* page/Settings.cpp:
* page/Settings.in: Add scrollingTreeIncludesFrames.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged): Only set
the region for the main frame.
(WebCore::AsyncScrollingCoordinator::frameViewForScrollingNode): updateScrollPositionAfterAsyncScroll()
needs to know which FrameView a given nodeID is hosted in; doing a walk of the frame tree for
non-main frames seems to be the safest way.
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::syncChildPositions):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView): Consult the new setting.
(WebCore::ScrollingCoordinator::frameViewHasSlowRepaintObjectsDidChange):
(WebCore::ScrollingCoordinator::frameViewFixedObjectsDidChange):
(WebCore::ScrollingCoordinator::frameViewRootLayerDidChange):
(WebCore::ScrollingCoordinator::synchronousScrollingReasons):
(WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons):
(WebCore::ScrollingCoordinator::setForceSynchronousScrollLayerPositionUpdates):
(WebCore::ScrollingCoordinator::shouldUpdateScrollLayerPositionSynchronously):
(WebCore::ScrollingCoordinator::replaySessionStateDidChange):
(WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText):
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::shouldUpdateScrollLayerPositionSynchronously): Deleted.
* rendering/RenderLayerBacking.h: Rather than separate functions to get the two scrolling
node IDs, having one scrollingNodeIDForRole() makes calling code cleaner.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::RenderLayerCompositor):
(WebCore::RenderLayerCompositor::updateCompositingLayers):  call reattachSubframeScrollLayers()
after a compositing tree update.
(WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer): Deals with the various configurations
in which we can do async scrolling of sticky elements.
(WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer):
(WebCore::useCoordinatedScrollingForLayer):
(WebCore::RenderLayerCompositor::requiresCompositingForPosition):
(WebCore::RenderLayerCompositor::requiresCompositingForScrolling): Moved.
(WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange): This is a bug fix;
we only need to notify child frames, not all descendant frames.
(WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
(WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
(WebCore::enclosingScrollingNodeID):
(WebCore::scrollCoordinatedAncestorInParentOfFrame):
(WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
(WebCore::RenderLayerCompositor::attachScrollingNode):
(WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
(WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers):
(WebCore::RenderLayerCompositor::willRemoveScrollingLayer):
(WebCore::isStickyInAcceleratedScrollingLayerOrViewport): Deleted.
(WebCore::isViewportConstrainedFixedOrStickyLayer): Deleted.
(WebCore::isMainFrameScrollingOrOverflowScrolling): Deleted.
(WebCore::nearestScrollCoordinatedAncestor): Deleted.
* rendering/RenderLayerCompositor.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::setSelection): Added comment.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::setScrollingTreeIncludesFrames):
* testing/InternalSettings.h: Removed some useless parameter names.
* testing/InternalSettings.idl: Added setScrollingTreeIncludesFrames() setting.

Source/WebKit2:
Override coordinatesScrollingForFrameView() to always return true for composited
frames, for iOS WK2 (eventually this class will have to be specialized for iOS and OS X).

* WebProcess/Scrolling/RemoteScrollingCoordinator.h:
* WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
(WebKit::RemoteScrollingCoordinator::coordinatesScrollingForFrameView):

LayoutTests:
Tests that dump the scrolling tree with subframes.

* platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-expected.txt: Added.
* platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed-expected.txt: Added.
* platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed.html: Added.
* platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame.html: Added.
* platform/mac-wk2/tiled-drawing/scrolling/frames/resources/doc-with-sticky.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
<li><a href="#trunkSourceWebCorepageSettingscpp">trunk/Source/WebCore/page/Settings.cpp</a></li>
<li><a href="#trunkSourceWebCorepageSettingsin">trunk/Source/WebCore/page/Settings.in</a></li>
<li><a href="#trunkSourceWebCorepagescrollingAsyncScrollingCoordinatorcpp">trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingAsyncScrollingCoordinatorh">trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingCoordinatorcpp">trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingCoordinatorh">trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerBackingh">trunk/Source/WebCore/rendering/RenderLayerBacking.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerCompositorcpp">trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerCompositorh">trunk/Source/WebCore/rendering/RenderLayerCompositor.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderViewcpp">trunk/Source/WebCore/rendering/RenderView.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalSettingscpp">trunk/Source/WebCore/testing/InternalSettings.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalSettingsh">trunk/Source/WebCore/testing/InternalSettings.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalSettingsidl">trunk/Source/WebCore/testing/InternalSettings.idl</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessScrollingRemoteScrollingCoordinatorh">trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessScrollingRemoteScrollingCoordinatormm">trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/</li>
<li><a href="#trunkLayoutTestsplatformmacwk2tileddrawingscrollingframescoordinatedframeexpectedtxt">trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2tileddrawingscrollingframescoordinatedframeinfixedexpectedtxt">trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2tileddrawingscrollingframescoordinatedframeinfixedhtml">trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed.html</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2tileddrawingscrollingframescoordinatedframehtml">trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame.html</a></li>
<li>trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/resources/</li>
<li><a href="#trunkLayoutTestsplatformmacwk2tileddrawingscrollingframesresourcesdocwithstickyhtml">trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/resources/doc-with-sticky.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (169732 => 169733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-06-10 00:26:48 UTC (rev 169732)
+++ trunk/LayoutTests/ChangeLog        2014-06-10 00:37:06 UTC (rev 169733)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2014-06-09  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        Work towards having frames in the scrolling tree
+        https://bugs.webkit.org/show_bug.cgi?id=133665
+
+        Reviewed by Tim Horton.
+        
+        Tests that dump the scrolling tree with subframes.
+
+        * platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-expected.txt: Added.
+        * platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed-expected.txt: Added.
+        * platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed.html: Added.
+        * platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame.html: Added.
+        * platform/mac-wk2/tiled-drawing/scrolling/frames/resources/doc-with-sticky.html: Added.
+
</ins><span class="cx"> 2014-06-09  Eric Carlson  &lt;eric.carlson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Automatic text track selection can select more than one track
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2tileddrawingscrollingframescoordinatedframeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-expected.txt (0 => 169733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-expected.txt        2014-06-10 00:37:06 UTC (rev 169733)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+(Frame scrolling node
+  (scrollable area size 785 600)
+  (contents size 785 1016)
+  (children 1
+    (Frame scrolling node
+      (scrollable area size 485 300)
+      (contents size 485 1868)
+      (children 1
+        (Sticky node
+          (anchor edges: AnchorEdgeTop )
+          (top offset 10.00)
+          (containing block rect 8.00, 10.00 469.00 x 1850.00)
+          (sticky box rect 8.00 830.00 100.00 100.00)
+          (sticky box rect 8.00 830.00 100.00 100.00)
+          (sticky offset at last layout 0.00 0.00)
+          (layer position at last layout 8.00 830.00)
+        )
+      )
+    )
+  )
+)
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2tileddrawingscrollingframescoordinatedframeinfixedexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed-expected.txt (0 => 169733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed-expected.txt        2014-06-10 00:37:06 UTC (rev 169733)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+(Frame scrolling node
+  (scrollable area size 785 600)
+  (contents size 785 1016)
+  (children 1
+    (Fixed node
+      (anchor edges: AnchorEdgeLeft AnchorEdgeTop)
+      (viewport rect at last layout: 0.00 0.00 785.00 600.00)
+      (layer position at last layout 8.00 0.00)
+      (children 1
+        (Frame scrolling node
+          (scrollable area size 485 300)
+          (contents size 485 1868)
+          (children 1
+            (Sticky node
+              (anchor edges: AnchorEdgeTop )
+              (top offset 10.00)
+              (containing block rect 8.00, 10.00 469.00 x 1850.00)
+              (sticky box rect 8.00 830.00 100.00 100.00)
+              (sticky box rect 8.00 830.00 100.00 100.00)
+              (sticky offset at last layout 0.00 0.00)
+              (layer position at last layout 8.00 830.00)
+            )
+          )
+        )
+      )
+    )
+  )
+)
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2tileddrawingscrollingframescoordinatedframeinfixedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed.html (0 => 169733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed.html                                (rev 0)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed.html        2014-06-10 00:37:06 UTC (rev 169733)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        body {
+            height: 1000px;
+        }
+        
+        iframe {
+            display: block;
+            margin: 10px;
+            border: 5px solid black;
+        }
+        
+        #container {
+            position: absolute;
+            top: 10px;
+            border: 4px solid green;
+            padding: 10px;
+        }
+        
+        #container {
+            position: fixed;
+            top: 0;
+            border: 4px solid orange;
+        }
+        
+        #tree {
+            position: absolute;
+            top: 375px;
+        }
+    &lt;/style&gt;
+    &lt;script&gt;
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            window.internals.settings.setScrollingTreeIncludesFrames(true);
+        }
+
+        function startTest()
+        {
+            if (window.internals)
+                document.getElementById('tree').innerText = internals.scrollingStateTreeAsText();
+        }
+        
+        window.addEventListener('load', startTest, false);
+    &lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    
+    &lt;div id=&quot;container&quot;&gt;
+        &lt;iframe src=&quot;resources/doc-with-sticky.html&quot; width=&quot;500&quot; height=&quot;300&quot;&gt;&lt;/iframe&gt;
+    &lt;/div&gt;
+&lt;pre id=&quot;tree&quot;&gt;Scrolling tree goes here&lt;/pre&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2tileddrawingscrollingframescoordinatedframehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame.html (0 => 169733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame.html                                (rev 0)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame.html        2014-06-10 00:37:06 UTC (rev 169733)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        body {
+            height: 1000px;
+        }
+        
+        iframe {
+            display: block;
+            margin: 10px;
+            border: 5px solid black;
+        }
+        
+        #container {
+            position: absolute;
+            top: 10px;
+            border: 4px solid green;
+            padding: 10px;
+        }
+        
+        #container {
+            border: 4px solid orange;
+        }
+        
+        #tree {
+            position: absolute;
+            top: 375px;
+        }
+    &lt;/style&gt;
+    &lt;script&gt;
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            window.internals.settings.setScrollingTreeIncludesFrames(true);
+        }
+
+        function startTest()
+        {
+            if (window.internals)
+                document.getElementById('tree').innerText = internals.scrollingStateTreeAsText();
+        }
+        
+        window.addEventListener('load', startTest, false);
+    &lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    
+    &lt;div id=&quot;container&quot;&gt;
+        &lt;iframe src=&quot;resources/doc-with-sticky.html&quot; width=&quot;500&quot; height=&quot;300&quot;&gt;&lt;/iframe&gt;
+    &lt;/div&gt;
+&lt;pre id=&quot;tree&quot;&gt;Scrolling tree goes here&lt;/pre&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2tileddrawingscrollingframesresourcesdocwithstickyhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/resources/doc-with-sticky.html (0 => 169733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/resources/doc-with-sticky.html                                (rev 0)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/resources/doc-with-sticky.html        2014-06-10 00:37:06 UTC (rev 169733)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+
+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        .box {
+            height: 100px;
+            width: 100px;
+            background-color: blue;
+        }
+        
+        .spacer {
+            height: 400px;
+            margin: 10px;
+            background-color: silver;
+        }
+        .sticky {
+            position: -webkit-sticky;
+            top: 10px;
+        }
+        
+        .composited {
+            -webkit-transform: translateZ(0);
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div class=&quot;spacer&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;spacer&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;sticky box&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;spacer&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;spacer&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;composited box&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (169732 => 169733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-06-10 00:26:48 UTC (rev 169732)
+++ trunk/Source/WebCore/ChangeLog        2014-06-10 00:37:06 UTC (rev 169733)
</span><span class="lines">@@ -1,3 +1,90 @@
</span><ins>+2014-06-09  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        Work towards having frames in the scrolling tree
+        https://bugs.webkit.org/show_bug.cgi?id=133665
+
+        Reviewed by Tim Horton.
+        
+        Optionally (based on Setting) create nodes in the scrolling tree for frames which
+        contain async-scrollable content. This will be used on iOS/WK2 to support accelerated
+        overflow-scroll in iframes. The setting allows for testing on OS X.
+        
+        The change breaks an assumption in ScrollingCoordinator/AsyncScrollingCoordinator
+        that we're always dealing with the main frame, and changes logic in RenderLayerCompositor
+        so that we can connect the scrolling tree across frame boundaries. RenderLayerCompositor
+        maintains a m_subframeScrollLayersNeedReattach flag that gets set whenever we add or remove
+        scroll-coordinated layers in the current frame. When set, after updating compositing
+        layers we walk child frames, and, if they have scrolling nodes, re-attach them to the
+        scrolling tree (which will find the new ancestor node).
+
+        Tests: platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed.html
+               platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame.html
+
+        * WebCore.exp.in:
+        * page/FrameView.cpp:
+        (WebCore::FrameView::scrollLayerID): Use the new &quot;for role&quot; way of getting the node ID.
+        * page/Settings.cpp:
+        * page/Settings.in: Add scrollingTreeIncludesFrames.
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
+        (WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged): Only set
+        the region for the main frame.
+        (WebCore::AsyncScrollingCoordinator::frameViewForScrollingNode): updateScrollPositionAfterAsyncScroll()
+        needs to know which FrameView a given nodeID is hosted in; doing a walk of the frame tree for
+        non-main frames seems to be the safest way.
+        (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
+        (WebCore::AsyncScrollingCoordinator::syncChildPositions):
+        * page/scrolling/AsyncScrollingCoordinator.h:
+        * page/scrolling/ScrollingCoordinator.cpp:
+        (WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView): Consult the new setting.
+        (WebCore::ScrollingCoordinator::frameViewHasSlowRepaintObjectsDidChange):
+        (WebCore::ScrollingCoordinator::frameViewFixedObjectsDidChange):
+        (WebCore::ScrollingCoordinator::frameViewRootLayerDidChange):
+        (WebCore::ScrollingCoordinator::synchronousScrollingReasons):
+        (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons):
+        (WebCore::ScrollingCoordinator::setForceSynchronousScrollLayerPositionUpdates):
+        (WebCore::ScrollingCoordinator::shouldUpdateScrollLayerPositionSynchronously):
+        (WebCore::ScrollingCoordinator::replaySessionStateDidChange):
+        (WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText):
+        * page/scrolling/ScrollingCoordinator.h:
+        (WebCore::ScrollingCoordinator::shouldUpdateScrollLayerPositionSynchronously): Deleted.
+        * rendering/RenderLayerBacking.h: Rather than separate functions to get the two scrolling
+        node IDs, having one scrollingNodeIDForRole() makes calling code cleaner.
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::RenderLayerCompositor):
+        (WebCore::RenderLayerCompositor::updateCompositingLayers):  call reattachSubframeScrollLayers()
+        after a compositing tree update.
+        (WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer): Deals with the various configurations
+        in which we can do async scrolling of sticky elements.
+        (WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer):
+        (WebCore::useCoordinatedScrollingForLayer):
+        (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
+        (WebCore::RenderLayerCompositor::requiresCompositingForScrolling): Moved.
+        (WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange): This is a bug fix;
+        we only need to notify child frames, not all descendant frames.
+        (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
+        (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
+        (WebCore::enclosingScrollingNodeID):
+        (WebCore::scrollCoordinatedAncestorInParentOfFrame):
+        (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
+        (WebCore::RenderLayerCompositor::attachScrollingNode):
+        (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
+        (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
+        (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
+        (WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers):
+        (WebCore::RenderLayerCompositor::willRemoveScrollingLayer):
+        (WebCore::isStickyInAcceleratedScrollingLayerOrViewport): Deleted.
+        (WebCore::isViewportConstrainedFixedOrStickyLayer): Deleted.
+        (WebCore::isMainFrameScrollingOrOverflowScrolling): Deleted.
+        (WebCore::nearestScrollCoordinatedAncestor): Deleted.
+        * rendering/RenderLayerCompositor.h:
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::setSelection): Added comment.
+        * testing/InternalSettings.cpp:
+        (WebCore::InternalSettings::setScrollingTreeIncludesFrames):
+        * testing/InternalSettings.h: Removed some useless parameter names.
+        * testing/InternalSettings.idl: Added setScrollingTreeIncludesFrames() setting.
+
</ins><span class="cx"> 2014-06-09  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Improve CSSPrimitiveValue::customCSSText for ARMv7
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (169732 => 169733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-06-10 00:26:48 UTC (rev 169732)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-06-10 00:37:06 UTC (rev 169733)
</span><span class="lines">@@ -1521,6 +1521,7 @@
</span><span class="cx"> __ZNK7WebCore10RenderText16firstRunLocationEv
</span><span class="cx"> __ZNK7WebCore10RenderText16linesBoundingBoxEv
</span><span class="cx"> __ZNK7WebCore10RenderView12documentRectEv
</span><ins>+__ZNK7WebCore10RenderView15usesCompositingEv
</ins><span class="cx"> __ZNK7WebCore10RenderView20unscaledDocumentRectEv
</span><span class="cx"> __ZNK7WebCore10ScrollView12contentsSizeEv
</span><span class="cx"> __ZNK7WebCore10ScrollView12documentViewEv
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (169732 => 169733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2014-06-10 00:26:48 UTC (rev 169732)
+++ trunk/Source/WebCore/page/FrameView.cpp        2014-06-10 00:37:06 UTC (rev 169733)
</span><span class="lines">@@ -804,7 +804,7 @@
</span><span class="cx">     if (!backing)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    return backing-&gt;scrollingNodeID();
</del><ins>+    return backing-&gt;scrollingNodeIDForRole(FrameScrollingNode);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ScrollableArea* FrameView::scrollableAreaForScrollLayerID(uint64_t nodeID) const
</span></span></pre></div>
<a id="trunkSourceWebCorepageSettingscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Settings.cpp (169732 => 169733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Settings.cpp        2014-06-10 00:26:48 UTC (rev 169732)
+++ trunk/Source/WebCore/page/Settings.cpp        2014-06-10 00:37:06 UTC (rev 169733)
</span><span class="lines">@@ -127,6 +127,7 @@
</span><span class="cx"> static const bool defaultMediaPlaybackAllowsInline = false;
</span><span class="cx"> static const bool defaultMediaPlaybackRequiresUserGesture = true;
</span><span class="cx"> static const bool defaultShouldRespectImageOrientation = true;
</span><ins>+static const bool defaultScrollingTreeIncludesFrames = true;
</ins><span class="cx"> #else
</span><span class="cx"> static const bool defaultFixedPositionCreatesStackingContext = false;
</span><span class="cx"> static const bool defaultFixedBackgroundsPaintRelativeToDocument = false;
</span><span class="lines">@@ -134,6 +135,7 @@
</span><span class="cx"> static const bool defaultMediaPlaybackAllowsInline = true;
</span><span class="cx"> static const bool defaultMediaPlaybackRequiresUserGesture = false;
</span><span class="cx"> static const bool defaultShouldRespectImageOrientation = false;
</span><ins>+static const bool defaultScrollingTreeIncludesFrames = false;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> static const double defaultIncrementalRenderingSuppressionTimeoutInSeconds = 5;
</span></span></pre></div>
<a id="trunkSourceWebCorepageSettingsin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Settings.in (169732 => 169733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Settings.in        2014-06-10 00:26:48 UTC (rev 169732)
+++ trunk/Source/WebCore/page/Settings.in        2014-06-10 00:37:06 UTC (rev 169733)
</span><span class="lines">@@ -132,6 +132,7 @@
</span><span class="cx"> shouldDisplayCaptions initial=false, conditional=VIDEO_TRACK
</span><span class="cx"> shouldDisplayTextDescriptions initial=false, conditional=VIDEO_TRACK
</span><span class="cx"> scrollingCoordinatorEnabled initial=false
</span><ins>+scrollingTreeIncludesFrames initial=defaultScrollingTreeIncludesFrames
</ins><span class="cx"> scrollAnimatorEnabled initial=true, conditional=SMOOTH_SCROLLING
</span><span class="cx"> notificationsEnabled initial=true
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingAsyncScrollingCoordinatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (169732 => 169733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp        2014-06-10 00:26:48 UTC (rev 169732)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp        2014-06-10 00:37:06 UTC (rev 169733)
</span><span class="lines">@@ -72,7 +72,8 @@
</span><span class="cx">     // frame view whose layout was updated is not the main frame.
</span><span class="cx">     // In the future, we may want to have the ability to set non-fast scrolling regions for more than
</span><span class="cx">     // just the root node. But right now, this concept only applies to the root.
</span><del>-    m_scrollingStateTree-&gt;rootStateNode()-&gt;setNonFastScrollableRegion(computeNonFastScrollableRegion(&amp;m_page-&gt;mainFrame(), IntPoint()));
</del><ins>+    if (frameView-&gt;frame().isMainFrame())
+        m_scrollingStateTree-&gt;rootStateNode()-&gt;setNonFastScrollableRegion(computeNonFastScrollableRegion(&amp;frameView-&gt;frame(), IntPoint()));
</ins><span class="cx"> 
</span><span class="cx">     if (!coordinatesScrollingForFrameView(frameView))
</span><span class="cx">         return;
</span><span class="lines">@@ -105,12 +106,13 @@
</span><span class="cx">     node-&gt;setScrollableAreaParameters(scrollParameters);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged(FrameView*)
</del><ins>+void AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged(FrameView* frameView)
</ins><span class="cx"> {
</span><span class="cx">     if (!m_scrollingStateTree-&gt;rootStateNode())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_scrollingStateTree-&gt;rootStateNode()-&gt;setNonFastScrollableRegion(computeNonFastScrollableRegion(&amp;m_page-&gt;mainFrame(), IntPoint()));
</del><ins>+    if (frameView-&gt;frame().isMainFrame())
+        m_scrollingStateTree-&gt;rootStateNode()-&gt;setNonFastScrollableRegion(computeNonFastScrollableRegion(&amp;frameView-&gt;frame(), IntPoint()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AsyncScrollingCoordinator::frameViewRootLayerDidChange(FrameView* frameView)
</span><span class="lines">@@ -193,6 +195,35 @@
</span><span class="cx">     updateScrollPositionAfterAsyncScroll(m_scheduledScrollUpdate.nodeID, m_scheduledScrollUpdate.scrollPosition, m_scheduledScrollUpdate.isProgrammaticScroll, m_scheduledScrollUpdate.updateLayerPositionAction);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+FrameView* AsyncScrollingCoordinator::frameViewForScrollingNode(ScrollingNodeID scrollingNodeID) const
+{
+    if (scrollingNodeID == m_scrollingStateTree-&gt;rootStateNode()-&gt;scrollingNodeID())
+        return m_page-&gt;mainFrame().view();
+
+    ScrollingStateNode* stateNode = m_scrollingStateTree-&gt;stateNodeForID(scrollingNodeID);
+    if (!stateNode)
+        return nullptr;
+
+    // Find the enclosing frame scrolling node.
+    ScrollingStateNode* parentNode = stateNode;
+    while (parentNode &amp;&amp; parentNode-&gt;nodeType() != FrameScrollingNode)
+        parentNode = parentNode-&gt;parent();
+    
+    if (!parentNode)
+        return nullptr;
+    
+    // Walk the frame tree to find the matching FrameView. This is not ideal, but avoids back pointers to FrameViews
+    // from ScrollingTreeStateNodes.
+    for (Frame* frame = &amp;m_page-&gt;mainFrame(); frame; frame = frame-&gt;tree().traverseNext()) {
+        if (FrameView* view = frame-&gt;view()) {
+            if (view-&gt;scrollLayerID() == parentNode-&gt;scrollingNodeID())
+                return view;
+        }
+    }
+
+    return nullptr;
+}
+
</ins><span class="cx"> void AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll(ScrollingNodeID scrollingNodeID, const FloatPoint&amp; scrollPosition, bool programmaticScroll, SetOrSyncScrollingLayerPosition scrollingLayerPositionAction)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span><span class="lines">@@ -200,11 +231,10 @@
</span><span class="cx">     if (!m_page)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    FrameView* frameView = m_page-&gt;mainFrame().view();
</del><ins>+    FrameView* frameView = frameViewForScrollingNode(scrollingNodeID);
</ins><span class="cx">     if (!frameView)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    // Main frame.
</del><span class="cx">     if (scrollingNodeID == frameView-&gt;scrollLayerID()) {
</span><span class="cx">         bool oldProgrammaticScroll = frameView-&gt;inProgrammaticScroll();
</span><span class="cx">         frameView-&gt;setInProgrammaticScroll(programmaticScroll);
</span><span class="lines">@@ -316,11 +346,8 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // FIXME: We'll have to traverse deeper into the tree at some point.
</span><del>-    size_t size = children-&gt;size();
-    for (size_t i = 0; i &lt; size; ++i) {
-        ScrollingStateNode* child = children-&gt;at(i).get();
</del><ins>+    for (auto&amp; child : *children)
</ins><span class="cx">         child-&gt;syncLayerPositionForViewportRect(viewportRect);
</span><del>-    }
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AsyncScrollingCoordinator::ensureRootStateNodeForFrameView(FrameView* frameView)
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingAsyncScrollingCoordinatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h (169732 => 169733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h        2014-06-10 00:26:48 UTC (rev 169732)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h        2014-06-10 00:37:06 UTC (rev 169733)
</span><span class="lines">@@ -70,6 +70,8 @@
</span><span class="cx"> 
</span><span class="cx">     void updateScrollPositionAfterAsyncScroll(ScrollingNodeID, const FloatPoint&amp;, bool programmaticScroll, SetOrSyncScrollingLayerPosition);
</span><span class="cx"> 
</span><ins>+    virtual String scrollingStateTreeAsText() const override;
+
</ins><span class="cx"> private:
</span><span class="cx">     virtual bool isAsyncScrollingCoordinator() const override { return true; }
</span><span class="cx"> 
</span><span class="lines">@@ -91,7 +93,6 @@
</span><span class="cx">     virtual void updateFrameScrollingNode(ScrollingNodeID, GraphicsLayer* scrollLayer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry* = nullptr);
</span><span class="cx">     virtual void updateOverflowScrollingNode(ScrollingNodeID, GraphicsLayer* scrollLayer, GraphicsLayer* scrolledContentsLayer, const ScrollingGeometry* = nullptr);
</span><span class="cx">     
</span><del>-    virtual String scrollingStateTreeAsText() const override;
</del><span class="cx">     virtual bool isRubberBandInProgress() const override;
</span><span class="cx">     virtual void setScrollPinningBehavior(ScrollPinningBehavior) override;
</span><span class="cx"> 
</span><span class="lines">@@ -107,6 +108,8 @@
</span><span class="cx">     void updateMainFrameScrollLayerPosition();
</span><span class="cx"> 
</span><span class="cx">     void updateScrollPositionAfterAsyncScrollTimerFired(Timer&lt;AsyncScrollingCoordinator&gt;*);
</span><ins>+    
+    FrameView* frameViewForScrollingNode(ScrollingNodeID) const;
</ins><span class="cx"> 
</span><span class="cx">     Timer&lt;AsyncScrollingCoordinator&gt; m_updateNodeScrollPositionTimer;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingCoordinatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (169732 => 169733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp        2014-06-10 00:26:48 UTC (rev 169732)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp        2014-06-10 00:37:06 UTC (rev 169733)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> #include &quot;RenderLayerCompositor.h&quot;
</span><span class="cx"> #include &quot;RenderView.h&quot;
</span><span class="cx"> #include &quot;ScrollAnimator.h&quot;
</span><ins>+#include &quot;Settings.h&quot;
</ins><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> #include &lt;wtf/text/StringBuilder.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -86,11 +87,9 @@
</span><span class="cx">     ASSERT(isMainThread());
</span><span class="cx">     ASSERT(m_page);
</span><span class="cx"> 
</span><del>-    // We currently only handle the main frame.
-    if (!frameView-&gt;frame().isMainFrame())
</del><ins>+    if (!frameView-&gt;frame().isMainFrame() &amp;&amp; !m_page-&gt;settings().scrollingTreeIncludesFrames())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    // We currently only support composited mode.
</del><span class="cx">     RenderView* renderView = m_page-&gt;mainFrame().contentRenderer();
</span><span class="cx">     if (!renderView)
</span><span class="cx">         return false;
</span><span class="lines">@@ -181,7 +180,7 @@
</span><span class="cx">     if (!coordinatesScrollingForFrameView(frameView))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    updateSynchronousScrollingReasons();
</del><ins>+    updateSynchronousScrollingReasons(frameView);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollingCoordinator::frameViewFixedObjectsDidChange(FrameView* frameView)
</span><span class="lines">@@ -192,7 +191,7 @@
</span><span class="cx">     if (!coordinatesScrollingForFrameView(frameView))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    updateSynchronousScrollingReasons();
</del><ins>+    updateSynchronousScrollingReasons(frameView);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> GraphicsLayer* ScrollingCoordinator::scrollLayerForScrollableArea(ScrollableArea* scrollableArea)
</span><span class="lines">@@ -285,7 +284,7 @@
</span><span class="cx"> 
</span><span class="cx">     frameViewLayoutUpdated(frameView);
</span><span class="cx">     recomputeWheelEventHandlerCountForFrameView(frameView);
</span><del>-    updateSynchronousScrollingReasons();
</del><ins>+    updateSynchronousScrollingReasons(frameView);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="lines">@@ -322,9 +321,8 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-SynchronousScrollingReasons ScrollingCoordinator::synchronousScrollingReasons() const
</del><ins>+SynchronousScrollingReasons ScrollingCoordinator::synchronousScrollingReasons(FrameView* frameView) const
</ins><span class="cx"> {
</span><del>-    FrameView* frameView = m_page-&gt;mainFrame().view();
</del><span class="cx">     if (!frameView)
</span><span class="cx">         return static_cast&lt;SynchronousScrollingReasons&gt;(0);
</span><span class="cx"> 
</span><span class="lines">@@ -343,15 +341,20 @@
</span><span class="cx">         synchronousScrollingReasons |= HasViewportConstrainedObjectsWithoutSupportingFixedLayers;
</span><span class="cx">     if (supportsFixedPositionLayers() &amp;&amp; hasVisibleSlowRepaintViewportConstrainedObjects(frameView))
</span><span class="cx">         synchronousScrollingReasons |= HasNonLayerViewportConstrainedObjects;
</span><del>-    if (m_page-&gt;mainFrame().document() &amp;&amp; m_page-&gt;mainFrame().document()-&gt;isImageDocument())
</del><ins>+    if (frameView-&gt;frame().mainFrame().document() &amp;&amp; frameView-&gt;frame().document()-&gt;isImageDocument())
</ins><span class="cx">         synchronousScrollingReasons |= IsImageDocument;
</span><span class="cx"> 
</span><span class="cx">     return synchronousScrollingReasons;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ScrollingCoordinator::updateSynchronousScrollingReasons()
</del><ins>+void ScrollingCoordinator::updateSynchronousScrollingReasons(FrameView* frameView)
</ins><span class="cx"> {
</span><del>-    setSynchronousScrollingReasons(synchronousScrollingReasons());
</del><ins>+    // FIXME: Once we support async scrolling of iframes, we'll have to track the synchronous scrolling
+    // reasons per frame (maybe on scrolling tree nodes).
+    if (!frameView-&gt;frame().isMainFrame())
+        return;
+
+    setSynchronousScrollingReasons(synchronousScrollingReasons(frameView));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollingCoordinator::setForceSynchronousScrollLayerPositionUpdates(bool forceSynchronousScrollLayerPositionUpdates)
</span><span class="lines">@@ -360,13 +363,19 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     m_forceSynchronousScrollLayerPositionUpdates = forceSynchronousScrollLayerPositionUpdates;
</span><del>-    updateSynchronousScrollingReasons();
</del><ins>+    updateSynchronousScrollingReasons(m_page-&gt;mainFrame().view());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool ScrollingCoordinator::shouldUpdateScrollLayerPositionSynchronously() const
+{
+    return synchronousScrollingReasons(m_page-&gt;mainFrame().view());
+}
+
</ins><span class="cx"> #if ENABLE(WEB_REPLAY)
</span><span class="cx"> void ScrollingCoordinator::replaySessionStateDidChange()
</span><span class="cx"> {
</span><del>-    updateSynchronousScrollingReasons();
</del><ins>+    // FIXME: Once we support async scrolling of iframes, this should go through all subframes.
+    updateSynchronousScrollingReasons(m_page-&gt;mainFrame().view());
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -403,7 +412,7 @@
</span><span class="cx"> 
</span><span class="cx"> String ScrollingCoordinator::synchronousScrollingReasonsAsText() const
</span><span class="cx"> {
</span><del>-    return synchronousScrollingReasonsAsText(synchronousScrollingReasons());
</del><ins>+    return synchronousScrollingReasonsAsText(synchronousScrollingReasons(m_page-&gt;mainFrame().view()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingCoordinatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h (169732 => 169733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h        2014-06-10 00:26:48 UTC (rev 169732)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h        2014-06-10 00:37:06 UTC (rev 169733)
</span><span class="lines">@@ -110,7 +110,7 @@
</span><span class="cx">     virtual bool isRemoteScrollingCoordinator() const { return false; }
</span><span class="cx"> 
</span><span class="cx">     // Return whether this scrolling coordinator handles scrolling for the given frame view.
</span><del>-    bool coordinatesScrollingForFrameView(FrameView*) const;
</del><ins>+    virtual bool coordinatesScrollingForFrameView(FrameView*) const;
</ins><span class="cx"> 
</span><span class="cx">     // Should be called whenever the given frame view has been laid out.
</span><span class="cx">     virtual void frameViewLayoutUpdated(FrameView*) { }
</span><span class="lines">@@ -183,8 +183,8 @@
</span><span class="cx">         IsImageDocument = 1 &lt;&lt; 4
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    SynchronousScrollingReasons synchronousScrollingReasons() const;
-    bool shouldUpdateScrollLayerPositionSynchronously() const { return synchronousScrollingReasons(); }
</del><ins>+    SynchronousScrollingReasons synchronousScrollingReasons(FrameView*) const;
+    bool shouldUpdateScrollLayerPositionSynchronously() const;
</ins><span class="cx"> 
</span><span class="cx">     virtual void willDestroyScrollableArea(ScrollableArea*) { }
</span><span class="cx">     virtual void scrollableAreaScrollLayerDidChange(ScrollableArea*) { }
</span><span class="lines">@@ -218,7 +218,7 @@
</span><span class="cx">     virtual void setSynchronousScrollingReasons(SynchronousScrollingReasons) { }
</span><span class="cx"> 
</span><span class="cx">     virtual bool hasVisibleSlowRepaintViewportConstrainedObjects(FrameView*) const;
</span><del>-    void updateSynchronousScrollingReasons();
</del><ins>+    void updateSynchronousScrollingReasons(FrameView*);
</ins><span class="cx">     
</span><span class="cx">     bool m_forceSynchronousScrollLayerPositionUpdates;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerBackingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.h (169732 => 169733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerBacking.h        2014-06-10 00:26:48 UTC (rev 169732)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.h        2014-06-10 00:37:06 UTC (rev 169733)
</span><span class="lines">@@ -108,13 +108,34 @@
</span><span class="cx">     GraphicsLayer* scrollingContentsLayer() const { return m_scrollingContentsLayer.get(); }
</span><span class="cx"> 
</span><span class="cx">     void detachFromScrollingCoordinator();
</span><del>-
-    ScrollingNodeID viewportConstrainedNodeID() const { return m_viewportConstrainedNodeID; }
-    void setViewportConstrainedNodeID(ScrollingNodeID nodeID) { m_viewportConstrainedNodeID = nodeID; }
-
-    ScrollingNodeID scrollingNodeID() const { return m_scrollingNodeID; }
-    void setScrollingNodeID(ScrollingNodeID nodeID) { m_scrollingNodeID = nodeID; }
</del><span class="cx">     
</span><ins>+    ScrollingNodeID scrollingNodeIDForRole(ScrollingNodeType nodeType) const
+    {
+        switch (nodeType) {
+        case FrameScrollingNode:
+        case OverflowScrollingNode:
+            return m_scrollingNodeID;
+        case FixedNode:
+        case StickyNode:
+            return m_viewportConstrainedNodeID;
+        }
+        return 0;
+    }
+    
+    void setScrollingNodeIDForRole(ScrollingNodeID nodeID, ScrollingNodeType nodeType)
+    {
+        switch (nodeType) {
+        case FrameScrollingNode:
+        case OverflowScrollingNode:
+            m_scrollingNodeID = nodeID;
+            break;
+        case FixedNode:
+        case StickyNode:
+            m_viewportConstrainedNodeID = nodeID;
+            break;
+        }
+    }
+    
</ins><span class="cx">     ScrollingNodeID scrollingNodeIDForChildren() const { return m_scrollingNodeID ? m_scrollingNodeID : m_viewportConstrainedNodeID; }
</span><span class="cx"> 
</span><span class="cx">     bool hasMaskLayer() const { return m_maskLayer != 0; }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerCompositorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (169732 => 169733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp        2014-06-10 00:26:48 UTC (rev 169732)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp        2014-06-10 00:37:06 UTC (rev 169733)
</span><span class="lines">@@ -279,6 +279,7 @@
</span><span class="cx">     , m_shouldFlushOnReattach(false)
</span><span class="cx">     , m_forceCompositingMode(false)
</span><span class="cx">     , m_inPostLayoutUpdate(false)
</span><ins>+    , m_subframeScrollLayersNeedReattach(false)
</ins><span class="cx">     , m_isTrackingRepaints(false)
</span><span class="cx">     , m_layersWithTiledBackingCount(0)
</span><span class="cx">     , m_rootLayerAttachment(RootLayerUnattached)
</span><span class="lines">@@ -729,10 +730,13 @@
</span><span class="cx">             else if (m_rootContentLayer)
</span><span class="cx">                 m_rootContentLayer-&gt;setChildren(childList);
</span><span class="cx">         }
</span><ins>+        
+        reattachSubframeScrollLayers();
</ins><span class="cx">     } else if (needGeometryUpdate) {
</span><span class="cx">         // We just need to do a geometry update. This is only used for position:fixed scrolling;
</span><span class="cx">         // most of the time, geometry is updated via RenderLayer::styleChanged().
</span><span class="cx">         updateLayerTreeGeometry(*updateRoot, 0);
</span><ins>+        ASSERT(!isFullUpdate || !m_subframeScrollLayersNeedReattach);
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx"> #if !LOG_DISABLED
</span><span class="lines">@@ -2523,21 +2527,6 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
-bool RenderLayerCompositor::requiresCompositingForScrolling(const RenderLayer&amp; layer) const
-{
-    if (!layer.hasAcceleratedTouchScrolling())
-        return false;
-
-    if (!m_inPostLayoutUpdate) {
-        m_reevaluateCompositingAfterLayout = true;
-        return layer.isComposited();
-    }
-
-    return layer.hasTouchScrollableOverflow();
-}
-#endif
-
</del><span class="cx"> bool RenderLayerCompositor::requiresCompositingForFilters(RenderLayerModelObject&amp; renderer) const
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(CSS_FILTERS)
</span><span class="lines">@@ -2551,32 +2540,42 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
-static bool isStickyInAcceleratedScrollingLayerOrViewport(const RenderLayer&amp; layer, const RenderLayer** enclosingAcceleratedOverflowLayer = 0)
</del><ins>+bool RenderLayerCompositor::isAsyncScrollableStickyLayer(const RenderLayer&amp; layer, const RenderLayer** enclosingAcceleratedOverflowLayer) const
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(layer.renderer().isStickyPositioned());
</span><span class="cx"> 
</span><span class="cx">     RenderLayer* enclosingOverflowLayer = layer.enclosingOverflowClipLayer(ExcludeSelf);
</span><ins>+
+#if PLATFORM(IOS)
</ins><span class="cx">     if (enclosingOverflowLayer &amp;&amp; enclosingOverflowLayer-&gt;hasTouchScrollableOverflow()) {
</span><span class="cx">         if (enclosingAcceleratedOverflowLayer)
</span><span class="cx">             *enclosingAcceleratedOverflowLayer = enclosingOverflowLayer;
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><del>-
-    return !enclosingOverflowLayer;
-}
</del><ins>+#else
+    UNUSED_PARAM(enclosingAcceleratedOverflowLayer);
</ins><span class="cx"> #endif
</span><ins>+    // If the layer is inside normal overflow, it's not async-scrollable.
+    if (enclosingOverflowLayer)
+        return false;
</ins><span class="cx"> 
</span><del>-static bool isViewportConstrainedFixedOrStickyLayer(const RenderLayer&amp; layer)
-{
</del><ins>+    // No overflow ancestor, so see if the frame supports async scrolling.
+    if (hasCoordinatedScrolling())
+        return true;
+
</ins><span class="cx"> #if PLATFORM(IOS)
</span><del>-    if (layer.renderer().isStickyPositioned())
-        return isStickyInAcceleratedScrollingLayerOrViewport(layer);
</del><ins>+    // iOS WK1 has fixed/sticky support in the main frame via WebFixedPositionContent.
+    return m_renderView.frameView().frame().isMainFrame();
</ins><span class="cx"> #else
</span><del>-    if (layer.renderer().isStickyPositioned())
-        return !layer.enclosingOverflowClipLayer(ExcludeSelf);
</del><ins>+    return false;
</ins><span class="cx"> #endif
</span><ins>+}
</ins><span class="cx"> 
</span><ins>+bool RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer(const RenderLayer&amp; layer) const
+{
+    if (layer.renderer().isStickyPositioned())
+        return isAsyncScrollableStickyLayer(layer);
+
</ins><span class="cx">     if (layer.renderer().style().position() != FixedPosition)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="lines">@@ -2589,9 +2588,9 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool isMainFrameScrollingOrOverflowScrolling(RenderView&amp; view, const RenderLayer&amp; layer)
</del><ins>+static bool useCoordinatedScrollingForLayer(RenderView&amp; view, const RenderLayer&amp; layer)
</ins><span class="cx"> {
</span><del>-    if (layer.isRootLayer() &amp;&amp; !view.document().ownerElement())
</del><ins>+    if (layer.isRootLayer() &amp;&amp; view.frameView().frame().isMainFrame())
</ins><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="lines">@@ -2624,7 +2623,7 @@
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (isSticky)
</span><del>-        return hasCoordinatedScrolling() &amp;&amp; isViewportConstrainedFixedOrStickyLayer(layer);
</del><ins>+        return isAsyncScrollableStickyLayer(layer);
</ins><span class="cx"> 
</span><span class="cx">     auto container = renderer.container();
</span><span class="cx">     // If the renderer is not hooked up yet then we have to wait until it is.
</span><span class="lines">@@ -2674,6 +2673,21 @@
</span><span class="cx">     return layer.needsCompositedScrolling();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+bool RenderLayerCompositor::requiresCompositingForScrolling(const RenderLayer&amp; layer) const
+{
+    if (!layer.hasAcceleratedTouchScrolling())
+        return false;
+
+    if (!m_inPostLayoutUpdate) {
+        m_reevaluateCompositingAfterLayout = true;
+        return layer.isComposited();
+    }
+
+    return layer.hasTouchScrollableOverflow();
+}
+#endif
+
</ins><span class="cx"> bool RenderLayerCompositor::isRunningAcceleratedTransformAnimation(RenderLayerModelObject&amp; renderer) const
</span><span class="cx"> {
</span><span class="cx">     if (!(m_compositingTriggers &amp; ChromeClient::AnimationTrigger))
</span><span class="lines">@@ -3426,9 +3440,7 @@
</span><span class="cx"> // to use a synthetic style change to get the iframes into RenderLayers in order to allow them to composite.
</span><span class="cx"> void RenderLayerCompositor::notifyIFramesOfCompositingChange()
</span><span class="cx"> {
</span><del>-    Frame&amp; frame = m_renderView.frameView().frame();
-
-    for (Frame* child = frame.tree().firstChild(); child; child = child-&gt;tree().traverseNext(&amp;frame)) {
</del><ins>+    for (Frame* child = m_renderView.frameView().frame().tree().firstChild(); child; child = child-&gt;tree().nextSibling()) {
</ins><span class="cx">         if (child-&gt;document() &amp;&amp; child-&gt;document()-&gt;ownerElement())
</span><span class="cx">             child-&gt;document()-&gt;ownerElement()-&gt;scheduleSetNeedsStyleRecalc(SyntheticStyleChange);
</span><span class="cx">     }
</span><span class="lines">@@ -3493,11 +3505,13 @@
</span><span class="cx">     if (isViewportConstrainedFixedOrStickyLayer(layer))
</span><span class="cx">         coordinationReasons |= FixedOrSticky;
</span><span class="cx"> 
</span><del>-    if (isMainFrameScrollingOrOverflowScrolling(m_renderView, layer))
</del><ins>+    if (useCoordinatedScrollingForLayer(m_renderView, layer))
</ins><span class="cx">         coordinationReasons |= Scrolling;
</span><del>-        
</del><ins>+
</ins><span class="cx">     if (coordinationReasons) {
</span><del>-        m_scrollCoordinatedLayers.add(&amp;layer);
</del><ins>+        if (m_scrollCoordinatedLayers.add(&amp;layer).isNewEntry)
+            m_subframeScrollLayersNeedReattach = true;
+
</ins><span class="cx">         updateScrollCoordinatedLayer(layer, coordinationReasons);
</span><span class="cx">     } else
</span><span class="cx">         removeFromScrollCoordinatedLayers(layer);
</span><span class="lines">@@ -3508,6 +3522,8 @@
</span><span class="cx">     if (!m_scrollCoordinatedLayers.contains(&amp;layer))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    m_subframeScrollLayersNeedReattach = true;
+    
</ins><span class="cx">     m_scrollCoordinatedLayers.remove(&amp;layer);
</span><span class="cx">     m_scrollCoordinatedLayersNeedingUpdate.remove(&amp;layer);
</span><span class="cx"> 
</span><span class="lines">@@ -3571,30 +3587,99 @@
</span><span class="cx">     return constraints;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static RenderLayerBacking* nearestScrollCoordinatedAncestor(RenderLayer&amp; layer)
</del><ins>+static ScrollingNodeID enclosingScrollingNodeID(RenderLayer&amp; layer, IncludeSelfOrNot includeSelf)
</ins><span class="cx"> {
</span><del>-    RenderLayer* ancestor = layer.parent();
-    while (ancestor) {
-        if (RenderLayerBacking* backing = ancestor-&gt;backing()) {
-            if (backing-&gt;scrollingNodeIDForChildren())
-                return backing;
</del><ins>+    RenderLayer* currLayer = includeSelf == IncludeSelf ? &amp;layer : layer.parent();
+    while (currLayer) {
+        if (RenderLayerBacking* backing = currLayer-&gt;backing()) {
+            if (ScrollingNodeID nodeID = backing-&gt;scrollingNodeIDForChildren())
+                return nodeID;
</ins><span class="cx">         }
</span><del>-        ancestor = ancestor-&gt;parent();
</del><ins>+        currLayer = currLayer-&gt;parent();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return nullptr;
</del><ins>+    return 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderLayerCompositor::updateScrollCoordinatedLayer(RenderLayer&amp; layer, ScrollCoordinationReasons reasons)
</del><ins>+static ScrollingNodeID scrollCoordinatedAncestorInParentOfFrame(Frame&amp; frame)
</ins><span class="cx"> {
</span><del>-    // FIXME: support scrolling layers in iframes.
-    if (m_renderView.document().ownerElement())
</del><ins>+    if (!frame.document() || !frame.view())
+        return 0;
+
+    // Find the frame's enclosing layer in our render tree.
+    HTMLFrameOwnerElement* ownerElement = frame.document()-&gt;ownerElement();
+    RenderElement* frameRenderer = ownerElement ? ownerElement-&gt;renderer() : nullptr;
+    if (!frameRenderer)
+        return 0;
+
+    RenderLayer* layerInParentDocument = frameRenderer-&gt;enclosingLayer();
+    if (!layerInParentDocument)
+        return 0;
+
+    return enclosingScrollingNodeID(*layerInParentDocument, IncludeSelf);
+}
+
+void RenderLayerCompositor::reattachSubframeScrollLayers()
+{
+    if (!m_subframeScrollLayersNeedReattach)
</ins><span class="cx">         return;
</span><ins>+    
+    m_subframeScrollLayersNeedReattach = false;
</ins><span class="cx"> 
</span><span class="cx">     ScrollingCoordinator* scrollingCoordinator = this-&gt;scrollingCoordinator();
</span><del>-    if (!scrollingCoordinator)
</del><ins>+
+    for (Frame* child = m_renderView.frameView().frame().tree().firstChild(); child; child = child-&gt;tree().nextSibling()) {
+        if (!child-&gt;document() || !child-&gt;view())
+            continue;
+
+        // Ignore frames that are not scroll-coordinated.
+        FrameView* childFrameView = child-&gt;view();
+        ScrollingNodeID frameScrollingNodeID = childFrameView-&gt;scrollLayerID();
+        if (!frameScrollingNodeID)
+            continue;
+
+        ScrollingNodeID parentNodeID = scrollCoordinatedAncestorInParentOfFrame(*child);
+        if (!parentNodeID)
+            continue;
+
+        scrollingCoordinator-&gt;attachToStateTree(FrameScrollingNode, frameScrollingNodeID, parentNodeID);
+    }
+}
+
+ScrollingNodeID RenderLayerCompositor::attachScrollingNode(RenderLayer&amp; layer, ScrollingNodeType nodeType, ScrollingNodeID parentNodeID)
+{
+    ScrollingCoordinator* scrollingCoordinator = this-&gt;scrollingCoordinator();
+    RenderLayerBacking* backing = layer.backing();
+
+    ScrollingNodeID nodeID = backing-&gt;scrollingNodeIDForRole(nodeType);
+    if (!nodeID)
+        nodeID = scrollingCoordinator-&gt;uniqueScrollLayerID();
+
+    nodeID = scrollingCoordinator-&gt;attachToStateTree(nodeType, nodeID, parentNodeID);
+    if (!nodeID)
+        return 0;
+
+    backing-&gt;setScrollingNodeIDForRole(nodeID, nodeType);
+    m_scrollingNodeToLayerMap.add(nodeID, &amp;layer);
+    
+    return nodeID;
+}
+
+void RenderLayerCompositor::updateScrollCoordinationForThisFrame(ScrollingNodeID parentNodeID)
+{
+    ScrollingCoordinator* scrollingCoordinator = this-&gt;scrollingCoordinator();
+    ASSERT(scrollingCoordinator-&gt;coordinatesScrollingForFrameView(&amp;m_renderView.frameView()));
+
+    ScrollingNodeID nodeID = attachScrollingNode(*m_renderView.layer(), FrameScrollingNode, parentNodeID);
+    scrollingCoordinator-&gt;updateFrameScrollingNode(nodeID, m_scrollLayer.get(), m_rootContentLayer.get(), fixedRootBackgroundLayer(), clipLayer());
+}
+
+void RenderLayerCompositor::updateScrollCoordinatedLayer(RenderLayer&amp; layer, ScrollCoordinationReasons reasons)
+{
+    ScrollingCoordinator* scrollingCoordinator = this-&gt;scrollingCoordinator();
+    if (!scrollingCoordinator || !scrollingCoordinator-&gt;coordinatesScrollingForFrameView(&amp;m_renderView.frameView()))
</ins><span class="cx">         return;
</span><del>-    
</del><ins>+
</ins><span class="cx">     bool isRootLayer = &amp;layer == m_renderView.layer();
</span><span class="cx"> 
</span><span class="cx">     // FIXME: Remove supportsFixedPositionLayers() since all platforms support them now.
</span><span class="lines">@@ -3608,19 +3693,23 @@
</span><span class="cx">     if (!backing)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    RenderLayerBacking* parent = nearestScrollCoordinatedAncestor(layer);
-    if (!parent &amp;&amp; !isRootLayer)
</del><ins>+    if (!m_renderView.frame().isMainFrame()) {
+        ScrollingNodeID parentDocumentHostingNodeID = scrollCoordinatedAncestorInParentOfFrame(m_renderView.frame());
+        if (!parentDocumentHostingNodeID)
+            return;
+
+        updateScrollCoordinationForThisFrame(parentDocumentHostingNodeID);
+        if (!(reasons &amp; FixedOrSticky) &amp;&amp; isRootLayer)
+            return;
+    }
+
+    ScrollingNodeID parentNodeID = enclosingScrollingNodeID(layer, ExcludeSelf);
+    if (!parentNodeID &amp;&amp; !isRootLayer)
</ins><span class="cx">         return;
</span><del>-
-    ScrollingNodeID parentNodeID = parent ? parent-&gt;scrollingNodeIDForChildren() : 0;
</del><span class="cx">     
</span><span class="cx">     // Always call this even if the backing is already attached because the parent may have changed.
</span><span class="cx">     // If a node plays both roles, fixed/sticky is always the ancestor node of scrolling.
</span><span class="cx">     if (reasons &amp; FixedOrSticky) {
</span><del>-        ScrollingNodeID nodeID = backing-&gt;viewportConstrainedNodeID();
-        if (!nodeID)
-            nodeID = scrollingCoordinator-&gt;uniqueScrollLayerID();
-
</del><span class="cx">         ScrollingNodeType nodeType = FrameScrollingNode;
</span><span class="cx">         if (layer.renderer().style().position() == FixedPosition)
</span><span class="cx">             nodeType = FixedNode;
</span><span class="lines">@@ -3629,12 +3718,10 @@
</span><span class="cx">         else
</span><span class="cx">             ASSERT_NOT_REACHED();
</span><span class="cx"> 
</span><del>-        nodeID = scrollingCoordinator-&gt;attachToStateTree(nodeType, nodeID, parentNodeID);
</del><ins>+        ScrollingNodeID nodeID = attachScrollingNode(layer, nodeType, parentNodeID);
</ins><span class="cx">         if (!nodeID)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        backing-&gt;setViewportConstrainedNodeID(nodeID);
-
</del><span class="cx">         switch (nodeType) {
</span><span class="cx">         case FixedNode:
</span><span class="cx">             scrollingCoordinator-&gt;updateViewportConstrainedNode(nodeID, computeFixedViewportConstraints(layer), backing-&gt;graphicsLayer());
</span><span class="lines">@@ -3651,35 +3738,20 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (reasons &amp; Scrolling) {
</span><del>-        ScrollingNodeID nodeID = backing-&gt;scrollingNodeID();
-        if (!nodeID)
-            nodeID = scrollingCoordinator-&gt;uniqueScrollLayerID();
</del><ins>+        if (isRootLayer)
+            updateScrollCoordinationForThisFrame(parentNodeID);
+        else {
+            ScrollingNodeType nodeType = isRootLayer ? FrameScrollingNode : OverflowScrollingNode;
+            ScrollingNodeID nodeID = attachScrollingNode(layer, nodeType, parentNodeID);
+            if (!nodeID)
+                return;
</ins><span class="cx"> 
</span><del>-        nodeID = scrollingCoordinator-&gt;attachToStateTree(isRootLayer ? FrameScrollingNode : OverflowScrollingNode, nodeID, parentNodeID);
-        if (!nodeID)
-            return;
-
-        backing-&gt;setScrollingNodeID(nodeID);
-        m_scrollingNodeToLayerMap.add(nodeID, &amp;layer);
-
-        GraphicsLayer* scrollingLayer = backing-&gt;scrollingLayer();
-        GraphicsLayer* scrolledContentsLayer = backing-&gt;scrollingContentsLayer();
-        GraphicsLayer* counterScrollingLayer = nullptr;
-        GraphicsLayer* insetClipLayer = nullptr;
-
-        if (isRootLayer) {
-            scrollingLayer = m_scrollLayer.get();
-            scrolledContentsLayer = m_rootContentLayer.get();
-            counterScrollingLayer = fixedRootBackgroundLayer();
-            insetClipLayer = clipLayer();
-            scrollingCoordinator-&gt;updateFrameScrollingNode(nodeID, scrollingLayer, scrolledContentsLayer, counterScrollingLayer, insetClipLayer);
-        } else {
</del><span class="cx">             ScrollingCoordinator::ScrollingGeometry scrollingGeometry;
</span><span class="cx">             scrollingGeometry.scrollOrigin = layer.scrollOrigin();
</span><span class="cx">             scrollingGeometry.scrollPosition = layer.scrollPosition();
</span><span class="cx">             scrollingGeometry.scrollableAreaSize = layer.visibleSize();
</span><span class="cx">             scrollingGeometry.contentSize = layer.contentsSize();
</span><del>-            scrollingCoordinator-&gt;updateOverflowScrollingNode(nodeID, scrollingLayer, scrolledContentsLayer, &amp;scrollingGeometry);
</del><ins>+            scrollingCoordinator-&gt;updateOverflowScrollingNode(nodeID, backing-&gt;scrollingLayer(), backing-&gt;scrollingContentsLayer(), &amp;scrollingGeometry);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -3690,10 +3762,13 @@
</span><span class="cx">     if (!backing)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    backing-&gt;detachFromScrollingCoordinator();
</del><ins>+    if (ScrollingNodeID nodeID = backing-&gt;scrollingNodeIDForRole(FrameScrollingNode))
+        m_scrollingNodeToLayerMap.remove(nodeID);
</ins><span class="cx"> 
</span><del>-    if (ScrollingNodeID nodeID = backing-&gt;scrollingNodeID())
</del><ins>+    if (ScrollingNodeID nodeID = backing-&gt;scrollingNodeIDForRole(FixedNode))
</ins><span class="cx">         m_scrollingNodeToLayerMap.remove(nodeID);
</span><ins>+
+    backing-&gt;detachFromScrollingCoordinator();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ScrollableArea* RenderLayerCompositor::scrollableAreaForScrollLayerID(ScrollingNodeID nodeID) const
</span><span class="lines">@@ -3728,7 +3803,7 @@
</span><span class="cx">         if (layer.renderer().isStickyPositioned()) {
</span><span class="cx">             constraints = std::make_unique&lt;StickyPositionViewportConstraints&gt;(computeStickyViewportConstraints(layer));
</span><span class="cx">             const RenderLayer* enclosingTouchScrollableLayer = nullptr;
</span><del>-            if (isStickyInAcceleratedScrollingLayerOrViewport(layer, &amp;enclosingTouchScrollableLayer) &amp;&amp; enclosingTouchScrollableLayer) {
</del><ins>+            if (isAsyncScrollableStickyLayer(layer, &amp;enclosingTouchScrollableLayer) &amp;&amp; enclosingTouchScrollableLayer) {
</ins><span class="cx">                 ASSERT(enclosingTouchScrollableLayer-&gt;isComposited());
</span><span class="cx">                 stickyContainerMap.add(layer.backing()-&gt;graphicsLayer()-&gt;platformLayer(), enclosingTouchScrollableLayer-&gt;backing()-&gt;scrollingLayer()-&gt;platformLayer());
</span><span class="cx">             }
</span><span class="lines">@@ -3791,7 +3866,7 @@
</span><span class="cx">         RenderLayerBacking* backing = layer.backing();
</span><span class="cx">     
</span><span class="cx">         if (backing)
</span><del>-            scrollingCoordinator-&gt;detachFromStateTree(backing-&gt;scrollingNodeID());
</del><ins>+            backing-&gt;detachFromScrollingCoordinator();
</ins><span class="cx"> 
</span><span class="cx">         // For Coordinated Graphics.
</span><span class="cx">         scrollingCoordinator-&gt;scrollableAreaScrollLayerDidChange(&amp;layer);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerCompositorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.h (169732 => 169733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerCompositor.h        2014-06-10 00:26:48 UTC (rev 169732)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.h        2014-06-10 00:37:06 UTC (rev 169733)
</span><span class="lines">@@ -395,7 +395,6 @@
</span><span class="cx">     PassRefPtr&lt;DisplayRefreshMonitor&gt; createDisplayRefreshMonitor(PlatformDisplayID) const;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    // Whether a running transition or animation enforces the need for a compositing layer.
</del><span class="cx">     bool requiresCompositingForAnimation(RenderLayerModelObject&amp;) const;
</span><span class="cx">     bool requiresCompositingForTransform(RenderLayerModelObject&amp;) const;
</span><span class="cx">     bool requiresCompositingForBackfaceVisibility(RenderLayerModelObject&amp;) const;
</span><span class="lines">@@ -424,9 +423,12 @@
</span><span class="cx">     };
</span><span class="cx">     typedef unsigned ScrollCoordinationReasons;
</span><span class="cx"> 
</span><ins>+    void updateScrollCoordinationForThisFrame(ScrollingNodeID);
+    ScrollingNodeID attachScrollingNode(RenderLayer&amp;, ScrollingNodeType, ScrollingNodeID parentNodeID);
</ins><span class="cx">     void updateScrollCoordinatedLayer(RenderLayer&amp;, ScrollCoordinationReasons);
</span><span class="cx">     void detachScrollCoordinatedLayer(RenderLayer&amp;);
</span><del>-
</del><ins>+    void reattachSubframeScrollLayers();
+    
</ins><span class="cx">     FixedPositionViewportConstraints computeFixedViewportConstraints(RenderLayer&amp;) const;
</span><span class="cx">     StickyPositionViewportConstraints computeStickyViewportConstraints(RenderLayer&amp;) const;
</span><span class="cx"> 
</span><span class="lines">@@ -439,7 +441,12 @@
</span><span class="cx">     bool requiresContentShadowLayer() const;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    // True if the FrameView uses a ScrollingCoordinator.
</ins><span class="cx">     bool hasCoordinatedScrolling() const;
</span><ins>+
+    bool isAsyncScrollableStickyLayer(const RenderLayer&amp;, const RenderLayer** enclosingAcceleratedOverflowLayer = nullptr) const;
+    bool isViewportConstrainedFixedOrStickyLayer(const RenderLayer&amp;) const;
+    
</ins><span class="cx">     bool shouldCompositeOverflowControls() const;
</span><span class="cx"> 
</span><span class="cx">     void scheduleLayerFlushNow();
</span><span class="lines">@@ -480,6 +487,7 @@
</span><span class="cx">     bool m_shouldFlushOnReattach;
</span><span class="cx">     bool m_forceCompositingMode;
</span><span class="cx">     bool m_inPostLayoutUpdate; // true when it's OK to trust layout information (e.g. layer sizes and positions)
</span><ins>+    bool m_subframeScrollLayersNeedReattach;
</ins><span class="cx"> 
</span><span class="cx">     bool m_isTrackingRepaints; // Used for testing.
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderView.cpp (169732 => 169733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderView.cpp        2014-06-10 00:26:48 UTC (rev 169732)
+++ trunk/Source/WebCore/rendering/RenderView.cpp        2014-06-10 00:37:06 UTC (rev 169733)
</span><span class="lines">@@ -839,6 +839,7 @@
</span><span class="cx">     if ((start &amp;&amp; !end) || (end &amp;&amp; !start))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    // FIXME: view() is just *this here.
</ins><span class="cx">     bool caretChanged = m_selectionWasCaret != view().frame().selection().isCaret();
</span><span class="cx">     m_selectionWasCaret = view().frame().selection().isCaret();
</span><span class="cx">     // Just return if the selection hasn't changed.
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalSettingscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/InternalSettings.cpp (169732 => 169733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/InternalSettings.cpp        2014-06-10 00:26:48 UTC (rev 169732)
+++ trunk/Source/WebCore/testing/InternalSettings.cpp        2014-06-10 00:37:06 UTC (rev 169733)
</span><span class="lines">@@ -486,4 +486,10 @@
</span><span class="cx">     settings()-&gt;setShouldConvertPositionStyleOnCopy(convert);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void InternalSettings::setScrollingTreeIncludesFrames(bool enabled, ExceptionCode&amp; ec)
+{
+    InternalSettingsGuardForSettings();
+    settings()-&gt;setScrollingTreeIncludesFrames(enabled);
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoretestingInternalSettingsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/InternalSettings.h (169732 => 169733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/InternalSettings.h        2014-06-10 00:26:48 UTC (rev 169732)
+++ trunk/Source/WebCore/testing/InternalSettings.h        2014-06-10 00:37:06 UTC (rev 169733)
</span><span class="lines">@@ -100,8 +100,8 @@
</span><span class="cx">     virtual ~InternalSettings();
</span><span class="cx">     void resetToConsistentState();
</span><span class="cx"> 
</span><del>-    void setUsesOverlayScrollbars(bool enabled, ExceptionCode&amp;);
-    void setTouchEventEmulationEnabled(bool enabled, ExceptionCode&amp;);
</del><ins>+    void setUsesOverlayScrollbars(bool, ExceptionCode&amp;);
+    void setTouchEventEmulationEnabled(bool, ExceptionCode&amp;);
</ins><span class="cx">     void setStandardFontFamily(const String&amp; family, const String&amp; script, ExceptionCode&amp;);
</span><span class="cx">     void setSerifFontFamily(const String&amp; family, const String&amp; script, ExceptionCode&amp;);
</span><span class="cx">     void setSansSerifFontFamily(const String&amp; family, const String&amp; script, ExceptionCode&amp;);
</span><span class="lines">@@ -113,26 +113,26 @@
</span><span class="cx">     void setTextAutosizingWindowSizeOverride(int width, int height, ExceptionCode&amp;);
</span><span class="cx">     void setTextAutosizingFontScaleFactor(float fontScaleFactor, ExceptionCode&amp;);
</span><span class="cx">     void setMediaTypeOverride(const String&amp; mediaType, ExceptionCode&amp;);
</span><del>-    void setCSSExclusionsEnabled(bool enabled, ExceptionCode&amp;);
-    void setCSSShapesEnabled(bool enabled, ExceptionCode&amp;);
</del><ins>+    void setCSSExclusionsEnabled(bool, ExceptionCode&amp;);
+    void setCSSShapesEnabled(bool, ExceptionCode&amp;);
</ins><span class="cx">     void setCanStartMedia(bool, ExceptionCode&amp;);
</span><span class="cx">     void setEditingBehavior(const String&amp;, ExceptionCode&amp;);
</span><span class="cx">     void setShouldDisplayTrackKind(const String&amp; kind, bool enabled, ExceptionCode&amp;);
</span><span class="cx">     bool shouldDisplayTrackKind(const String&amp; kind, ExceptionCode&amp;);
</span><span class="cx">     void setStorageBlockingPolicy(const String&amp;, ExceptionCode&amp;);
</span><span class="cx">     void setLangAttributeAwareFormControlUIEnabled(bool);
</span><del>-    void setImagesEnabled(bool enabled, ExceptionCode&amp;);
</del><ins>+    void setImagesEnabled(bool, ExceptionCode&amp;);
</ins><span class="cx">     void setMinimumTimerInterval(double intervalInSeconds, ExceptionCode&amp;);
</span><span class="cx">     void setDefaultVideoPosterURL(const String&amp; url, ExceptionCode&amp;);
</span><span class="cx">     void setTimeWithoutMouseMovementBeforeHidingControls(double time, ExceptionCode&amp;);
</span><del>-    void setUseLegacyBackgroundSizeShorthandBehavior(bool enabled, ExceptionCode&amp;);
-    void setAutoscrollForDragAndDropEnabled(bool enabled, ExceptionCode&amp;);
-    void setFontFallbackPrefersPictographs(bool preferPictographs, ExceptionCode&amp;);
</del><ins>+    void setUseLegacyBackgroundSizeShorthandBehavior(bool, ExceptionCode&amp;);
+    void setAutoscrollForDragAndDropEnabled(bool, ExceptionCode&amp;);
+    void setFontFallbackPrefersPictographs(bool, ExceptionCode&amp;);
</ins><span class="cx">     void setPluginReplacementEnabled(bool);
</span><del>-    void setBackgroundShouldExtendBeyondPage(bool hasExtendedBackground, ExceptionCode&amp;);
-    void setShouldConvertPositionStyleOnCopy(bool convert, ExceptionCode&amp;);
</del><ins>+    void setBackgroundShouldExtendBeyondPage(bool, ExceptionCode&amp;);
+    void setShouldConvertPositionStyleOnCopy(bool, ExceptionCode&amp;);
+    void setScrollingTreeIncludesFrames(bool, ExceptionCode&amp;);
</ins><span class="cx"> 
</span><del>-
</del><span class="cx"> private:
</span><span class="cx">     explicit InternalSettings(Page*);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalSettingsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/InternalSettings.idl (169732 => 169733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/InternalSettings.idl        2014-06-10 00:26:48 UTC (rev 169732)
+++ trunk/Source/WebCore/testing/InternalSettings.idl        2014-06-10 00:37:06 UTC (rev 169733)
</span><span class="lines">@@ -68,6 +68,7 @@
</span><span class="cx">     [RaisesException] void setUseLegacyBackgroundSizeShorthandBehavior(boolean enabled);
</span><span class="cx">     [RaisesException] void setAutoscrollForDragAndDropEnabled(boolean enabled);
</span><span class="cx">     [RaisesException] void setBackgroundShouldExtendBeyondPage(boolean hasExtendedBackground);
</span><ins>+    [RaisesException] void setScrollingTreeIncludesFrames(boolean enabled);
</ins><span class="cx"> 
</span><span class="cx">     [RaisesException] void setMinimumTimerInterval(unrestricted double intervalInSeconds);
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (169732 => 169733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-06-10 00:26:48 UTC (rev 169732)
+++ trunk/Source/WebKit2/ChangeLog        2014-06-10 00:37:06 UTC (rev 169733)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2014-06-09  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        Work towards having frames in the scrolling tree
+        https://bugs.webkit.org/show_bug.cgi?id=133665
+
+        Reviewed by Tim Horton.
+        
+        Override coordinatesScrollingForFrameView() to always return true for composited
+        frames, for iOS WK2 (eventually this class will have to be specialized for iOS and OS X).
+
+        * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
+        * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
+        (WebKit::RemoteScrollingCoordinator::coordinatesScrollingForFrameView):
+
</ins><span class="cx"> 2014-06-09  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Give callbacks real status codes
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessScrollingRemoteScrollingCoordinatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.h (169732 => 169733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.h        2014-06-10 00:26:48 UTC (rev 169732)
+++ trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.h        2014-06-10 00:37:06 UTC (rev 169733)
</span><span class="lines">@@ -61,6 +61,7 @@
</span><span class="cx">     virtual bool isRemoteScrollingCoordinator() const override { return true; }
</span><span class="cx">     
</span><span class="cx">     // ScrollingCoordinator
</span><ins>+    virtual bool coordinatesScrollingForFrameView(WebCore::FrameView*) const override;
</ins><span class="cx">     virtual void scheduleTreeStateCommit() override;
</span><span class="cx"> 
</span><span class="cx">     virtual PassOwnPtr&lt;WebCore::ScrollingTreeNode&gt; createScrollingTreeNode(WebCore::ScrollingNodeType, WebCore::ScrollingNodeID) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessScrollingRemoteScrollingCoordinatormm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.mm (169732 => 169733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.mm        2014-06-10 00:26:48 UTC (rev 169732)
+++ trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.mm        2014-06-10 00:37:06 UTC (rev 169733)
</span><span class="lines">@@ -74,6 +74,12 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool RemoteScrollingCoordinator::coordinatesScrollingForFrameView(FrameView* frameView) const
+{
+    RenderView* renderView = frameView-&gt;renderView();
+    return renderView &amp;&amp; renderView-&gt;usesCompositing();
+}
+
</ins><span class="cx"> bool RemoteScrollingCoordinator::isRubberBandInProgress() const
</span><span class="cx"> {
</span><span class="cx">     // FIXME: need to maintain state in the web process?
</span></span></pre>
</div>
</div>

</body>
</html>