<!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>[164702] trunk/Source/WebKit2</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/164702">164702</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2014-02-25 23:43:31 -0800 (Tue, 25 Feb 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[iOS][WK2] Split the rects/scale updates in 3 internally consistent groups
https://bugs.webkit.org/show_bug.cgi?id=129354

Patch by Benjamin Poulain &lt;bpoulain@apple.com&gt; on 2014-02-25
Reviewed by Sam Weinig.

During scaling, the scale and rect of UIScrollView, WebPageProxy, DrawingAreaProxy,
DrawingArea and WebPage were in completely inconsistent states.

Some of those disconnect were temporary (like when setting the rect and scale in two different
messages), some were lasting the time of a tile update (like the UIProcess view of the scale).
This was causing various visual glitches.

To fix this, all the updates from the UIProcess are funneled through a single path and the values
are split into 3 different groups/types.
When updating the scale/rects, the UIProcess sends the new information to the WebProcess on a queue
through ViewUpdateDispatcher. There, the updates are accumulated until the MainThread is available.
Once the main thread is &quot;unblocked&quot; from the previous frame, all the data are updated at once from
the last known state in ViewUpdateDispatcher. The new tiles are created for the new converage information
and they are sent to the UIProcess.

At any point, there are 3 types of scale and rects used for different purpose:
-In the UIProcess, there is the UIScrollView scale and rects which represent the &quot;true&quot; state or what
 is currently on screen.
 That information is mirrored into WebPageProxy for the other classes needing it like DrawingAreaProxy.
-In the WebProcess, there is the last known state. That state is always lagging a little behind the &quot;true&quot;
 state.
-Back in the UIProcess, we have the tile states that is attached to RemoteLayerTreeTransaction. It is used
 to setup the rendering.

With this change, there are two paths for updating the page scale factor:
-The UI drives the change, the updates goes WKWebView-&gt;WKContentView-&gt;WebPageProxy-&gt;ViewUpdateDispatcher
 -&gt;WebPage-&gt;RemoteLayerTreeDrawingArea-&gt;RemoteLayerTreeDrawingAreaProxy-&gt;WKContentView-&gt;WKWebView.
-If changes in the content force scaling parameters, the updates goes: WebPage-&gt;RemoteLayerTreeDrawingArea
 -&gt;RemoteLayerTreeDrawingAreaProxy-&gt;WKContentView-&gt;WKWebView.
The two kind of updates frequently conflicts during loading. We differentiate those through the flag
scaleWasSetByUIProcess passed with the updates. In cases of conflicts, the user always wins.

