<!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>[167262] 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/167262">167262</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2014-04-14 12:49:37 -0700 (Mon, 14 Apr 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[WK2 iOS] Scrolling to anchor links is broken
https://bugs.webkit.org/show_bug.cgi?id=131618
&lt;rdar://problem/16599144&gt;

Source/WebCore:

Reviewed by Tim Horton.

Have ScrollingTreeScrollingNode pass RequestedScrollPosition updates
to the scrolling tree, so that the scrolling tree can have custom behavior
for them if necessary.

* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::scrollingTreeNodeRequestsScroll):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::updateAfterChildren):
* page/scrolling/ScrollingTreeScrollingNode.h:

Source/WebKit2:

Reviewed by Tim Horton.

The RemoteScrollingTree implements scrollingTreeNodeRequestsScroll
to get informed about requested scroll position updates, and passes
them along via the RemoteScrollingCoordinatorProxy, WebPageProxy and PageClient
to the WKWebView, which performs a scroll.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _scrollToContentOffset:WebCore::]): Scroll to content offset,
taking page scale and insets into account.
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/CoordinatedGraphics/WebView.cpp:
(WebKit::WebView::requestScroll):
* UIProcess/CoordinatedGraphics/WebView.h:
* UIProcess/PageClient.h:
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeRequestsScroll):
Pass scrolls along to the WebPageProxy for the root node. We will also need
to handle programmatic scrolls for overflow soon.
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
* UIProcess/Scrolling/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::scrollingTreeNodeRequestsScroll):
* UIProcess/Scrolling/RemoteScrollingTree.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestScroll):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::canScrollView):
(WebKit::PageClientImpl::requestScroll):
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::requestScroll):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingTreeh">trunk/Source/WebCore/page/scrolling/ScrollingTree.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingTreeScrollingNodecpp">trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingTreeScrollingNodeh">trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewInternalh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkPageClientImplcpp">trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkPageClientImplh">trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCoordinatedGraphicsWebViewcpp">trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCoordinatedGraphicsWebViewh">trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessPageClienth">trunk/Source/WebKit2/UIProcess/PageClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessScrollingRemoteScrollingCoordinatorProxycpp">trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessScrollingRemoteScrollingCoordinatorProxyh">trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessScrollingRemoteScrollingTreecpp">trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessScrollingRemoteScrollingTreeh">trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxycpp">trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosPageClientImplIOSh">trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosPageClientImplIOSmm">trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacPageClientImplmm">trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (167261 => 167262)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-04-14 19:45:24 UTC (rev 167261)
+++ trunk/Source/WebCore/ChangeLog        2014-04-14 19:49:37 UTC (rev 167262)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2014-04-14  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        [WK2 iOS] Scrolling to anchor links is broken
+        https://bugs.webkit.org/show_bug.cgi?id=131618
+        &lt;rdar://problem/16599144&gt;
+
+        Reviewed by Tim Horton.
+
+        Have ScrollingTreeScrollingNode pass RequestedScrollPosition updates
+        to the scrolling tree, so that the scrolling tree can have custom behavior
+        for them if necessary.
+
+        * page/scrolling/ScrollingTree.h:
+        (WebCore::ScrollingTree::scrollingTreeNodeRequestsScroll):
+        * page/scrolling/ScrollingTreeScrollingNode.cpp:
+        (WebCore::ScrollingTreeScrollingNode::updateAfterChildren):
+        * page/scrolling/ScrollingTreeScrollingNode.h:
+
</ins><span class="cx"> 2014-04-14  Brian J. Burg  &lt;burg@cs.washington.edu&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Replay: memoize fallback time values for document.lastModified
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingTreeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.h (167261 => 167262)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingTree.h        2014-04-14 19:45:24 UTC (rev 167261)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.h        2014-04-14 19:49:37 UTC (rev 167262)
</span><span class="lines">@@ -75,6 +75,9 @@
</span><span class="cx">     // Updates FrameView/RenderLayer scrolling state and GraphicsLayers.
</span><span class="cx">     virtual void scrollingTreeNodeDidScroll(ScrollingNodeID, const FloatPoint&amp; scrollPosition, SetOrSyncScrollingLayerPosition = SyncScrollingLayerPosition) = 0;
</span><span class="cx"> 
</span><ins>+    // Called for requested scroll position updates.
+    virtual void scrollingTreeNodeRequestsScroll(ScrollingNodeID, const FloatPoint&amp; /*scrollPosition*/, bool /*representsProgrammaticScroll*/) { }
+
</ins><span class="cx">     // Delegated scrolling/zooming has caused the viewport to change, so update viewport-constrained layers
</span><span class="cx">     // (but don't cause scroll events to be fired).
</span><span class="cx">     virtual void viewportChangedViaDelegatedScrolling(ScrollingNodeID, const WebCore::FloatRect&amp; viewportRect, double scale);
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingTreeScrollingNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp (167261 => 167262)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp        2014-04-14 19:45:24 UTC (rev 167261)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp        2014-04-14 19:49:37 UTC (rev 167262)
</span><span class="lines">@@ -87,6 +87,13 @@
</span><span class="cx">         m_behaviorForFixed = state.scrollBehaviorForFixedElements();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ScrollingTreeScrollingNode::updateAfterChildren(const ScrollingStateNode&amp; stateNode)
+{
+    const ScrollingStateScrollingNode&amp; scrollingStateNode = toScrollingStateScrollingNode(stateNode);
+    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition))
+        scrollingTree().scrollingTreeNodeRequestsScroll(scrollingNodeID(), scrollingStateNode.requestedScrollPosition(), scrollingStateNode.requestedScrollPositionRepresentsProgrammaticScroll());
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(ASYNC_SCROLLING)
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingTreeScrollingNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h (167261 => 167262)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h        2014-04-14 19:45:24 UTC (rev 167261)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h        2014-04-14 19:49:37 UTC (rev 167262)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx">     virtual ~ScrollingTreeScrollingNode();
</span><span class="cx"> 
</span><span class="cx">     virtual void updateBeforeChildren(const ScrollingStateNode&amp;) override;
</span><ins>+    virtual void updateAfterChildren(const ScrollingStateNode&amp;) override;
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: We should implement this when we support ScrollingTreeScrollingNodes as children.
</span><span class="cx">     virtual void parentScrollPositionDidChange(const FloatRect&amp; /*viewportRect*/, const FloatSize&amp; /*cumulativeDelta*/) override { }
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (167261 => 167262)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-04-14 19:45:24 UTC (rev 167261)
+++ trunk/Source/WebKit2/ChangeLog        2014-04-14 19:49:37 UTC (rev 167262)
</span><span class="lines">@@ -1,3 +1,42 @@
</span><ins>+2014-04-14  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        [WK2 iOS] Scrolling to anchor links is broken
+        https://bugs.webkit.org/show_bug.cgi?id=131618
+        &lt;rdar://problem/16599144&gt;
+
+        Reviewed by Tim Horton.
+        
+        The RemoteScrollingTree implements scrollingTreeNodeRequestsScroll
+        to get informed about requested scroll position updates, and passes
+        them along via the RemoteScrollingCoordinatorProxy, WebPageProxy and PageClient
+        to the WKWebView, which performs a scroll.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _scrollToContentOffset:WebCore::]): Scroll to content offset,
+        taking page scale and insets into account.
+        * UIProcess/API/Cocoa/WKWebViewInternal.h:
+        * UIProcess/CoordinatedGraphics/WebView.cpp:
+        (WebKit::WebView::requestScroll):
+        * UIProcess/CoordinatedGraphics/WebView.h:
+        * UIProcess/PageClient.h:
+        * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
+        (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeRequestsScroll):
+        Pass scrolls along to the WebPageProxy for the root node. We will also need
+        to handle programmatic scrolls for overflow soon.
+        * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
+        * UIProcess/Scrolling/RemoteScrollingTree.cpp:
+        (WebKit::RemoteScrollingTree::scrollingTreeNodeRequestsScroll):
+        * UIProcess/Scrolling/RemoteScrollingTree.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::requestScroll):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/ios/PageClientImplIOS.h:
+        * UIProcess/ios/PageClientImplIOS.mm:
+        (WebKit::PageClientImpl::canScrollView):
+        (WebKit::PageClientImpl::requestScroll):
+        * UIProcess/mac/PageClientImpl.mm:
+        (WebKit::PageClientImpl::requestScroll):
+
</ins><span class="cx"> 2014-04-12  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Keep secondary tile grid for zoomed-out scale
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (167261 => 167262)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2014-04-14 19:45:24 UTC (rev 167261)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2014-04-14 19:49:37 UTC (rev 167262)
</span><span class="lines">@@ -544,6 +544,18 @@
</span><span class="cx">     return contentOffset;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)_scrollToContentOffset:(WebCore::FloatPoint)contentOffset
+{
+    WebCore::FloatPoint scaledOffset = contentOffset;
+    CGFloat zoomScale = contentZoomScale(self);
+    scaledOffset.scale(zoomScale, zoomScale);
+
+    UIEdgeInsets inset = [_scrollView contentInset];
+    scaledOffset += WebCore::FloatSize(-inset.left, -inset.top);
+
+    [_scrollView setContentOffset:scaledOffset];
+}
+
</ins><span class="cx"> - (BOOL)_scrollToRect:(WebCore::FloatRect)targetRect origin:(WebCore::FloatPoint)origin minimumScrollDistance:(float)minimumScrollDistance
</span><span class="cx"> {
</span><span class="cx">     WebCore::FloatRect unobscuredContentRect([self _contentRectForUserInteraction]);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h (167261 => 167262)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h        2014-04-14 19:45:24 UTC (rev 167261)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h        2014-04-14 19:49:37 UTC (rev 167262)
</span><span class="lines">@@ -64,6 +64,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (RetainPtr&lt;CGImageRef&gt;)_takeViewSnapshot;
</span><span class="cx"> 
</span><ins>+- (void)_scrollToContentOffset:(WebCore::FloatPoint)contentOffset;
</ins><span class="cx"> - (BOOL)_scrollToRect:(WebCore::FloatRect)targetRect origin:(WebCore::FloatPoint)origin minimumScrollDistance:(float)minimumScrollDistance;
</span><span class="cx"> - (BOOL)_zoomToRect:(WebCore::FloatRect)targetRect withOrigin:(WebCore::FloatPoint)origin fitEntireRect:(BOOL)fitEntireRect minimumScale:(double)minimumScale maximumScale:(double)maximumScale minimumScrollDistance:(float)minimumScrollDistance;
</span><span class="cx"> - (void)_zoomOutWithOrigin:(WebCore::FloatPoint)origin;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkPageClientImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp (167261 => 167262)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp        2014-04-14 19:45:24 UTC (rev 167261)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp        2014-04-14 19:49:37 UTC (rev 167262)
</span><span class="lines">@@ -83,6 +83,11 @@
</span><span class="cx">     setViewNeedsDisplay(scrollRect);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void PageClientImpl::requestScroll(const WebCore::FloatPoint&amp;, bool)
+{
+    notImplemented();
+}
+
</ins><span class="cx"> WebCore::IntSize PageClientImpl::viewSize()
</span><span class="cx"> {
</span><span class="cx">     if (!gtk_widget_get_realized(m_viewWidget))
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkPageClientImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h (167261 => 167262)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h        2014-04-14 19:45:24 UTC (rev 167261)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h        2014-04-14 19:49:37 UTC (rev 167262)
</span><span class="lines">@@ -65,6 +65,7 @@
</span><span class="cx">     virtual void displayView() override;
</span><span class="cx">     virtual bool canScrollView() override { return false; }
</span><span class="cx">     virtual void scrollView(const WebCore::IntRect&amp; scrollRect, const WebCore::IntSize&amp; scrollOffset) override;
</span><ins>+    virtual void requestScroll(const WebCore::FloatPoint&amp; scrollPosition, bool isProgrammaticScroll) override;
</ins><span class="cx">     virtual WebCore::IntSize viewSize() override;
</span><span class="cx">     virtual bool isViewWindowActive() override;
</span><span class="cx">     virtual bool isViewFocused() override;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCoordinatedGraphicsWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp (167261 => 167262)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp        2014-04-14 19:45:24 UTC (rev 167261)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp        2014-04-14 19:49:37 UTC (rev 167262)
</span><span class="lines">@@ -304,6 +304,11 @@
</span><span class="cx">     setViewNeedsDisplay(scrollRect);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebView::requestScroll(const WebCore::FloatPoint&amp;, bool)
+{
+    notImplemented();
+}
+
</ins><span class="cx"> WebCore::IntSize WebView::viewSize()
</span><span class="cx"> {
</span><span class="cx">     return roundedIntSize(dipSize());
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCoordinatedGraphicsWebViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h (167261 => 167262)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h        2014-04-14 19:45:24 UTC (rev 167261)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h        2014-04-14 19:49:37 UTC (rev 167262)
</span><span class="lines">@@ -131,6 +131,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual bool canScrollView() override { return false; }
</span><span class="cx">     virtual void scrollView(const WebCore::IntRect&amp;, const WebCore::IntSize&amp;) override;
</span><ins>+    virtual void requestScroll(const WebCore::FloatPoint&amp;, bool) override;
</ins><span class="cx"> 
</span><span class="cx">     virtual WebCore::IntSize viewSize() override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPageClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (167261 => 167262)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/PageClient.h        2014-04-14 19:45:24 UTC (rev 167261)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h        2014-04-14 19:49:37 UTC (rev 167262)
</span><span class="lines">@@ -93,6 +93,8 @@
</span><span class="cx">     virtual bool canScrollView() = 0;
</span><span class="cx">     // Tell the view to scroll scrollRect by scrollOffset.
</span><span class="cx">     virtual void scrollView(const WebCore::IntRect&amp; scrollRect, const WebCore::IntSize&amp; scrollOffset) = 0;
</span><ins>+    // Tell the view to scroll to the given position, and whether this was a programmatic scroll.
+    virtual void requestScroll(const WebCore::FloatPoint&amp; scrollPosition, bool isProgrammaticScroll) = 0;
</ins><span class="cx"> 
</span><span class="cx">     // Return the size of the view the page is associated with.
</span><span class="cx">     virtual WebCore::IntSize viewSize() = 0;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessScrollingRemoteScrollingCoordinatorProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp (167261 => 167262)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp        2014-04-14 19:45:24 UTC (rev 167261)
+++ trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp        2014-04-14 19:49:37 UTC (rev 167262)
</span><span class="lines">@@ -160,6 +160,12 @@
</span><span class="cx">     m_webPageProxy.send(Messages::RemoteScrollingCoordinator::ScrollPositionChangedForNode(scrolledNodeID, newScrollPosition));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void RemoteScrollingCoordinatorProxy::scrollingTreeNodeRequestsScroll(ScrollingNodeID scrolledNodeID, const FloatPoint&amp; scrollPosition, bool representsProgrammaticScroll)
+{
+    if (scrolledNodeID == rootScrollingNodeID())
+        m_webPageProxy.requestScroll(scrollPosition, representsProgrammaticScroll);
+}
+
</ins><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(ASYNC_SCROLLING)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessScrollingRemoteScrollingCoordinatorProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h (167261 => 167262)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h        2014-04-14 19:45:24 UTC (rev 167261)
+++ trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h        2014-04-14 19:49:37 UTC (rev 167262)
</span><span class="lines">@@ -53,6 +53,7 @@
</span><span class="cx">     
</span><span class="cx">     // Inform the web process that the scroll position changed (called from the scrolling tree)
</span><span class="cx">     void scrollingTreeNodeDidScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint&amp; newScrollPosition);
</span><ins>+    void scrollingTreeNodeRequestsScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint&amp; scrollPosition, bool representsProgrammaticScroll);
</ins><span class="cx"> 
</span><span class="cx">     bool isPointInNonFastScrollableRegion(const WebCore::IntPoint&amp;) const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessScrollingRemoteScrollingTreecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.cpp (167261 => 167262)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.cpp        2014-04-14 19:45:24 UTC (rev 167261)
+++ trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.cpp        2014-04-14 19:49:37 UTC (rev 167262)
</span><span class="lines">@@ -82,6 +82,11 @@
</span><span class="cx">     m_scrollingCoordinatorProxy.scrollingTreeNodeDidScroll(nodeID, scrollPosition);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void RemoteScrollingTree::scrollingTreeNodeRequestsScroll(ScrollingNodeID nodeID, const FloatPoint&amp; scrollPosition, bool representsProgrammaticScroll)
+{
+    m_scrollingCoordinatorProxy.scrollingTreeNodeRequestsScroll(nodeID, scrollPosition, representsProgrammaticScroll);
+}
+
</ins><span class="cx"> PassOwnPtr&lt;ScrollingTreeNode&gt; RemoteScrollingTree::createNode(ScrollingNodeType nodeType, ScrollingNodeID nodeID)
</span><span class="cx"> {
</span><span class="cx">     switch (nodeType) {
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessScrollingRemoteScrollingTreeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.h (167261 => 167262)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.h        2014-04-14 19:45:24 UTC (rev 167261)
+++ trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.h        2014-04-14 19:49:37 UTC (rev 167262)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx">     const RemoteScrollingCoordinatorProxy&amp; scrollingCoordinatorProxy() const { return m_scrollingCoordinatorProxy; }
</span><span class="cx"> 
</span><span class="cx">     virtual void scrollingTreeNodeDidScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint&amp; scrollPosition, WebCore::SetOrSyncScrollingLayerPosition = WebCore::SyncScrollingLayerPosition) override;
</span><ins>+    virtual void scrollingTreeNodeRequestsScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint&amp; scrollPosition, bool representsProgrammaticScroll) override;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     explicit RemoteScrollingTree(RemoteScrollingCoordinatorProxy&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (167261 => 167262)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2014-04-14 19:45:24 UTC (rev 167261)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2014-04-14 19:49:37 UTC (rev 167262)
</span><span class="lines">@@ -1008,6 +1008,11 @@
</span><span class="cx">     m_pageClient.scrollView(scrollRect, scrollOffset);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebPageProxy::requestScroll(const FloatPoint&amp; scrollPosition, bool isProgrammaticScroll)
+{
+    m_pageClient.requestScroll(scrollPosition, isProgrammaticScroll);
+}
+
</ins><span class="cx"> void WebPageProxy::updateViewState(ViewState::Flags flagsToUpdate)
</span><span class="cx"> {
</span><span class="cx">     m_viewState &amp;= ~flagsToUpdate;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (167261 => 167262)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-04-14 19:45:24 UTC (rev 167261)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-04-14 19:49:37 UTC (rev 167262)
</span><span class="lines">@@ -545,7 +545,8 @@
</span><span class="cx">     void setViewNeedsDisplay(const WebCore::IntRect&amp;);
</span><span class="cx">     void displayView();
</span><span class="cx">     bool canScrollView();
</span><del>-    void scrollView(const WebCore::IntRect&amp; scrollRect, const WebCore::IntSize&amp; scrollOffset);
</del><ins>+    void scrollView(const WebCore::IntRect&amp; scrollRect, const WebCore::IntSize&amp; scrollOffset); // FIXME: CoordinatedGraphics should use requestScroll().
+    void requestScroll(const WebCore::FloatPoint&amp; scrollPosition, bool isProgrammaticScroll);
</ins><span class="cx">     
</span><span class="cx">     void setDelegatesScrolling(bool delegatesScrolling) { m_delegatesScrolling = delegatesScrolling; }
</span><span class="cx">     bool delegatesScrolling() const { return m_delegatesScrolling; }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h (167261 => 167262)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2014-04-14 19:45:24 UTC (rev 167261)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2014-04-14 19:49:37 UTC (rev 167262)
</span><span class="lines">@@ -53,6 +53,7 @@
</span><span class="cx">     virtual void displayView() override;
</span><span class="cx">     virtual bool canScrollView() override;
</span><span class="cx">     virtual void scrollView(const WebCore::IntRect&amp; scrollRect, const WebCore::IntSize&amp; scrollOffset) override;
</span><ins>+    virtual void requestScroll(const WebCore::FloatPoint&amp; scrollPosition, bool isProgrammaticScroll) override;
</ins><span class="cx">     virtual WebCore::IntSize viewSize() override;
</span><span class="cx">     virtual bool isViewWindowActive() override;
</span><span class="cx">     virtual bool isViewFocused() override;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm (167261 => 167262)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2014-04-14 19:45:24 UTC (rev 167261)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2014-04-14 19:49:37 UTC (rev 167262)
</span><span class="lines">@@ -82,15 +82,21 @@
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool PageClientImpl::canScrollView()
+{
+    notImplemented();
+    return false;
+}
+
</ins><span class="cx"> void PageClientImpl::scrollView(const IntRect&amp;, const IntSize&amp;)
</span><span class="cx"> {
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool PageClientImpl::canScrollView()
</del><ins>+void PageClientImpl::requestScroll(const FloatPoint&amp; scrollPosition, bool isProgrammaticScroll)
</ins><span class="cx"> {
</span><del>-    notImplemented();
-    return false;
</del><ins>+    UNUSED_PARAM(isProgrammaticScroll);
+    [m_webView _scrollToContentOffset:scrollPosition];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IntSize PageClientImpl::viewSize()
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacPageClientImplmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm (167261 => 167262)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2014-04-14 19:45:24 UTC (rev 167261)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2014-04-14 19:49:37 UTC (rev 167262)
</span><span class="lines">@@ -170,6 +170,11 @@
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void PageClientImpl::requestScroll(const FloatPoint&amp; scrollPosition, bool isProgrammaticScroll)
+{
+    ASSERT_NOT_REACHED();
+}
+
</ins><span class="cx"> IntSize PageClientImpl::viewSize()
</span><span class="cx"> {
</span><span class="cx">     return IntSize([m_wkView bounds].size);
</span></span></pre>
</div>
</div>

</body>
</html>