<!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>[166333] trunk/Source</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/166333">166333</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2014-03-26 19:15:48 -0700 (Wed, 26 Mar 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Hook up -webkit-overflow-scrolling:touch for iOS WK2
https://bugs.webkit.org/show_bug.cgi?id=130809
Reviewed by Tim Horton.
Source/WebCore:
Get -webkit-overflow-scrolling: touch working for iOS WK2.
* WebCore.exp.in:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateScrollingNode):
Send in ScrollingGeometry when we update scrolling nodes.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::updateScrollingNode):
* page/scrolling/ios/ScrollingTreeScrollingNodeIOS.h:
Need to get to the scrolling layer in a subclass.
(WebCore::ScrollingTreeScrollingNodeIOS::scrollLayer):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::hasAcceleratedTouchScrolling): Remove code
that temporarily disabled touch-scrolling.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): When we
update scrolling nodes, send in the right scrolling geometry.
Source/WebKit2:
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren):
Set the content size of the UIScrollVIew based on the geometry.
* UIProcess/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::createLayer): Make a UIScrollView if the
layer properties tell us that we have the scrolling behavior.
* UIProcess/ios/WKContentView.mm:
(-[WKContentView initWithFrame:context:WebKit::configuration:WebKit::webView:]):
We need to allow user interaction in the _rootContentView so that events get to
nested UIScrollViews (this could be optimized in future).
* UIProcess/mac/RemoteLayerTreeHost.h:
* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::updateLayerTree):
(WebKit::RemoteLayerTreeHost::createLayer): Need to pass RemoteLayerTreeTransaction::LayerProperties
in so we can get at the custom behavior.</pre>
<h3>Modified Paths</h3>
<ul>
<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="#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="#trunkSourceWebCorepagescrollingScrollingCoordinatorh">trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingiosScrollingTreeScrollingNodeIOSh">trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeScrollingNodeIOS.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerCompositorcpp">trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessScrollingiosScrollingTreeOverflowScrollingNodeIOSh">trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessScrollingiosScrollingTreeOverflowScrollingNodeIOSmm">trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosRemoteLayerTreeHostIOSmm">trunk/Source/WebKit2/UIProcess/ios/RemoteLayerTreeHostIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKContentViewmm">trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacRemoteLayerTreeHosth">trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacRemoteLayerTreeHostmm">trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (166332 => 166333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-03-27 01:54:24 UTC (rev 166332)
+++ trunk/Source/WebCore/ChangeLog        2014-03-27 02:15:48 UTC (rev 166333)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2014-03-26 Simon Fraser <simon.fraser@apple.com>
+
+ Hook up -webkit-overflow-scrolling:touch for iOS WK2
+ https://bugs.webkit.org/show_bug.cgi?id=130809
+
+ Reviewed by Tim Horton.
+
+ Get -webkit-overflow-scrolling: touch working for iOS WK2.
+
+ * WebCore.exp.in:
+ * page/scrolling/AsyncScrollingCoordinator.cpp:
+ (WebCore::AsyncScrollingCoordinator::updateScrollingNode):
+ Send in ScrollingGeometry when we update scrolling nodes.
+ * page/scrolling/AsyncScrollingCoordinator.h:
+ * page/scrolling/ScrollingCoordinator.h:
+ (WebCore::ScrollingCoordinator::updateScrollingNode):
+ * page/scrolling/ios/ScrollingTreeScrollingNodeIOS.h:
+ Need to get to the scrolling layer in a subclass.
+ (WebCore::ScrollingTreeScrollingNodeIOS::scrollLayer):
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::hasAcceleratedTouchScrolling): Remove code
+ that temporarily disabled touch-scrolling.
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): When we
+ update scrolling nodes, send in the right scrolling geometry.
+
</ins><span class="cx"> 2014-03-26 Timothy Hatcher <timothy@apple.com>
</span><span class="cx">
</span><span class="cx"> Modernize the loops in InspectorPageAgent.cpp.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (166332 => 166333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-03-27 01:54:24 UTC (rev 166332)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-03-27 02:15:48 UTC (rev 166333)
</span><span class="lines">@@ -2756,7 +2756,7 @@
</span><span class="cx"> __ZN7WebCore25AsyncScrollingCoordinator17attachToStateTreeENS_17ScrollingNodeTypeEyy
</span><span class="cx"> __ZN7WebCore25AsyncScrollingCoordinator18syncChildPositionsERKNS_10LayoutRectE
</span><span class="cx"> __ZN7WebCore25AsyncScrollingCoordinator19detachFromStateTreeEy
</span><del>-__ZN7WebCore25AsyncScrollingCoordinator19updateScrollingNodeEyPNS_13GraphicsLayerES2_S2_
</del><ins>+__ZN7WebCore25AsyncScrollingCoordinator19updateScrollingNodeEyPNS_13GraphicsLayerES2_S2_RKNS_20ScrollingCoordinator17ScrollingGeometryE
</ins><span class="cx"> __ZN7WebCore25AsyncScrollingCoordinator22frameViewLayoutUpdatedEPNS_9FrameViewE
</span><span class="cx"> __ZN7WebCore25AsyncScrollingCoordinator27frameViewRootLayerDidChangeEPNS_9FrameViewE
</span><span class="cx"> __ZN7WebCore25AsyncScrollingCoordinator27requestScrollPositionUpdateEPNS_9FrameViewERKNS_8IntPointE
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingAsyncScrollingCoordinatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (166332 => 166333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp        2014-03-27 01:54:24 UTC (rev 166332)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp        2014-03-27 02:15:48 UTC (rev 166333)
</span><span class="lines">@@ -287,7 +287,7 @@
</span><span class="cx"> attachToStateTree(FrameScrollingNode, frameView->scrollLayerID(), 0);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void AsyncScrollingCoordinator::updateScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer)
</del><ins>+void AsyncScrollingCoordinator::updateScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, const ScrollingGeometry& scrollingGeometry)
</ins><span class="cx"> {
</span><span class="cx"> ScrollingStateScrollingNode* node = toScrollingStateScrollingNode(m_scrollingStateTree->stateNodeForID(nodeID));
</span><span class="cx"> ASSERT(node);
</span><span class="lines">@@ -297,6 +297,10 @@
</span><span class="cx"> node->setLayer(layer);
</span><span class="cx"> node->setScrolledContentsLayer(scrolledContentsLayer);
</span><span class="cx"> node->setCounterScrollingLayer(counterScrollingLayer);
</span><ins>+
+ node->setScrollOrigin(scrollingGeometry.scrollOrigin);
+ node->setScrollPosition(scrollingGeometry.scrollPosition);
+ node->setTotalContentsSize(scrollingGeometry.contentSize);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void AsyncScrollingCoordinator::updateViewportConstrainedNode(ScrollingNodeID nodeID, const ViewportConstraints& constraints, GraphicsLayer* graphicsLayer)
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingAsyncScrollingCoordinatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h (166332 => 166333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h        2014-03-27 01:54:24 UTC (rev 166332)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h        2014-03-27 02:15:48 UTC (rev 166333)
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx"> virtual void clearStateTree() override;
</span><span class="cx">
</span><span class="cx"> virtual void updateViewportConstrainedNode(ScrollingNodeID, const ViewportConstraints&, GraphicsLayer*) override;
</span><del>- virtual void updateScrollingNode(ScrollingNodeID, GraphicsLayer*, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer) override;
</del><ins>+ virtual void updateScrollingNode(ScrollingNodeID, GraphicsLayer*, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, const ScrollingGeometry&) override;
</ins><span class="cx"> virtual String scrollingStateTreeAsText() const override;
</span><span class="cx"> virtual bool isRubberBandInProgress() const override;
</span><span class="cx"> virtual void setScrollPinningBehavior(ScrollPinningBehavior) override;
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingCoordinatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h (166332 => 166333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h        2014-03-27 01:54:24 UTC (rev 166332)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h        2014-03-27 02:15:48 UTC (rev 166333)
</span><span class="lines">@@ -152,7 +152,14 @@
</span><span class="cx"> virtual void detachFromStateTree(ScrollingNodeID) { }
</span><span class="cx"> virtual void clearStateTree() { }
</span><span class="cx"> virtual void updateViewportConstrainedNode(ScrollingNodeID, const ViewportConstraints&, GraphicsLayer*) { }
</span><del>- virtual void updateScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*scrolledContentsLayer*/, GraphicsLayer* /*counterScrollingLayer*/) { }
</del><ins>+
+ struct ScrollingGeometry {
+ IntSize contentSize;
+ FloatPoint scrollPosition;
+ IntPoint scrollOrigin;
+ };
+
+ virtual void updateScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*scrolledContentsLayer*/, GraphicsLayer* /*counterScrollingLayer*/, const ScrollingGeometry&) { }
</ins><span class="cx"> virtual void syncChildPositions(const LayoutRect&) { }
</span><span class="cx"> virtual String scrollingStateTreeAsText() const;
</span><span class="cx"> virtual bool isRubberBandInProgress() const { return false; }
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingiosScrollingTreeScrollingNodeIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeScrollingNodeIOS.h (166332 => 166333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeScrollingNodeIOS.h        2014-03-27 01:54:24 UTC (rev 166332)
+++ trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeScrollingNodeIOS.h        2014-03-27 02:15:48 UTC (rev 166333)
</span><span class="lines">@@ -43,12 +43,14 @@
</span><span class="cx"> protected:
</span><span class="cx"> ScrollingTreeScrollingNodeIOS(ScrollingTree&, ScrollingNodeType, ScrollingNodeID);
</span><span class="cx">
</span><del>-private:
</del><span class="cx"> // ScrollingTreeNode member functions.
</span><span class="cx"> virtual void updateBeforeChildren(const ScrollingStateNode&) override;
</span><span class="cx"> virtual void updateAfterChildren(const ScrollingStateNode&) override;
</span><span class="cx"> virtual void handleWheelEvent(const PlatformWheelEvent&) override { }
</span><span class="cx">
</span><ins>+ CALayer *scrollLayer() const { return m_scrollLayer.get(); }
+
+private:
</ins><span class="cx"> FloatPoint scrollPosition() const;
</span><span class="cx"> virtual void setScrollPosition(const FloatPoint&) override;
</span><span class="cx"> virtual void setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&) override;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (166332 => 166333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-03-27 01:54:24 UTC (rev 166332)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-03-27 02:15:48 UTC (rev 166333)
</span><span class="lines">@@ -2087,14 +2087,7 @@
</span><span class="cx"> if (!scrollsOverflow())
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- // Temporary: turn off accelerated scrolling in WK2.
- if (Page* page = renderer().frame().page()) {
- if (page->scrollingCoordinator())
- return false;
- }
-
</del><span class="cx"> Settings* settings = renderer().document().settings();
</span><del>-
</del><span class="cx"> // FIXME: settings should not be null at this point. If you find a reliable way to hit this assertion, please file a bug.
</span><span class="cx"> // See <rdar://problem/10266101>.
</span><span class="cx"> ASSERT(settings);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerCompositorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (166332 => 166333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp        2014-03-27 01:54:24 UTC (rev 166332)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp        2014-03-27 02:15:48 UTC (rev 166333)
</span><span class="lines">@@ -3520,13 +3520,22 @@
</span><span class="cx"> GraphicsLayer* scrolledContentsLayer = backing->scrollingContentsLayer();
</span><span class="cx"> GraphicsLayer* counterScrollingLayer = nullptr;
</span><span class="cx">
</span><ins>+ ScrollingCoordinator::ScrollingGeometry scrollingGeometry;
</ins><span class="cx"> if (isRootLayer) {
</span><span class="cx"> scrollingLayer = m_scrollLayer.get();
</span><span class="cx"> scrolledContentsLayer = nullptr;
</span><span class="cx"> counterScrollingLayer = fixedRootBackgroundLayer();
</span><ins>+
+ scrollingGeometry.scrollOrigin = m_renderView.frameView().scrollOrigin();
+ scrollingGeometry.scrollPosition = m_renderView.frameView().scrollPosition();
+ scrollingGeometry.contentSize = m_renderView.frameView().totalContentsSize();
+ } else {
+ scrollingGeometry.scrollOrigin = layer.scrollOrigin();
+ scrollingGeometry.scrollPosition = layer.scrollPosition();
+ scrollingGeometry.contentSize = layer.contentsSize();
</ins><span class="cx"> }
</span><del>-
- scrollingCoordinator->updateScrollingNode(nodeID, scrollingLayer, scrolledContentsLayer, counterScrollingLayer);
</del><ins>+
+ scrollingCoordinator->updateScrollingNode(nodeID, scrollingLayer, scrolledContentsLayer, counterScrollingLayer, scrollingGeometry);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (166332 => 166333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-03-27 01:54:24 UTC (rev 166332)
+++ trunk/Source/WebKit2/ChangeLog        2014-03-27 02:15:48 UTC (rev 166333)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2014-03-26 Simon Fraser <simon.fraser@apple.com>
+
+ Hook up -webkit-overflow-scrolling:touch for iOS WK2
+ https://bugs.webkit.org/show_bug.cgi?id=130809
+
+ Reviewed by Tim Horton.
+
+ * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
+ * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
+ (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren):
+ Set the content size of the UIScrollVIew based on the geometry.
+ * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
+ (WebKit::RemoteLayerTreeHost::createLayer): Make a UIScrollView if the
+ layer properties tell us that we have the scrolling behavior.
+ * UIProcess/ios/WKContentView.mm:
+ (-[WKContentView initWithFrame:context:WebKit::configuration:WebKit::webView:]):
+ We need to allow user interaction in the _rootContentView so that events get to
+ nested UIScrollViews (this could be optimized in future).
+ * UIProcess/mac/RemoteLayerTreeHost.h:
+ * UIProcess/mac/RemoteLayerTreeHost.mm:
+ (WebKit::RemoteLayerTreeHost::updateLayerTree):
+ (WebKit::RemoteLayerTreeHost::createLayer): Need to pass RemoteLayerTreeTransaction::LayerProperties
+ in so we can get at the custom behavior.
+
</ins><span class="cx"> 2014-03-26 Anders Carlsson <andersca@apple.com>
</span><span class="cx">
</span><span class="cx"> Add -[WKWebView stopLoading]
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessScrollingiosScrollingTreeOverflowScrollingNodeIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h (166332 => 166333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h        2014-03-27 01:54:24 UTC (rev 166332)
+++ trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h        2014-03-27 02:15:48 UTC (rev 166333)
</span><span class="lines">@@ -41,6 +41,9 @@
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> ScrollingTreeOverflowScrollingNodeIOS(WebCore::ScrollingTree&, WebCore::ScrollingNodeID);
</span><ins>+
+ virtual void updateAfterChildren(const WebCore::ScrollingStateNode&) override;
+
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessScrollingiosScrollingTreeOverflowScrollingNodeIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm (166332 => 166333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm        2014-03-27 01:54:24 UTC (rev 166332)
+++ trunk/Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm        2014-03-27 02:15:48 UTC (rev 166333)
</span><span class="lines">@@ -25,6 +25,9 @@
</span><span class="cx">
</span><span class="cx"> #import "config.h"
</span><span class="cx"> #import "ScrollingTreeOverflowScrollingNodeIOS.h"
</span><ins>+#import <WebCore/BlockExceptions.h>
+#import <WebCore/ScrollingStateScrollingNode.h>
+#import <UIKit/UIScrollView.h>
</ins><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> #if ENABLE(ASYNC_SCROLLING)
</span><span class="lines">@@ -47,6 +50,23 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren(const ScrollingStateNode& stateNode)
+{
+ ScrollingTreeScrollingNodeIOS::updateAfterChildren(stateNode);
+
+ const auto& scrollingStateNode = toScrollingStateScrollingNode(stateNode);
+
+ if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize)) {
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ UIScrollView *scrollView = (UIScrollView *)[scrollLayer() delegate];
+ ASSERT([scrollView isKindOfClass:[UIScrollView self]]);
+
+ scrollView.contentSize = scrollingStateNode.totalContentsSize();
+
+ END_BLOCK_OBJC_EXCEPTIONS
+ }
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(ASYNC_SCROLLING)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosRemoteLayerTreeHostIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/RemoteLayerTreeHostIOS.mm (166332 => 166333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/RemoteLayerTreeHostIOS.mm        2014-03-27 01:54:24 UTC (rev 166332)
+++ trunk/Source/WebKit2/UIProcess/ios/RemoteLayerTreeHostIOS.mm        2014-03-27 02:15:48 UTC (rev 166333)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> #import <WebCore/WebCoreCALayerExtras.h>
</span><span class="cx"> #import <WebKitSystemInterface.h>
</span><span class="cx">
</span><del>-#import <UIKit/UIView.h>
</del><ins>+#import <UIKit/UIScrollView.h>
</ins><span class="cx"> #import <QuartzCore/QuartzCore.h>
</span><span class="cx">
</span><span class="cx"> using namespace WebCore;
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx">
</span><span class="cx"> namespace WebKit {
</span><span class="cx">
</span><del>-LayerOrView *RemoteLayerTreeHost::createLayer(const RemoteLayerTreeTransaction::LayerCreationProperties& properties)
</del><ins>+LayerOrView *RemoteLayerTreeHost::createLayer(const RemoteLayerTreeTransaction::LayerCreationProperties& properties, const RemoteLayerTreeTransaction::LayerProperties* layerProperties)
</ins><span class="cx"> {
</span><span class="cx"> RetainPtr<LayerOrView>& layerOrView = m_layers.add(properties.layerID, nullptr).iterator->value;
</span><span class="cx">
</span><span class="lines">@@ -90,10 +90,13 @@
</span><span class="cx"> case PlatformCALayer::LayerTypeTiledBackingLayer:
</span><span class="cx"> case PlatformCALayer::LayerTypePageTiledBackingLayer:
</span><span class="cx"> case PlatformCALayer::LayerTypeTiledBackingTileLayer:
</span><del>- layerOrView = adoptNS([[UIView alloc] initWithFrame:CGRectZero]);
</del><ins>+ if (layerProperties && layerProperties->customBehavior == GraphicsLayer::CustomScrollingBehavior)
+ layerOrView = adoptNS([[UIScrollView alloc] init]);
+ else
+ layerOrView = adoptNS([[UIView alloc] init]);
</ins><span class="cx"> break;
</span><span class="cx"> case PlatformCALayer::LayerTypeTransformLayer:
</span><del>- layerOrView = adoptNS([[WKTransformView alloc] initWithFrame:CGRectZero]);
</del><ins>+ layerOrView = adoptNS([[WKTransformView alloc] init]);
</ins><span class="cx"> break;
</span><span class="cx"> case PlatformCALayer::LayerTypeCustom:
</span><span class="cx"> if (!m_isDebugLayerTreeHost)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm (166332 => 166333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm        2014-03-27 01:54:24 UTC (rev 166332)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm        2014-03-27 02:15:48 UTC (rev 166333)
</span><span class="lines">@@ -179,7 +179,6 @@
</span><span class="cx">
</span><span class="cx"> _rootContentView = adoptNS([[UIView alloc] init]);
</span><span class="cx"> [_rootContentView layer].masksToBounds = NO;
</span><del>- [_rootContentView setUserInteractionEnabled:NO];
</del><span class="cx">
</span><span class="cx"> [self addSubview:_rootContentView.get()];
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacRemoteLayerTreeHosth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.h (166332 => 166333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.h        2014-03-27 01:54:24 UTC (rev 166332)
+++ trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.h        2014-03-27 02:15:48 UTC (rev 166333)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx"> bool isDebugLayerTreeHost() const { return m_isDebugLayerTreeHost; }
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- LayerOrView *createLayer(const RemoteLayerTreeTransaction::LayerCreationProperties&);
</del><ins>+ LayerOrView *createLayer(const RemoteLayerTreeTransaction::LayerCreationProperties&, const RemoteLayerTreeTransaction::LayerProperties*);
</ins><span class="cx">
</span><span class="cx"> LayerOrView *m_rootLayer;
</span><span class="cx"> HashMap<WebCore::GraphicsLayer::PlatformLayerID, RetainPtr<LayerOrView>> m_layers;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacRemoteLayerTreeHostmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm (166332 => 166333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm        2014-03-27 01:54:24 UTC (rev 166332)
+++ trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm        2014-03-27 02:15:48 UTC (rev 166333)
</span><span class="lines">@@ -53,8 +53,10 @@
</span><span class="cx">
</span><span class="cx"> bool RemoteLayerTreeHost::updateLayerTree(const RemoteLayerTreeTransaction& transaction, float indicatorScaleFactor)
</span><span class="cx"> {
</span><del>- for (const auto& createdLayer : transaction.createdLayers())
- createLayer(createdLayer);
</del><ins>+ for (const auto& createdLayer : transaction.createdLayers()) {
+ const RemoteLayerTreeTransaction::LayerProperties* properties = transaction.changedLayers().get(createdLayer.layerID);
+ createLayer(createdLayer, properties);
+ }
</ins><span class="cx">
</span><span class="cx"> bool rootLayerChanged = false;
</span><span class="cx"> LayerOrView *rootLayer = getLayer(transaction.rootLayerID());
</span><span class="lines">@@ -105,7 +107,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if !PLATFORM(IOS)
</span><del>-LayerOrView *RemoteLayerTreeHost::createLayer(const RemoteLayerTreeTransaction::LayerCreationProperties& properties)
</del><ins>+LayerOrView *RemoteLayerTreeHost::createLayer(const RemoteLayerTreeTransaction::LayerCreationProperties& properties, const RemoteLayerTreeTransaction::LayerProperties*)
</ins><span class="cx"> {
</span><span class="cx"> RetainPtr<CALayer>& layer = m_layers.add(properties.layerID, nullptr).iterator->value;
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>