* DerivedSources.make:
* Scripts/webkit2/messages.py:
(struct_or_class):
* Shared/VisibleContentRectUpdateInfo.cpp: Added.
(WebKit::VisibleContentRectUpdateInfo::encode):
(WebKit::VisibleContentRectUpdateInfo::decode):
* Shared/VisibleContentRectUpdateInfo.h: Added.
(WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
(WebKit::VisibleContentRectUpdateInfo::exposedRect):
(WebKit::VisibleContentRectUpdateInfo::unobscuredRect):
(WebKit::VisibleContentRectUpdateInfo::scale):
(WebKit::operator==):
* Shared/mac/RemoteLayerTreeTransaction.h:
(WebKit::RemoteLayerTreeTransaction::scaleWasSetByUIProcess):
(WebKit::RemoteLayerTreeTransaction::setScaleWasSetByUIProcess):
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::encode):
(WebKit::RemoteLayerTreeTransaction::decode):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView contentView:didCommitLayerTree:WebKit::]):
(-[WKWebView _didFinishScrolling]):
(-[WKWebView scrollViewDidScroll:]):
(-[WKWebView scrollViewDidZoom:]):
(-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
(-[WKWebView _frameOrBoundsChanged]):
(-[WKWebView _updateVisibleContentRectsWithStableState:]):
(-[WKWebView _setObscuredInsets:]):
(-[WKWebView _endInteractiveObscuredInsetsChange]):
* UIProcess/API/ios/WKViewIOS.mm:
(-[WKView _updateVisibleContentRects]):
* UIProcess/DrawingAreaProxy.cpp:
(WebKit::DrawingAreaProxy::DrawingAreaProxy):
(WebKit::DrawingAreaProxy::setCustomFixedPositionRect):
* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::updateDebugIndicator):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::displayedContentScale):
(WebKit::WebPageProxy::exposedContentRect):
(WebKit::WebPageProxy::unobscuredContentRect):
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:]):
(-[WKContentView didFinishScrolling]):
(-[WKContentView didZoomToScale:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::updateVisibleContentRects):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::scaledExposedRect):
(WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
(WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorScale):
(WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebPage/ViewUpdateDispatcher.cpp: Added.
(WebKit::ViewUpdateDispatcher::create):
(WebKit::ViewUpdateDispatcher::ViewUpdateDispatcher):
(WebKit::ViewUpdateDispatcher::~ViewUpdateDispatcher):
(WebKit::ViewUpdateDispatcher::initializeConnection):
(WebKit::ViewUpdateDispatcher::visibleContentRectUpdate):
(WebKit::ViewUpdateDispatcher::dispatchVisibleContentRectUpdate):
* WebProcess/WebPage/ViewUpdateDispatcher.h: Added.
* WebProcess/WebPage/ViewUpdateDispatcher.messages.in: Added.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::WebPage::scalePage):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::scaleWasSetByUIProcess):
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::tapHighlightAtPosition):
(WebKit::WebPage::updateVisibleContentRects):
(WebKit::WebPage::willStartUserTriggeredZooming):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::WebProcess):
(WebKit::WebProcess::initializeConnection):
* WebProcess/WebProcess.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2DerivedSourcesmake">trunk/Source/WebKit2/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionh">trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h</a></li>
<li><a href="#trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionmm">trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIiosWKViewIOSmm">trunk/Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessDrawingAreaProxycpp">trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessDrawingAreaProxyh">trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKContentViewh">trunk/Source/WebKit2/UIProcess/ios/WKContentView.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKContentViewmm">trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm">trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacRemoteLayerTreeDrawingAreaProxyh">trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacRemoteLayerTreeDrawingAreaProxymm">trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageh">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagemessagesin">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm">trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeDrawingAreamm">trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcesscpp">trunk/Source/WebKit2/WebProcess/WebProcess.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcessh">trunk/Source/WebKit2/WebProcess/WebProcess.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2SharedVisibleContentRectUpdateInfocpp">trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedVisibleContentRectUpdateInfoh">trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageViewUpdateDispatchercpp">trunk/Source/WebKit2/WebProcess/WebPage/ViewUpdateDispatcher.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageViewUpdateDispatcherh">trunk/Source/WebKit2/WebProcess/WebPage/ViewUpdateDispatcher.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageViewUpdateDispatchermessagesin">trunk/Source/WebKit2/WebProcess/WebPage/ViewUpdateDispatcher.messages.in</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (164701 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-02-26 07:35:10 UTC (rev 164701)
+++ trunk/Source/WebKit2/ChangeLog        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -1,3 +1,121 @@
</span><ins>+2014-02-25  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
+
+        [iOS][WK2] Split the rects/scale updates in 3 internally consistent groups
+        https://bugs.webkit.org/show_bug.cgi?id=129354
+
+        Reviewed by Sam Weinig.
+
+        During scaling, the scale and rect of UIScrollView, WebPageProxy, DrawingAreaProxy,
+        DrawingArea and WebPage were in completely inconsistent states.
+
+        Some of those disconnect were temporary (like when setting the rect and scale in two different
+        messages), some were lasting the time of a tile update (like the UIProcess view of the scale).
+        This was causing various visual glitches.
+
+        To fix this, all the updates from the UIProcess are funneled through a single path and the values
+        are split into 3 different groups/types.
+        When updating the scale/rects, the UIProcess sends the new information to the WebProcess on a queue
+        through ViewUpdateDispatcher. There, the updates are accumulated until the MainThread is available.
+        Once the main thread is &quot;unblocked&quot; from the previous frame, all the data are updated at once from
+        the last known state in ViewUpdateDispatcher. The new tiles are created for the new converage information
+        and they are sent to the UIProcess.
+
+        At any point, there are 3 types of scale and rects used for different purpose:
+        -In the UIProcess, there is the UIScrollView scale and rects which represent the &quot;true&quot; state or what
+         is currently on screen.
+         That information is mirrored into WebPageProxy for the other classes needing it like DrawingAreaProxy.
+        -In the WebProcess, there is the last known state. That state is always lagging a little behind the &quot;true&quot;
+         state.
+        -Back in the UIProcess, we have the tile states that is attached to RemoteLayerTreeTransaction. It is used
+         to setup the rendering.
+
+        With this change, there are two paths for updating the page scale factor:
+        -The UI drives the change, the updates goes WKWebView-&gt;WKContentView-&gt;WebPageProxy-&gt;ViewUpdateDispatcher
+         -&gt;WebPage-&gt;RemoteLayerTreeDrawingArea-&gt;RemoteLayerTreeDrawingAreaProxy-&gt;WKContentView-&gt;WKWebView.
+        -If changes in the content force scaling parameters, the updates goes: WebPage-&gt;RemoteLayerTreeDrawingArea
+         -&gt;RemoteLayerTreeDrawingAreaProxy-&gt;WKContentView-&gt;WKWebView.
+        The two kind of updates frequently conflicts during loading. We differentiate those through the flag
+        scaleWasSetByUIProcess passed with the updates. In cases of conflicts, the user always wins.
+
+        * DerivedSources.make:
+        * Scripts/webkit2/messages.py:
+        (struct_or_class):
+        * Shared/VisibleContentRectUpdateInfo.cpp: Added.
+        (WebKit::VisibleContentRectUpdateInfo::encode):
+        (WebKit::VisibleContentRectUpdateInfo::decode):
+        * Shared/VisibleContentRectUpdateInfo.h: Added.
+        (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
+        (WebKit::VisibleContentRectUpdateInfo::exposedRect):
+        (WebKit::VisibleContentRectUpdateInfo::unobscuredRect):
+        (WebKit::VisibleContentRectUpdateInfo::scale):
+        (WebKit::operator==):
+        * Shared/mac/RemoteLayerTreeTransaction.h:
+        (WebKit::RemoteLayerTreeTransaction::scaleWasSetByUIProcess):
+        (WebKit::RemoteLayerTreeTransaction::setScaleWasSetByUIProcess):
+        * Shared/mac/RemoteLayerTreeTransaction.mm:
+        (WebKit::RemoteLayerTreeTransaction::encode):
+        (WebKit::RemoteLayerTreeTransaction::decode):
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView contentView:didCommitLayerTree:WebKit::]):
+        (-[WKWebView _didFinishScrolling]):
+        (-[WKWebView scrollViewDidScroll:]):
+        (-[WKWebView scrollViewDidZoom:]):
+        (-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
+        (-[WKWebView _frameOrBoundsChanged]):
+        (-[WKWebView _updateVisibleContentRectsWithStableState:]):
+        (-[WKWebView _setObscuredInsets:]):
+        (-[WKWebView _endInteractiveObscuredInsetsChange]):
+        * UIProcess/API/ios/WKViewIOS.mm:
+        (-[WKView _updateVisibleContentRects]):
+        * UIProcess/DrawingAreaProxy.cpp:
+        (WebKit::DrawingAreaProxy::DrawingAreaProxy):
+        (WebKit::DrawingAreaProxy::setCustomFixedPositionRect):
+        * UIProcess/DrawingAreaProxy.h:
+        (WebKit::DrawingAreaProxy::updateDebugIndicator):
+        * UIProcess/WebPageProxy.h:
+        (WebKit::WebPageProxy::displayedContentScale):
+        (WebKit::WebPageProxy::exposedContentRect):
+        (WebKit::WebPageProxy::unobscuredContentRect):
+        * UIProcess/ios/WKContentView.h:
+        * UIProcess/ios/WKContentView.mm:
+        (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:]):
+        (-[WKContentView didFinishScrolling]):
+        (-[WKContentView didZoomToScale:]):
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::updateVisibleContentRects):
+        * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
+        * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
+        (WebKit::RemoteLayerTreeDrawingAreaProxy::scaledExposedRect):
+        (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
+        (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorScale):
+        (WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
+        * WebKit2.xcodeproj/project.pbxproj:
+        * WebProcess/WebPage/ViewUpdateDispatcher.cpp: Added.
+        (WebKit::ViewUpdateDispatcher::create):
+        (WebKit::ViewUpdateDispatcher::ViewUpdateDispatcher):
+        (WebKit::ViewUpdateDispatcher::~ViewUpdateDispatcher):
+        (WebKit::ViewUpdateDispatcher::initializeConnection):
+        (WebKit::ViewUpdateDispatcher::visibleContentRectUpdate):
+        (WebKit::ViewUpdateDispatcher::dispatchVisibleContentRectUpdate):
+        * WebProcess/WebPage/ViewUpdateDispatcher.h: Added.
+        * WebProcess/WebPage/ViewUpdateDispatcher.messages.in: Added.
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::WebPage):
+        (WebKit::WebPage::scalePage):
+        * WebProcess/WebPage/WebPage.h:
+        (WebKit::WebPage::scaleWasSetByUIProcess):
+        * WebProcess/WebPage/WebPage.messages.in:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::tapHighlightAtPosition):
+        (WebKit::WebPage::updateVisibleContentRects):
+        (WebKit::WebPage::willStartUserTriggeredZooming):
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
+        (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::WebProcess):
+        (WebKit::WebProcess::initializeConnection):
+        * WebProcess/WebProcess.h:
+
</ins><span class="cx"> 2014-02-25  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Rename WebCore::VisitedLinkProvider to WebCore::VisitedLinkStore
</span></span></pre></div>
<a id="trunkSourceWebKit2DerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DerivedSources.make (164701 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DerivedSources.make        2014-02-26 07:35:10 UTC (rev 164701)
+++ trunk/Source/WebKit2/DerivedSources.make        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -97,6 +97,7 @@
</span><span class="cx">     StorageManager \
</span><span class="cx">     ViewGestureController \
</span><span class="cx">     ViewGestureGeometryCollector \
</span><ins>+    ViewUpdateDispatcher \
</ins><span class="cx">     WebApplicationCacheManager \
</span><span class="cx">     WebApplicationCacheManagerProxy \
</span><span class="cx">     WebConnection \
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedVisibleContentRectUpdateInfocpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.cpp (0 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.cpp                                (rev 0)
+++ trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.cpp        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;VisibleContentRectUpdateInfo.h&quot;
+
+#include &quot;WebCoreArgumentCoders.h&quot;
+
+namespace WebKit {
+
+void VisibleContentRectUpdateInfo::encode(IPC::ArgumentEncoder&amp; encoder) const
+{
+    encoder &lt;&lt; m_exposedRect;
+    encoder &lt;&lt; m_unobscuredRect;
+    encoder &lt;&lt; m_scale;
+}
+
+bool VisibleContentRectUpdateInfo::decode(IPC::ArgumentDecoder&amp; decoder, VisibleContentRectUpdateInfo&amp; result)
+{
+    if (!decoder.decode(result.m_exposedRect))
+        return false;
+    if (!decoder.decode(result.m_unobscuredRect))
+        return false;
+    if (!decoder.decode(result.m_scale))
+        return false;
+    return true;
+}
+
+} // namespace WebKit
</ins></span></pre></div>
<a id="trunkSourceWebKit2SharedVisibleContentRectUpdateInfoh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.h (0 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.h                                (rev 0)
+++ trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.h        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef VisibleContentRectUpdateInfo_h
+#define VisibleContentRectUpdateInfo_h
+
+#include &lt;WebCore/FloatRect.h&gt;
+
+namespace IPC {
+class ArgumentDecoder;
+class ArgumentEncoder;
+}
+
+namespace WebKit {
+
+class VisibleContentRectUpdateInfo {
+public:
+    VisibleContentRectUpdateInfo()
+        : m_scale(-1)
+    {
+    }
+
+    VisibleContentRectUpdateInfo(const WebCore::FloatRect&amp; exposedRect, const WebCore::FloatRect&amp; unobscuredRect, double scale)
+        : m_exposedRect(exposedRect)
+        , m_unobscuredRect(unobscuredRect)
+        , m_scale(scale)
+    {
+    }
+
+    const WebCore::FloatRect&amp; exposedRect() const { return m_exposedRect; }
+    const WebCore::FloatRect&amp; unobscuredRect() const { return m_unobscuredRect; }
+    double scale() const { return m_scale; }
+
+    void encode(IPC::ArgumentEncoder&amp;) const;
+    static bool decode(IPC::ArgumentDecoder&amp;, VisibleContentRectUpdateInfo&amp;);
+
+private:
+    WebCore::FloatRect m_exposedRect;
+    WebCore::FloatRect m_unobscuredRect;
+    double m_scale;
+};
+
+inline bool operator==(const VisibleContentRectUpdateInfo&amp; a, const VisibleContentRectUpdateInfo&amp; b)
+{
+    return a.scale() == b.scale() &amp;&amp; a.exposedRect() == b.exposedRect() &amp;&amp; a.unobscuredRect() == b.unobscuredRect();
+}
+
+} // namespace WebKit
+
+#endif // VisibleContentRectUpdateInfo_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h (164701 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h        2014-02-26 07:35:10 UTC (rev 164701)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -164,6 +164,9 @@
</span><span class="cx"> 
</span><span class="cx">     double pageScaleFactor() const { return m_pageScaleFactor; }
</span><span class="cx">     void setPageScaleFactor(double pageScaleFactor) { m_pageScaleFactor = pageScaleFactor; }
</span><ins>+
+    bool scaleWasSetByUIProcess() const { return m_scaleWasSetByUIProcess; }
+    void setScaleWasSetByUIProcess(bool scaleWasSetByUIProcess) { m_scaleWasSetByUIProcess = scaleWasSetByUIProcess; }
</ins><span class="cx">     
</span><span class="cx">     uint64_t renderTreeSize() const { return m_renderTreeSize; }
</span><span class="cx">     void setRenderTreeSize(uint64_t renderTreeSize) { m_renderTreeSize = renderTreeSize; }
</span><span class="lines">@@ -187,6 +190,7 @@
</span><span class="cx">     Vector&lt;WebCore::GraphicsLayer::PlatformLayerID&gt; m_destroyedLayerIDs;
</span><span class="cx">     WebCore::IntSize m_contentsSize;
</span><span class="cx">     double m_pageScaleFactor;
</span><ins>+    bool m_scaleWasSetByUIProcess;
</ins><span class="cx">     uint64_t m_renderTreeSize;
</span><span class="cx">     double m_minimumScaleFactor;
</span><span class="cx">     double m_maximumScaleFactor;
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm (164701 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm        2014-02-26 07:35:10 UTC (rev 164701)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -410,6 +410,7 @@
</span><span class="cx">     encoder &lt;&lt; m_destroyedLayerIDs;
</span><span class="cx">     encoder &lt;&lt; m_contentsSize;
</span><span class="cx">     encoder &lt;&lt; m_pageScaleFactor;
</span><ins>+    encoder &lt;&lt; m_scaleWasSetByUIProcess;
</ins><span class="cx">     encoder &lt;&lt; m_minimumScaleFactor;
</span><span class="cx">     encoder &lt;&lt; m_maximumScaleFactor;
</span><span class="cx">     encoder &lt;&lt; m_allowsUserScaling;
</span><span class="lines">@@ -457,6 +458,9 @@
</span><span class="cx">     if (!decoder.decode(result.m_pageScaleFactor))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><ins>+    if (!decoder.decode(result.m_scaleWasSetByUIProcess))
+        return false;
+
</ins><span class="cx">     if (!decoder.decode(result.m_minimumScaleFactor))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (164701 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2014-02-26 07:35:10 UTC (rev 164701)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -326,7 +326,7 @@
</span><span class="cx">     [_scrollView setMinimumZoomScale:layerTreeTransaction.minimumScaleFactor()];
</span><span class="cx">     [_scrollView setMaximumZoomScale:layerTreeTransaction.maximumScaleFactor()];
</span><span class="cx">     [_scrollView setZoomEnabled:layerTreeTransaction.allowsUserScaling()];
</span><del>-    if (![_scrollView isZooming] &amp;&amp; ![_scrollView isZoomBouncing])
</del><ins>+    if (!layerTreeTransaction.scaleWasSetByUIProcess() &amp;&amp; ![_scrollView isZooming] &amp;&amp; ![_scrollView isZoomBouncing])
</ins><span class="cx">         [_scrollView setZoomScale:layerTreeTransaction.pageScaleFactor()];
</span><span class="cx"> 
</span><span class="cx">     if (_gestureController)
</span><span class="lines">@@ -374,7 +374,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_didFinishScrolling
</span><span class="cx"> {
</span><del>-    [self _updateVisibleContentRects];
</del><ins>+    [self _updateVisibleContentRectsWithStableState:YES];
</ins><span class="cx">     [_contentView didFinishScrolling];
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -397,18 +397,18 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)scrollViewDidScroll:(UIScrollView *)scrollView
</span><span class="cx"> {
</span><del>-    [self _updateVisibleContentRects];
</del><ins>+    [self _updateVisibleContentRectsWithStableState:NO];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)scrollViewDidZoom:(UIScrollView *)scrollView
</span><span class="cx"> {
</span><del>-    [self _updateVisibleContentRects];
</del><ins>+    [self _updateVisibleContentRectsWithStableState:NO];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(CGFloat)scale
</span><span class="cx"> {
</span><span class="cx">     ASSERT(scrollView == _scrollView);
</span><del>-    [self _updateVisibleContentRects];
</del><ins>+    [self _updateVisibleContentRectsWithStableState:YES];
</ins><span class="cx">     [_contentView didZoomToScale:scale];
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -420,10 +420,10 @@
</span><span class="cx">         [_contentView setMinimumLayoutSize:bounds.size];
</span><span class="cx">     [_scrollView setFrame:bounds];
</span><span class="cx">     [_contentView setMinimumSize:bounds.size];
</span><del>-    [self _updateVisibleContentRects];
</del><ins>+    [self _updateVisibleContentRectsWithStableState:YES];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_updateVisibleContentRects
</del><ins>+- (void)_updateVisibleContentRectsWithStableState:(BOOL)isStateStable
</ins><span class="cx"> {
</span><span class="cx">     CGRect fullViewRect = self.bounds;
</span><span class="cx">     CGRect visibleRectInContentCoordinates = [self convertRect:fullViewRect toView:_contentView.get()];
</span><span class="lines">@@ -433,7 +433,7 @@
</span><span class="cx"> 
</span><span class="cx">     CGFloat scaleFactor = [_scrollView zoomScale];
</span><span class="cx"> 
</span><del>-    [_contentView didUpdateVisibleRect:visibleRectInContentCoordinates unobscuredRect:unobscuredRectInContentCoordinates scale:scaleFactor];
</del><ins>+    [_contentView didUpdateVisibleRect:visibleRectInContentCoordinates unobscuredRect:unobscuredRectInContentCoordinates scale:scaleFactor inStableState:isStateStable];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_keyboardChangedWithInfo:(NSDictionary *)keyboardInfo adjustScrollView:(BOOL)adjustScrollView
</span><span class="lines">@@ -696,7 +696,7 @@
</span><span class="cx">     ASSERT(obscuredInsets.bottom &gt;= 0);
</span><span class="cx">     ASSERT(obscuredInsets.right &gt;= 0);
</span><span class="cx">     _obscuredInsets = obscuredInsets;
</span><del>-    [self _updateVisibleContentRects];
</del><ins>+    [self _updateVisibleContentRectsWithStableState:!_isChangingObscuredInsetsInteractively];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (UIColor *)_pageExtendedBackgroundColor
</span><span class="lines">@@ -728,6 +728,7 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(_isChangingObscuredInsetsInteractively);
</span><span class="cx">     _isChangingObscuredInsetsInteractively = NO;
</span><ins>+    [self _updateVisibleContentRectsWithStableState:YES];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIiosWKViewIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm (164701 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm        2014-02-26 07:35:10 UTC (rev 164701)
+++ trunk/Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -263,7 +263,7 @@
</span><span class="cx"> 
</span><span class="cx">     CGFloat scaleFactor = [_scrollView zoomScale];
</span><span class="cx"> 
</span><del>-    [_contentView didUpdateVisibleRect:visibleRectInContentCoordinates unobscuredRect:unobscuredRectInContentCoordinates scale:scaleFactor];
</del><ins>+    [_contentView didUpdateVisibleRect:visibleRectInContentCoordinates unobscuredRect:unobscuredRectInContentCoordinates scale:scaleFactor inStableState:YES];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_keyboardChangedWithInfo:(NSDictionary *)keyboardInfo adjustScrollView:(BOOL)adjustScrollView
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessDrawingAreaProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.cpp (164701 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.cpp        2014-02-26 07:35:10 UTC (rev 164701)
+++ trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.cpp        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010, 2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx">     : m_type(type)
</span><span class="cx">     , m_webPageProxy(webPageProxy)
</span><span class="cx">     , m_size(webPageProxy-&gt;viewSize())
</span><del>-#if PLATFORM(COCOA)
</del><ins>+#if PLATFORM(MAC)
</ins><span class="cx">     , m_exposedRectChangedTimer(RunLoop::main(), this, &amp;DrawingAreaProxy::exposedRectChangedTimerFired)
</span><span class="cx"> #endif
</span><span class="cx"> {
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx">     sizeDidChange();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if PLATFORM(COCOA)
</del><ins>+#if PLATFORM(MAC)
</ins><span class="cx"> void DrawingAreaProxy::setExposedRect(const FloatRect&amp; exposedRect)
</span><span class="cx"> {
</span><span class="cx">     if (!m_webPageProxy-&gt;isValid())
</span><span class="lines">@@ -85,6 +85,7 @@
</span><span class="cx">     m_webPageProxy-&gt;process().send(Messages::DrawingArea::SetExposedRect(m_exposedRect), m_webPageProxy-&gt;pageID());
</span><span class="cx">     m_lastSentExposedRect = m_exposedRect;
</span><span class="cx"> }
</span><ins>+#endif // PLATFORM(MAC)
</ins><span class="cx"> 
</span><span class="cx"> void DrawingAreaProxy::setCustomFixedPositionRect(const FloatRect&amp; fixedPositionRect)
</span><span class="cx"> {
</span><span class="lines">@@ -93,6 +94,5 @@
</span><span class="cx"> 
</span><span class="cx">     m_webPageProxy-&gt;process().send(Messages::DrawingArea::SetCustomFixedPositionRect(fixedPositionRect), m_webPageProxy-&gt;pageID());
</span><span class="cx"> }
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessDrawingAreaProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.h (164701 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.h        2014-02-26 07:35:10 UTC (rev 164701)
+++ trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.h        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -73,14 +73,17 @@
</span><span class="cx">     virtual void adjustTransientZoom(double, WebCore::FloatPoint) { }
</span><span class="cx">     virtual void commitTransientZoom(double, WebCore::FloatPoint) { }
</span><span class="cx"> 
</span><del>-#if PLATFORM(COCOA)
</del><ins>+#if PLATFORM(MAC)
</ins><span class="cx">     virtual void setExposedRect(const WebCore::FloatRect&amp;);
</span><span class="cx">     WebCore::FloatRect exposedRect() const { return m_exposedRect; }
</span><ins>+#endif
+#if PLATFORM(COCOA)
</ins><span class="cx">     void exposedRectChangedTimerFired();
</span><span class="cx">     
</span><span class="cx">     void setCustomFixedPositionRect(const WebCore::FloatRect&amp;);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    virtual void updateDebugIndicator() { }
</ins><span class="cx">     virtual void showDebugIndicator(bool) { }
</span><span class="cx">     virtual bool isShowingDebugIndicator() const { return false; }
</span><span class="cx"> 
</span><span class="lines">@@ -111,9 +114,11 @@
</span><span class="cx">     virtual void didUpdateGeometry() { }
</span><span class="cx">     virtual void intrinsicContentSizeDidChange(const WebCore::IntSize&amp; newIntrinsicContentSize) { }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(MAC)
</ins><span class="cx">     RunLoop::Timer&lt;DrawingAreaProxy&gt; m_exposedRectChangedTimer;
</span><span class="cx">     WebCore::FloatRect m_exposedRect;
</span><span class="cx">     WebCore::FloatRect m_lastSentExposedRect;
</span><ins>+#endif // PLATFORM(MAC)
</ins><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (164701 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-02-26 07:35:10 UTC (rev 164701)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010, 2011, 2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx"> #include &quot;PlatformProcessIdentifier.h&quot;
</span><span class="cx"> #include &quot;SandboxExtension.h&quot;
</span><span class="cx"> #include &quot;ShareableBitmap.h&quot;
</span><ins>+#include &quot;VisibleContentRectUpdateInfo.h&quot;
</ins><span class="cx"> #include &quot;WKBase.h&quot;
</span><span class="cx"> #include &quot;WKPagePrivate.h&quot;
</span><span class="cx"> #include &quot;WebColorPicker.h&quot;
</span><span class="lines">@@ -451,8 +452,11 @@
</span><span class="cx">     void executeEditCommand(const String&amp; commandName);
</span><span class="cx">     void validateCommand(const String&amp; commandName, PassRefPtr&lt;ValidateCommandCallback&gt;);
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-    const WebCore::FloatRect&amp; unobscuredContentRect() const;
-    void setUnobscuredContentRect(const WebCore::FloatRect&amp; unobscuredRect);
</del><ins>+    double displayedContentScale() const { return m_lastVisibleContentRectUpdate.scale(); }
+    const WebCore::FloatRect&amp; exposedContentRect() const { return m_lastVisibleContentRectUpdate.exposedRect(); }
+    const WebCore::FloatRect&amp; unobscuredContentRect() const { return m_lastVisibleContentRectUpdate.unobscuredRect(); }
+
+    void updateVisibleContentRects(const VisibleContentRectUpdateInfo&amp;);
</ins><span class="cx">     void setViewportConfigurationMinimumLayoutSize(const WebCore::IntSize&amp;);
</span><span class="cx">     void didCommitLayerTree(const WebKit::RemoteLayerTreeTransaction&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -847,7 +851,6 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     void willStartUserTriggeredZooming();
</span><del>-    void didFinishZooming(float newScale);
</del><span class="cx"> 
</span><span class="cx">     void tapHighlightAtPosition(const WebCore::FloatPoint&amp;, uint64_t&amp; requestID);
</span><span class="cx"> 
</span><span class="lines">@@ -1240,7 +1243,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     RefPtr&lt;WebVideoFullscreenManagerProxy&gt; m_videoFullscreenManager;
</span><del>-    WebCore::FloatRect m_unobscuredRect;
</del><ins>+    VisibleContentRectUpdateInfo m_lastVisibleContentRectUpdate;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIBRATION)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentView.h (164701 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentView.h        2014-02-26 07:35:10 UTC (rev 164701)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentView.h        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)setMinimumSize:(CGSize)size;
</span><span class="cx"> - (void)setMinimumLayoutSize:(CGSize)size;
</span><del>-- (void)didUpdateVisibleRect:(CGRect)visibleRect unobscuredRect:(CGRect)unobscuredRect scale:(CGFloat)scale;
</del><ins>+- (void)didUpdateVisibleRect:(CGRect)visibleRect unobscuredRect:(CGRect)unobscuredRect scale:(CGFloat)scale inStableState:(BOOL)isStableState;
</ins><span class="cx"> 
</span><span class="cx"> - (void)didFinishScrolling;
</span><span class="cx"> - (void)didZoomToScale:(CGFloat)scale;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm (164701 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm        2014-02-26 07:35:10 UTC (rev 164701)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -146,18 +146,21 @@
</span><span class="cx">     return [self isEditable];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)didUpdateVisibleRect:(CGRect)visibleRect unobscuredRect:(CGRect)unobscuredRect scale:(CGFloat)scale
</del><ins>+- (void)didUpdateVisibleRect:(CGRect)visibleRect unobscuredRect:(CGRect)unobscuredRect scale:(CGFloat)scale inStableState:(BOOL)isStableState
</ins><span class="cx"> {
</span><del>-    _page-&gt;setUnobscuredContentRect(unobscuredRect);
-    _page-&gt;scrollingCoordinatorProxy()-&gt;scrollPositionChangedViaDelegatedScrolling(_page-&gt;scrollingCoordinatorProxy()-&gt;rootScrollingNodeID(), roundedIntPoint(unobscuredRect.origin));
</del><ins>+    double scaleNoiseThreshold = 0.0005;
+    if (!isStableState &amp;&amp; abs(scale - _page-&gt;displayedContentScale()) &lt; scaleNoiseThreshold) {
+        // Tiny changes of scale during interactive zoom cause content to jump by one pixel, creating
+        // visual noise. We filter those useless updates.
+        scale = _page-&gt;displayedContentScale();
+    }
+    _page-&gt;updateVisibleContentRects(VisibleContentRectUpdateInfo(visibleRect, unobscuredRect, scale));
</ins><span class="cx"> 
</span><span class="cx">     if (auto drawingArea = _page-&gt;drawingArea()) {
</span><del>-        FloatRect exposedRect = visibleRect;
-        exposedRect.scale(scale);
-        drawingArea-&gt;setExposedRect(exposedRect);
</del><ins>+        FloatRect fixedPosRect = [self fixedPositionRectFromExposedRect:unobscuredRect scale:scale];
+        drawingArea-&gt;setCustomFixedPositionRect(fixedPosRect);
+        drawingArea-&gt;updateDebugIndicator();
</ins><span class="cx">     }
</span><del>-
-    [self _updateFixedPositionRect];
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)setMinimumSize:(CGSize)size
</span><span class="lines">@@ -172,15 +175,6 @@
</span><span class="cx">     return exposedRect;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_updateFixedPositionRect
-{
-    auto drawingArea = _page-&gt;drawingArea();
-    if (!drawingArea)
-        return;
-    FloatRect fixedPosRect = [self fixedPositionRectFromExposedRect:_page-&gt;unobscuredContentRect() scale:_page-&gt;pageScaleFactor()];
-    drawingArea-&gt;setCustomFixedPositionRect(fixedPosRect);
-}
-
</del><span class="cx"> - (void)setMinimumLayoutSize:(CGSize)size
</span><span class="cx"> {
</span><span class="cx">     _page-&gt;setViewportConfigurationMinimumLayoutSize(IntSize(CGCeiling(size.width), CGCeiling(size.height)));
</span><span class="lines">@@ -188,7 +182,6 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)didFinishScrolling
</span><span class="cx"> {
</span><del>-    [self _updateFixedPositionRect];
</del><span class="cx">     [self _didEndScrollingOrZooming];
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -210,7 +203,6 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)didZoomToScale:(CGFloat)scale
</span><span class="cx"> {
</span><del>-    _page-&gt;didFinishZooming(scale);
</del><span class="cx">     [self _didEndScrollingOrZooming];
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (164701 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2014-02-26 07:35:10 UTC (rev 164701)
+++ trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #import &quot;NativeWebKeyboardEvent.h&quot;
</span><span class="cx"> #import &quot;PageClient.h&quot;
</span><ins>+#import &quot;ViewUpdateDispatcherMessages.h&quot;
</ins><span class="cx"> #import &quot;WKBrowsingContextControllerInternal.h&quot;
</span><span class="cx"> #import &quot;WebKitSystemInterfaceIOS.h&quot;
</span><span class="cx"> #import &quot;WebPageMessages.h&quot;
</span><span class="lines">@@ -230,16 +231,14 @@
</span><span class="cx">     callback-&gt;performCallbackWithReturnValue(beforeText, markedText, selectedText, afterText, location, length);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-const FloatRect&amp; WebPageProxy::unobscuredContentRect() const
</del><ins>+void WebPageProxy::updateVisibleContentRects(const VisibleContentRectUpdateInfo&amp; visibleContentRectUpdateInfo)
</ins><span class="cx"> {
</span><del>-    return m_unobscuredRect;
</del><ins>+    if (visibleContentRectUpdateInfo == m_lastVisibleContentRectUpdate)
+        return;
+    m_lastVisibleContentRectUpdate = visibleContentRectUpdateInfo;
+    m_process-&gt;send(Messages::ViewUpdateDispatcher::VisibleContentRectUpdate(m_pageID, visibleContentRectUpdateInfo), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::setUnobscuredContentRect(const FloatRect&amp; unobscuredRect)
-{
-    m_unobscuredRect = unobscuredRect;
-}
-
</del><span class="cx"> void WebPageProxy::setViewportConfigurationMinimumLayoutSize(const WebCore::IntSize&amp; size)
</span><span class="cx"> {
</span><span class="cx">     m_process-&gt;send(Messages::WebPage::SetViewportConfigurationMinimumLayoutSize(size), m_pageID);
</span><span class="lines">@@ -455,12 +454,6 @@
</span><span class="cx">     process().send(Messages::WebPage::WillStartUserTriggeredZooming(), m_pageID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::didFinishZooming(float newScale)
-{
-    m_pageScaleFactor = newScale;
-    process().send(Messages::WebPage::DidFinishZooming(newScale), m_pageID);
-}
-
</del><span class="cx"> void WebPageProxy::tapHighlightAtPosition(const WebCore::FloatPoint&amp; position, uint64_t&amp; requestID)
</span><span class="cx"> {
</span><span class="cx">     static uint64_t uniqueRequestID = 0;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacRemoteLayerTreeDrawingAreaProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h (164701 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h        2014-02-26 07:35:10 UTC (rev 164701)
+++ trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012-2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -49,11 +49,15 @@
</span><span class="cx">     virtual void deviceScaleFactorDidChange() override;
</span><span class="cx">     virtual void didUpdateGeometry() override;
</span><span class="cx"> 
</span><ins>+    WebCore::FloatRect scaledExposedRect() const;
</ins><span class="cx">     void showDebugIndicator(bool);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(MAC)
</ins><span class="cx">     virtual void setExposedRect(const WebCore::FloatRect&amp;) override;
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     float indicatorScale(WebCore::IntSize contentsSize) const;
</span><ins>+    virtual void updateDebugIndicator() override;
</ins><span class="cx">     void updateDebugIndicator(WebCore::IntSize contentsSize, bool rootLayerChanged, float scale);
</span><span class="cx">     void updateDebugIndicatorPosition();
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacRemoteLayerTreeDrawingAreaProxymm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm (164701 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm        2014-02-26 07:35:10 UTC (rev 164701)
+++ trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012-2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -78,6 +78,18 @@
</span><span class="cx">         sendUpdateGeometry();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+FloatRect RemoteLayerTreeDrawingAreaProxy::scaledExposedRect() const
+{
+#if PLATFORM(IOS)
+    return m_webPageProxy-&gt;exposedContentRect();
+#else
+    FloatRect scaledExposedRect = exposedRect();
+    float scale = 1 / m_webPageProxy-&gt;pageScaleFactor();
+    scaledExposedRect.scale(scale, scale);
+    return scaledExposedRect;
+#endif
+}
+
</ins><span class="cx"> void RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry()
</span><span class="cx"> {
</span><span class="cx">     m_lastSentSize = m_size;
</span><span class="lines">@@ -109,21 +121,28 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static const float indicatorInset = 10;
</span><del>-static const float indicatorTopInset = 100;
</del><span class="cx"> 
</span><ins>+#if PLATFORM(MAC)
</ins><span class="cx"> void RemoteLayerTreeDrawingAreaProxy::setExposedRect(const WebCore::FloatRect&amp; r)
</span><span class="cx"> {
</span><span class="cx">     DrawingAreaProxy::setExposedRect(r);
</span><span class="cx">     updateDebugIndicatorPosition();
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> FloatPoint RemoteLayerTreeDrawingAreaProxy::indicatorLocation() const
</span><span class="cx"> {
</span><span class="cx">     if (m_webPageProxy-&gt;delegatesScrolling()) {
</span><ins>+#if PLATFORM(IOS)
+        FloatPoint tiledMapLocation = m_webPageProxy-&gt;unobscuredContentRect().location();
+        float absoluteInset = indicatorInset / m_webPageProxy-&gt;displayedContentScale();
+        tiledMapLocation += FloatSize(absoluteInset, absoluteInset);
+#else
</ins><span class="cx">         FloatPoint tiledMapLocation = exposedRect().location();
</span><del>-        tiledMapLocation += FloatSize(indicatorInset, indicatorTopInset);
-        float scale = 1 / m_webPageProxy-&gt;pageScaleFactor();
</del><ins>+        tiledMapLocation += FloatSize(indicatorInset, indicatorInset);
+        float scale = 1 / m_webPageProxy-&gt;pageScaleFactor();;
</ins><span class="cx">         tiledMapLocation.scale(scale, scale);
</span><ins>+#endif
</ins><span class="cx">         return tiledMapLocation;
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -146,12 +165,18 @@
</span><span class="cx">     float scale = 1;
</span><span class="cx">     if (!contentsSize.isEmpty()) {
</span><span class="cx">         float widthScale = std::min&lt;float&gt;((viewSize.width() - 2 * indicatorInset) / contentsSize.width(), 0.05);
</span><del>-        scale = std::min(widthScale, static_cast&lt;float&gt;(viewSize.height() - indicatorTopInset - indicatorInset) / contentsSize.height());
</del><ins>+        scale = std::min(widthScale, static_cast&lt;float&gt;(viewSize.height() - 2 * indicatorInset) / contentsSize.height());
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     return scale;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator()
+{
+    // FIXME: we should also update live information during scale.
+    updateDebugIndicatorPosition();
+}
+
</ins><span class="cx"> void RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator(IntSize contentsSize, bool rootLayerChanged, float scale)
</span><span class="cx"> {
</span><span class="cx">     // Make sure we're the last sublayer.
</span><span class="lines">@@ -178,10 +203,7 @@
</span><span class="cx">     [m_exposedRectIndicatorLayer setBorderWidth:counterScaledBorder];
</span><span class="cx"> 
</span><span class="cx">     if (m_webPageProxy-&gt;delegatesScrolling()) {
</span><del>-        FloatRect scaledExposedRect = exposedRect();
-        float scale = 1 / m_webPageProxy-&gt;pageScaleFactor();
-        scaledExposedRect.scale(scale, scale);
-
</del><ins>+        FloatRect scaledExposedRect = this-&gt;scaledExposedRect();
</ins><span class="cx">         [m_exposedRectIndicatorLayer setPosition:scaledExposedRect.location()];
</span><span class="cx">         [m_exposedRectIndicatorLayer setBounds:FloatRect(FloatPoint(), scaledExposedRect.size())];
</span><span class="cx">     } else {
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (164701 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-02-26 07:35:10 UTC (rev 164701)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -448,6 +448,12 @@
</span><span class="cx">                 1QQ417CB12C00CCA002BE67B /* TextCheckerCompletion.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CC417C912C00CCA002BE67B /* TextCheckerCompletion.h */; };
</span><span class="cx">                 1ZZ417EF12C00D87002BE67B /* TextCheckerCompletion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1BB417C912C00CCA002BE67B /* TextCheckerCompletion.cpp */; };
</span><span class="cx">                 263172CF18B469490065B9C3 /* NativeWebTouchEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 263172CE18B469490065B9C3 /* NativeWebTouchEvent.h */; };
</span><ins>+                2684054418B85A630022C38B /* VisibleContentRectUpdateInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 2684054218B85A630022C38B /* VisibleContentRectUpdateInfo.h */; };
+                2684054918B85FF70022C38B /* ViewUpdateDispatcher.messages.in in Resources */ = {isa = PBXBuildFile; fileRef = 2684054818B85FF70022C38B /* ViewUpdateDispatcher.messages.in */; };
+                2684054C18B86C350022C38B /* VisibleContentRectUpdateInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2684054A18B866FF0022C38B /* VisibleContentRectUpdateInfo.cpp */; };
+                2684054F18B86C8E0022C38B /* ViewUpdateDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2684054518B85E7E0022C38B /* ViewUpdateDispatcher.cpp */; };
+                2684055218B86ED60022C38B /* ViewUpdateDispatcherMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2684055018B86ED60022C38B /* ViewUpdateDispatcherMessageReceiver.cpp */; };
+                2684055318B86ED60022C38B /* ViewUpdateDispatcherMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 2684055118B86ED60022C38B /* ViewUpdateDispatcherMessages.h */; };
</ins><span class="cx">                 26F9A83B18A3468100AEB88A /* WKWebViewPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 26F9A83A18A3463F00AEB88A /* WKWebViewPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 290F4272172A0C7400939FF0 /* ChildProcessSupplement.h in Headers */ = {isa = PBXBuildFile; fileRef = 290F4271172A0C7400939FF0 /* ChildProcessSupplement.h */; };
</span><span class="cx">                 293EBEAB1627D9C9005F89F1 /* WKDOMText.h in Headers */ = {isa = PBXBuildFile; fileRef = 293EBEA91627D9C9005F89F1 /* WKDOMText.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -2164,6 +2170,13 @@
</span><span class="cx">                 1FB00AC6185F76460019142E /* WKWebProcessPlugInPageGroupInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebProcessPlugInPageGroupInternal.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 263172CE18B469490065B9C3 /* NativeWebTouchEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeWebTouchEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 26659AA0185FAAED004303DD /* Info-iOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = &quot;Info-iOS.plist&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                2684054218B85A630022C38B /* VisibleContentRectUpdateInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisibleContentRectUpdateInfo.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2684054518B85E7E0022C38B /* ViewUpdateDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ViewUpdateDispatcher.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2684054618B85E7E0022C38B /* ViewUpdateDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewUpdateDispatcher.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2684054818B85FF70022C38B /* ViewUpdateDispatcher.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ViewUpdateDispatcher.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2684054A18B866FF0022C38B /* VisibleContentRectUpdateInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisibleContentRectUpdateInfo.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2684055018B86ED60022C38B /* ViewUpdateDispatcherMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ViewUpdateDispatcherMessageReceiver.cpp; path = &quot;ViewUpdateDispatcherMessageReceiver.cpp&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2684055118B86ED60022C38B /* ViewUpdateDispatcherMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ViewUpdateDispatcherMessages.h; path = &quot;ViewUpdateDispatcherMessages.h&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 26F9A83A18A3463F00AEB88A /* WKWebViewPrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKWebViewPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 290F4271172A0C7400939FF0 /* ChildProcessSupplement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChildProcessSupplement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 293EBEA91627D9C9005F89F1 /* WKDOMText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDOMText.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -3957,6 +3970,8 @@
</span><span class="cx">                                 1AC1336518565B5700F3EC05 /* UserData.cpp */,
</span><span class="cx">                                 1AC1336618565B5700F3EC05 /* UserData.h */,
</span><span class="cx">                                 BCB0B0DF12305AB100B1341E /* UserMessageCoders.h */,
</span><ins>+                                2684054A18B866FF0022C38B /* VisibleContentRectUpdateInfo.cpp */,
+                                2684054218B85A630022C38B /* VisibleContentRectUpdateInfo.h */,
</ins><span class="cx">                                 1A0F29C9120B37160053D1B9 /* VisitedLinkTable.cpp */,
</span><span class="cx">                                 1A0F29CA120B37160053D1B9 /* VisitedLinkTable.h */,
</span><span class="cx">                                 BC329D9916ACCE9900316DE2 /* WebArchive.cpp */,
</span><span class="lines">@@ -5081,6 +5096,9 @@
</span><span class="cx">                                 2D819B99186275B3001F03D1 /* ViewGestureGeometryCollector.cpp */,
</span><span class="cx">                                 2D819B9A186275B3001F03D1 /* ViewGestureGeometryCollector.h */,
</span><span class="cx">                                 2D819B9B186275B3001F03D1 /* ViewGestureGeometryCollector.messages.in */,
</span><ins>+                                2684054518B85E7E0022C38B /* ViewUpdateDispatcher.cpp */,
+                                2684054618B85E7E0022C38B /* ViewUpdateDispatcher.h */,
+                                2684054818B85FF70022C38B /* ViewUpdateDispatcher.messages.in */,
</ins><span class="cx">                                 BC72B9F811E6476B001EB4EA /* WebBackForwardListProxy.cpp */,
</span><span class="cx">                                 BC72B9F911E6476B001EB4EA /* WebBackForwardListProxy.h */,
</span><span class="cx">                                 51871B59127CB89D00F76232 /* WebContextMenu.cpp */,
</span><span class="lines">@@ -6129,6 +6147,8 @@
</span><span class="cx">                                 1AB31A9516BC688100F6DBC9 /* StorageManagerMessages.h */,
</span><span class="cx">                                 2D1B5D5B185869C8006C6596 /* ViewGestureControllerMessageReceiver.cpp */,
</span><span class="cx">                                 2D1B5D5C185869C8006C6596 /* ViewGestureControllerMessages.h */,
</span><ins>+                                2684055018B86ED60022C38B /* ViewUpdateDispatcherMessageReceiver.cpp */,
+                                2684055118B86ED60022C38B /* ViewUpdateDispatcherMessages.h */,
</ins><span class="cx">                                 512E3568130B57F000ABD19A /* WebApplicationCacheManagerMessageReceiver.cpp */,
</span><span class="cx">                                 512E3569130B57F000ABD19A /* WebApplicationCacheManagerMessages.h */,
</span><span class="cx">                                 512E35F6130B642E00ABD19A /* WebApplicationCacheManagerProxyMessageReceiver.cpp */,
</span><span class="lines">@@ -6703,6 +6723,7 @@
</span><span class="cx">                                 51064D36189781C4004B2FEB /* SQLiteIDBCursor.h in Headers */,
</span><span class="cx">                                 BC032D7D10F4378D0058C15A /* WebEditorClient.h in Headers */,
</span><span class="cx">                                 0F5947A8187B517600437857 /* RemoteScrollingCoordinatorMessages.h in Headers */,
</span><ins>+                                2684055318B86ED60022C38B /* ViewUpdateDispatcherMessages.h in Headers */,
</ins><span class="cx">                                 516A4A5D120A2CCD00C05B7F /* APIError.h in Headers */,
</span><span class="cx">                                 1A433F0D113C53DD00FACDE9 /* WebErrors.h in Headers */,
</span><span class="cx">                                 BC032DB910F4380F0058C15A /* WebEvent.h in Headers */,
</span><span class="lines">@@ -6812,6 +6833,7 @@
</span><span class="cx">                                 BCE0E425168B7A280057E66A /* WebProcessSupplement.h in Headers */,
</span><span class="cx">                                 512F589D12A8838800629530 /* WebProtectionSpace.h in Headers */,
</span><span class="cx">                                 1AC1337218566C7C00F3EC05 /* APIFrameHandle.h in Headers */,
</span><ins>+                                2684054418B85A630022C38B /* VisibleContentRectUpdateInfo.h in Headers */,
</ins><span class="cx">                                 37948404150C350600E52CE9 /* WebRenderLayer.h in Headers */,
</span><span class="cx">                                 51E351F6180F5C7500E53BE9 /* WebIDBFactoryBackend.h in Headers */,
</span><span class="cx">                                 3760881F150413E900FC82C7 /* WebRenderObject.h in Headers */,
</span><span class="lines">@@ -7408,6 +7430,7 @@
</span><span class="cx">                         buildActionMask = 2147483647;
</span><span class="cx">                         files = (
</span><span class="cx">                                 E1D26A51175964D70095BFD1 /* WebContentProcess.xib in Resources */,
</span><ins>+                                2684054918B85FF70022C38B /* ViewUpdateDispatcher.messages.in in Resources */,
</ins><span class="cx">                                 E133FD8A1423DD7F00FC7BFB /* WebKit.icns in Resources */,
</span><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span><span class="lines">@@ -7848,6 +7871,7 @@
</span><span class="cx">                                 75E749E9180DBB9800088BA6 /* WebOriginDataManagerMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 BC204EE611C83EA9008F3375 /* InjectedBundleMac.mm in Sources */,
</span><span class="cx">                                 BC8147D612F66D31007B2C32 /* InjectedBundleNavigationAction.cpp in Sources */,
</span><ins>+                                2684054C18B86C350022C38B /* VisibleContentRectUpdateInfo.cpp in Sources */,
</ins><span class="cx">                                 BC4BEEAC120A0A5F00FBA0C7 /* InjectedBundleNodeHandle.cpp in Sources */,
</span><span class="cx">                                 512935E31288D97800A4B695 /* InjectedBundlePageContextMenuClient.cpp in Sources */,
</span><span class="cx">                                 CD67D30E15C08F9A00843ADF /* InjectedBundlePageDiagnosticLoggingClient.cpp in Sources */,
</span><span class="lines">@@ -8072,6 +8096,7 @@
</span><span class="cx">                                 BC82836516B354F600A278FE /* WebContentProcessMain.mm in Sources */,
</span><span class="cx">                                 2D125C5F1857EA05003BA3CB /* ViewGestureControllerMac.mm in Sources */,
</span><span class="cx">                                 BC82839916B48DC000A278FE /* WebContentServiceEntryPoint.mm in Sources */,
</span><ins>+                                2684054F18B86C8E0022C38B /* ViewUpdateDispatcher.cpp in Sources */,
</ins><span class="cx">                                 BCB9E2441120DACA00A137E0 /* WebContext.cpp in Sources */,
</span><span class="cx">                                 31A505F91680025500A930EB /* WebContextClient.cpp in Sources */,
</span><span class="cx">                                 BC09B8F8147460F7005F5625 /* WebContextConnectionClient.cpp in Sources */,
</span><span class="lines">@@ -8145,6 +8170,7 @@
</span><span class="cx">                                 BC0E607412D6BC200012A72A /* WebGeolocationPosition.cpp in Sources */,
</span><span class="cx">                                 BC1BE1F312D54DBD0004A228 /* WebGeolocationProvider.cpp in Sources */,
</span><span class="cx">                                 7801C099142290C400FAF9AF /* WebHitTestResult.cpp in Sources */,
</span><ins>+                                2684055218B86ED60022C38B /* ViewUpdateDispatcherMessageReceiver.cpp in Sources */,
</ins><span class="cx">                                 511B24AA132E097200065A0C /* WebIconDatabase.cpp in Sources */,
</span><span class="cx">                                 51834592134532E90092B696 /* WebIconDatabaseClient.cpp in Sources */,
</span><span class="cx">                                 51D02F64132EC5B900BEAA96 /* WebIconDatabaseMessageReceiver.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageViewUpdateDispatchercpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/WebProcess/WebPage/ViewUpdateDispatcher.cpp (0 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ViewUpdateDispatcher.cpp                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ViewUpdateDispatcher.cpp        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -0,0 +1,82 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;ViewUpdateDispatcher.h&quot;
+
+#if PLATFORM(IOS)
+
+#include &quot;ViewUpdateDispatcherMessages.h&quot;
+#include &quot;WebPage.h&quot;
+#include &quot;WebProcess.h&quot;
+#include &lt;wtf/RunLoop.h&gt;
+
+namespace WebKit {
+
+PassRef&lt;ViewUpdateDispatcher&gt; ViewUpdateDispatcher::create()
+{
+    return adoptRef(*new ViewUpdateDispatcher);
+}
+
+ViewUpdateDispatcher::ViewUpdateDispatcher()
+    : m_queue(WorkQueue::create(&quot;com.apple.WebKit.ViewUpdateDispatcher&quot;))
+{
+}
+
+ViewUpdateDispatcher::~ViewUpdateDispatcher()
+{
+}
+
+void ViewUpdateDispatcher::initializeConnection(IPC::Connection* connection)
+{
+    connection-&gt;addWorkQueueMessageReceiver(Messages::ViewUpdateDispatcher::messageReceiverName(), m_queue.get(), this);
+}
+
+void ViewUpdateDispatcher::visibleContentRectUpdate(uint64_t pageID, const VisibleContentRectUpdateInfo&amp; visibleContentRectUpdateInfo)
+{
+    {
+        MutexLocker locker(m_dataMutex);
+        m_latestUpdate.set(pageID, visibleContentRectUpdateInfo);
+    }
+    RunLoop::main()-&gt;dispatch(bind(&amp;ViewUpdateDispatcher::dispatchVisibleContentRectUpdate, this));
+}
+
+void ViewUpdateDispatcher::dispatchVisibleContentRectUpdate()
+{
+    HashMap&lt;uint64_t, VisibleContentRectUpdateInfo&gt; localCopy;
+    {
+        MutexLocker locker(m_dataMutex);
+        localCopy.swap(m_latestUpdate);
+    }
+
+    for (auto&amp; iterator : localCopy) {
+        if (WebPage* webPage = WebProcess::shared().webPage(iterator.key))
+            webPage-&gt;updateVisibleContentRects(iterator.value);
+    }
+}
+
+} // namespace WebKit
+
+#endif // PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageViewUpdateDispatcherh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/WebProcess/WebPage/ViewUpdateDispatcher.h (0 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ViewUpdateDispatcher.h                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ViewUpdateDispatcher.h        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -0,0 +1,60 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ViewUpdateDispatcher_h
+#define ViewUpdateDispatcher_h
+
+#include &quot;Connection.h&quot;
+
+#include &quot;VisibleContentRectUpdateInfo.h&quot;
+#include &lt;wtf/HashMap.h&gt;
+#include &lt;wtf/PassRef.h&gt;
+
+namespace WebKit {
+
+class ViewUpdateDispatcher : public IPC::Connection::WorkQueueMessageReceiver {
+public:
+    static PassRef&lt;ViewUpdateDispatcher&gt; create();
+    ~ViewUpdateDispatcher();
+
+    void initializeConnection(IPC::Connection*);
+
+private:
+    ViewUpdateDispatcher();
+    // IPC::Connection::WorkQueueMessageReceiver.
+    virtual void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&amp;) override;
+
+    void visibleContentRectUpdate(uint64_t pageID, const VisibleContentRectUpdateInfo&amp;);
+
+    void dispatchVisibleContentRectUpdate();
+
+    RefPtr&lt;WorkQueue&gt; m_queue;
+    Mutex m_dataMutex;
+    HashMap&lt;uint64_t, VisibleContentRectUpdateInfo&gt; m_latestUpdate;
+};
+
+} // namespace WebKit
+
+#endif // ViewportUpdateDispatcher_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageViewUpdateDispatchermessagesin"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/WebProcess/WebPage/ViewUpdateDispatcher.messages.in (0 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ViewUpdateDispatcher.messages.in                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ViewUpdateDispatcher.messages.in        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+# Copyright (C) 2014 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+messages -&gt; ViewUpdateDispatcher {
+    VisibleContentRectUpdate(uint64_t pageID, WebKit::VisibleContentRectUpdateInfo visibleContentRectUpdateInfo)
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (164701 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-02-26 07:35:10 UTC (rev 164701)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -284,6 +284,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     , m_shouldReturnWordAtSelection(false)
</span><ins>+    , m_scaleWasSetByUIProcess(false)
</ins><span class="cx">     , m_userHasChangedPageScaleFactor(false)
</span><span class="cx"> #endif
</span><span class="cx">     , m_inspectorClient(0)
</span><span class="lines">@@ -1259,6 +1260,12 @@
</span><span class="cx"> 
</span><span class="cx"> void WebPage::scalePage(double scale, const IntPoint&amp; origin)
</span><span class="cx"> {
</span><ins>+    if (scale == pageScaleFactor())
+        return;
+
+#if PLATFORM(IOS)
+    m_scaleWasSetByUIProcess = false;
+#endif
</ins><span class="cx">     PluginView* pluginView = pluginViewForFrame(&amp;m_page-&gt;mainFrame());
</span><span class="cx">     if (pluginView &amp;&amp; pluginView-&gt;handlesPageScaleFactor()) {
</span><span class="cx">         pluginView-&gt;setPageScaleFactor(scale, origin);
</span><span class="lines">@@ -2636,6 +2643,7 @@
</span><span class="cx">     layerTransaction.setPageScaleFactor(corePage()-&gt;pageScaleFactor());
</span><span class="cx">     layerTransaction.setRenderTreeSize(corePage()-&gt;renderTreeSize());
</span><span class="cx"> #if PLATFORM(IOS)
</span><ins>+    layerTransaction.setScaleWasSetByUIProcess(scaleWasSetByUIProcess());
</ins><span class="cx">     layerTransaction.setMinimumScaleFactor(minimumPageScaleFactor());
</span><span class="cx">     layerTransaction.setMaximumScaleFactor(maximumPageScaleFactor());
</span><span class="cx">     layerTransaction.setAllowsUserScaling(allowsUserScaling());
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (164701 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-02-26 07:35:10 UTC (rev 164701)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -143,6 +143,7 @@
</span><span class="cx"> class PageOverlay;
</span><span class="cx"> class PluginView;
</span><span class="cx"> class SessionState;
</span><ins>+class VisibleContentRectUpdateInfo;
</ins><span class="cx"> class WebColorChooser;
</span><span class="cx"> class WebContextMenu;
</span><span class="cx"> class WebContextMenuItemData;
</span><span class="lines">@@ -661,9 +662,9 @@
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     void setViewportConfigurationMinimumLayoutSize(const WebCore::IntSize&amp;);
</span><span class="cx">     void viewportConfigurationChanged();
</span><ins>+    void updateVisibleContentRects(const VisibleContentRectUpdateInfo&amp;);
+    bool scaleWasSetByUIProcess() const { return m_scaleWasSetByUIProcess; }
</ins><span class="cx">     void willStartUserTriggeredZooming();
</span><del>-    void didFinishScrolling(const WebCore::FloatPoint&amp; contentOffset);
-    void didFinishZooming(float);
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(GTK) &amp;&amp; USE(TEXTURE_MAPPER_GL)
</span><span class="lines">@@ -1094,6 +1095,7 @@
</span><span class="cx">     bool m_shouldReturnWordAtSelection;
</span><span class="cx"> 
</span><span class="cx">     WebCore::ViewportConfiguration m_viewportConfiguration;
</span><ins>+    bool m_scaleWasSetByUIProcess;
</ins><span class="cx">     bool m_userHasChangedPageScaleFactor;
</span><span class="cx">     WebCore::IntSize m_blockSelectionDesiredSize;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagemessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (164701 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2014-02-26 07:35:10 UTC (rev 164701)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -315,7 +315,6 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     WillStartUserTriggeredZooming();
</span><del>-    DidFinishZooming(float scale);
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(GTK) &amp;&amp; USE(TEXTURE_MAPPER_GL)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (164701 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-02-26 07:35:10 UTC (rev 164701)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012-2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -29,6 +29,8 @@
</span><span class="cx"> #import &quot;AssistedNodeInformation.h&quot;
</span><span class="cx"> #import &quot;EditorState.h&quot;
</span><span class="cx"> #import &quot;InteractionInformationAtPosition.h&quot;
</span><ins>+#import &quot;LayerTreeHost.h&quot;
+#import &quot;VisibleContentRectUpdateInfo.h&quot;
</ins><span class="cx"> #import &quot;WebChromeClient.h&quot;
</span><span class="cx"> #import &quot;WebCoreArgumentCoders.h&quot;
</span><span class="cx"> #import &quot;WebFrame.h&quot;
</span><span class="lines">@@ -1615,14 +1617,30 @@
</span><span class="cx">     scalePage(scale, m_page-&gt;mainFrame().view()-&gt;scrollPosition());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPage::willStartUserTriggeredZooming()
</del><ins>+void WebPage::updateVisibleContentRects(const VisibleContentRectUpdateInfo&amp; visibleContentRectUpdateInfo)
</ins><span class="cx"> {
</span><del>-    m_userHasChangedPageScaleFactor = true;
</del><ins>+    double boundedScale = std::min(m_viewportConfiguration.maximumScale(), std::max(m_viewportConfiguration.minimumScale(), visibleContentRectUpdateInfo.scale()));
+
+    IntPoint scrollPosition = roundedIntPoint(visibleContentRectUpdateInfo.unobscuredRect().location());
+
+    FloatRect exposedRect = visibleContentRectUpdateInfo.exposedRect();
+    exposedRect.scale(boundedScale);
+    m_drawingArea-&gt;setExposedRect(exposedRect);
+
+    if (boundedScale != m_page-&gt;pageScaleFactor()) {
+        m_scaleWasSetByUIProcess = true;
+        m_page-&gt;setPageScaleFactor(boundedScale, scrollPosition);
+        if (m_drawingArea-&gt;layerTreeHost())
+            m_drawingArea-&gt;layerTreeHost()-&gt;deviceOrPageScaleFactorChanged();
+        send(Messages::WebPageProxy::PageScaleFactorDidChange(boundedScale));
+    }
+
+    // FIXME: we should also update the frame view from unobscured rect. Altenatively, we can have it pull the values from ScrollView.
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPage::didFinishZooming(float newScale)
</del><ins>+void WebPage::willStartUserTriggeredZooming()
</ins><span class="cx"> {
</span><del>-    m_page-&gt;setPageScaleFactor(newScale, m_page-&gt;mainFrame().view()-&gt;scrollPosition());
</del><ins>+    m_userHasChangedPageScaleFactor = true;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeDrawingAreamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm (164701 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm        2014-02-26 07:35:10 UTC (rev 164701)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012-2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (164701 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2014-02-26 07:35:10 UTC (rev 164701)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -151,6 +151,9 @@
</span><span class="cx"> 
</span><span class="cx"> WebProcess::WebProcess()
</span><span class="cx">     : m_eventDispatcher(EventDispatcher::create())
</span><ins>+#if PLATFORM(IOS)
+    , m_viewUpdateDispatcher(ViewUpdateDispatcher::create())
+#endif // PLATFORM(IOS)
</ins><span class="cx">     , m_inDidClose(false)
</span><span class="cx">     , m_shouldTrackVisitedLinks(true)
</span><span class="cx">     , m_hasSetCacheModel(false)
</span><span class="lines">@@ -216,6 +219,9 @@
</span><span class="cx">     connection-&gt;setShouldExitOnSyncMessageSendFailure(true);
</span><span class="cx"> 
</span><span class="cx">     m_eventDispatcher-&gt;initializeConnection(connection);
</span><ins>+#if PLATFORM(IOS)
+    m_viewUpdateDispatcher-&gt;initializeConnection(connection);
+#endif // PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="cx">     m_pluginProcessConnectionManager-&gt;initializeConnection(connection);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.h (164701 => 164702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.h        2014-02-26 07:35:10 UTC (rev 164701)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.h        2014-02-26 07:43:31 UTC (rev 164702)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #include &quot;SandboxExtension.h&quot;
</span><span class="cx"> #include &quot;SharedMemory.h&quot;
</span><span class="cx"> #include &quot;TextCheckerState.h&quot;
</span><ins>+#include &quot;ViewUpdateDispatcher.h&quot;
</ins><span class="cx"> #include &quot;VisitedLinkTable.h&quot;
</span><span class="cx"> #include &lt;WebCore/LinkHash.h&gt;
</span><span class="cx"> #include &lt;WebCore/Timer.h&gt;
</span><span class="lines">@@ -279,6 +280,9 @@
</span><span class="cx">     RefPtr&lt;InjectedBundle&gt; m_injectedBundle;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;EventDispatcher&gt; m_eventDispatcher;
</span><ins>+#if PLATFORM(IOS)
+    RefPtr&lt;ViewUpdateDispatcher&gt; m_viewUpdateDispatcher;
+#endif
</ins><span class="cx"> 
</span><span class="cx">     bool m_inDidClose;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>