<!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>[167735] trunk/Source</title>
</head>
<body>

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

<h3>Log Message</h3>
<pre>[iOS][WK2] Fix a few mistakes affecting the initial layout and the initial unobscured rect
https://bugs.webkit.org/show_bug.cgi?id=132093

Source/WebCore: 

Patch by Benjamin Poulain &lt;bpoulain@apple.com&gt; on 2014-04-23
Reviewed by Tim Horton.

Change the minimum layout size to float point values to account for size defined on retina displays.
The minimum layout size supports half-pixels, the value is rounded later when computing the layout size
in document coordinates.

* WebCore.exp.in:
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::ViewportConfiguration):
Setting the initial content size is incorrect. The layout size computation already take into account
empty size for the first layout.

Setting the content size upfront make the first computation incorrect when the viewport arguments specify
the initial scale.

(WebCore::ViewportConfiguration::setMinimumLayoutSize):
* page/ViewportConfiguration.h:
(WebCore::ViewportConfiguration::minimumLayoutSize):

Source/WebKit2: 
&lt;rdar://problem/16703237&gt;

Patch by Benjamin Poulain &lt;bpoulain@apple.com&gt; on 2014-04-23
Reviewed by Tim Horton.

The user of WKWebView can setup a size on device pixels, which can add half a point to the minimum
layout size. By rounding this up before applying the page scale, we ended up with rounding errors
on the layout size and the transitory unobscured content rect.

This patch fixes changes the minimal layout size to float point values to reduce the rounding problems.

* UIProcess/API/Cocoa/WKWebView.mm:
(setViewportConfigurationMinimumLayoutSize):
(-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]):
(-[WKWebView _beginAnimatedResizeWithUpdates:]):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::dynamicViewportSizeUpdate):
(WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
(WebKit::WebPageProxy::setMinimumLayoutSizeForMinimalUI):

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didCommitLoad):
Defaulting the content size to the minimum layout size only works if the initial-scale is 1.
ViewportConfiguration knows exactly what to do before the first layout.

* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
(WebKit::WebPage::setMinimumLayoutSizeForMinimalUI):
(WebKit::WebPage::dynamicViewportSizeUpdate):
A few fixes here:
-setZoomedOutPageScaleFactor() was incorrectly using the initial scale. 99% of the time, initial scale
 and minimum scale are equal, but the page can specify something different with the viewport meta tag.
-Use floating point for manipulating the minimum layout sizes, then round the value.
-minimumLayoutSizeInDocumentCoordinate was scaled the wrong way around.

(WebKit::WebPage::viewportConfigurationChanged):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCorepageViewportConfigurationcpp">trunk/Source/WebCore/page/ViewportConfiguration.cpp</a></li>
<li><a href="#trunkSourceWebCorepageViewportConfigurationh">trunk/Source/WebCore/page/ViewportConfiguration.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm">trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm</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>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (167734 => 167735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-04-24 01:23:58 UTC (rev 167734)
+++ trunk/Source/WebCore/ChangeLog        2014-04-24 02:13:06 UTC (rev 167735)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2014-04-23  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
+
+        [iOS][WK2] Fix a few mistakes affecting the initial layout and the initial unobscured rect
+        https://bugs.webkit.org/show_bug.cgi?id=132093
+
+        Reviewed by Tim Horton.
+
+        Change the minimum layout size to float point values to account for size defined on retina displays.
+        The minimum layout size supports half-pixels, the value is rounded later when computing the layout size
+        in document coordinates.
+
+        * WebCore.exp.in:
+        * page/ViewportConfiguration.cpp:
+        (WebCore::ViewportConfiguration::ViewportConfiguration):
+        Setting the initial content size is incorrect. The layout size computation already take into account
+        empty size for the first layout.
+
+        Setting the content size upfront make the first computation incorrect when the viewport arguments specify
+        the initial scale.
+
+        (WebCore::ViewportConfiguration::setMinimumLayoutSize):
+        * page/ViewportConfiguration.h:
+        (WebCore::ViewportConfiguration::minimumLayoutSize):
+
</ins><span class="cx"> 2014-04-23  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Mac, iOS] Stop buffering media when on an inactive tab. 
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (167734 => 167735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-04-24 01:23:58 UTC (rev 167734)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-04-24 02:13:06 UTC (rev 167735)
</span><span class="lines">@@ -894,7 +894,7 @@
</span><span class="cx"> __ZN7WebCore21UserContentURLPattern5parseERKN3WTF6StringE
</span><span class="cx"> __ZN7WebCore21ViewportConfiguration15setContentsSizeERKNS_7IntSizeE
</span><span class="cx"> __ZN7WebCore21ViewportConfiguration17webpageParametersEv
</span><del>-__ZN7WebCore21ViewportConfiguration20setMinimumLayoutSizeERKNS_7IntSizeE
</del><ins>+__ZN7WebCore21ViewportConfiguration20setMinimumLayoutSizeERKNS_9FloatSizeE
</ins><span class="cx"> __ZN7WebCore21ViewportConfiguration20setViewportArgumentsERKNS_17ViewportArgumentsE
</span><span class="cx"> __ZN7WebCore21ViewportConfiguration21xhtmlMobileParametersEv
</span><span class="cx"> __ZN7WebCore21ViewportConfiguration22textDocumentParametersEv
</span></span></pre></div>
<a id="trunkSourceWebCorepageViewportConfigurationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/ViewportConfiguration.cpp (167734 => 167735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ViewportConfiguration.cpp        2014-04-24 01:23:58 UTC (rev 167734)
+++ trunk/Source/WebCore/page/ViewportConfiguration.cpp        2014-04-24 02:13:06 UTC (rev 167735)
</span><span class="lines">@@ -43,8 +43,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> ViewportConfiguration::ViewportConfiguration()
</span><del>-    : m_contentSize(1024, 768)
-    , m_minimumLayoutSize(m_contentSize)
</del><ins>+    : m_minimumLayoutSize(1024, 768)
</ins><span class="cx"> {
</span><span class="cx">     // Setup a reasonable default configuration to avoid computing infinite scale/sizes.
</span><span class="cx">     // Those are the original iPhone configuration.
</span><span class="lines">@@ -72,7 +71,7 @@
</span><span class="cx">     updateConfiguration();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ViewportConfiguration::setMinimumLayoutSize(const IntSize&amp; minimumLayoutSize)
</del><ins>+void ViewportConfiguration::setMinimumLayoutSize(const FloatSize&amp; minimumLayoutSize)
</ins><span class="cx"> {
</span><span class="cx">     if (m_minimumLayoutSize == minimumLayoutSize)
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCorepageViewportConfigurationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/ViewportConfiguration.h (167734 => 167735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ViewportConfiguration.h        2014-04-24 01:23:58 UTC (rev 167734)
+++ trunk/Source/WebCore/page/ViewportConfiguration.h        2014-04-24 02:13:06 UTC (rev 167735)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #ifndef ViewportConfiguration_h
</span><span class="cx"> #define ViewportConfiguration_h
</span><span class="cx"> 
</span><ins>+#include &quot;FloatSize.h&quot;
</ins><span class="cx"> #include &quot;IntSize.h&quot;
</span><span class="cx"> #include &quot;ViewportArguments.h&quot;
</span><span class="cx"> #include &lt;wtf/Noncopyable.h&gt;
</span><span class="lines">@@ -70,8 +71,8 @@
</span><span class="cx">     const IntSize&amp; contentsSize() const { return m_contentSize; }
</span><span class="cx">     void setContentsSize(const IntSize&amp;);
</span><span class="cx"> 
</span><del>-    const IntSize&amp; minimumLayoutSize() const { return m_minimumLayoutSize; }
-    void setMinimumLayoutSize(const IntSize&amp;);
</del><ins>+    const FloatSize&amp; minimumLayoutSize() const { return m_minimumLayoutSize; }
+    void setMinimumLayoutSize(const FloatSize&amp;);
</ins><span class="cx"> 
</span><span class="cx">     const ViewportArguments&amp; viewportArguments() const { return m_viewportArguments; }
</span><span class="cx">     void setViewportArguments(const ViewportArguments&amp;);
</span><span class="lines">@@ -95,7 +96,7 @@
</span><span class="cx">     Parameters m_configuration;
</span><span class="cx">     Parameters m_defaultConfiguration;
</span><span class="cx">     IntSize m_contentSize;
</span><del>-    IntSize m_minimumLayoutSize;
</del><ins>+    FloatSize m_minimumLayoutSize;
</ins><span class="cx">     ViewportArguments m_viewportArguments;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (167734 => 167735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-04-24 01:23:58 UTC (rev 167734)
+++ trunk/Source/WebKit2/ChangeLog        2014-04-24 02:13:06 UTC (rev 167735)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2014-04-23  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
+
+        [iOS][WK2] Fix a few mistakes affecting the initial layout and the initial unobscured rect
+        https://bugs.webkit.org/show_bug.cgi?id=132093
+        &lt;rdar://problem/16703237&gt;
+
+        Reviewed by Tim Horton.
+
+        The user of WKWebView can setup a size on device pixels, which can add half a point to the minimum
+        layout size. By rounding this up before applying the page scale, we ended up with rounding errors
+        on the layout size and the transitory unobscured content rect.
+
+        This patch fixes changes the minimal layout size to float point values to reduce the rounding problems.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (setViewportConfigurationMinimumLayoutSize):
+        (-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]):
+        (-[WKWebView _beginAnimatedResizeWithUpdates:]):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
+        (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
+        (WebKit::WebPageProxy::setMinimumLayoutSizeForMinimalUI):
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::didCommitLoad):
+        Defaulting the content size to the minimum layout size only works if the initial-scale is 1.
+        ViewportConfiguration knows exactly what to do before the first layout.
+
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
+        (WebKit::WebPage::setMinimumLayoutSizeForMinimalUI):
+        (WebKit::WebPage::dynamicViewportSizeUpdate):
+        A few fixes here:
+        -setZoomedOutPageScaleFactor() was incorrectly using the initial scale. 99% of the time, initial scale
+         and minimum scale are equal, but the page can specify something different with the viewport meta tag.
+        -Use floating point for manipulating the minimum layout sizes, then round the value.
+        -minimumLayoutSizeInDocumentCoordinate was scaled the wrong way around.
+
+        (WebKit::WebPage::viewportConfigurationChanged):
+
</ins><span class="cx"> 2014-04-23  Yongjun Zhang  &lt;yongjun_zhang@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Support encoding/decoding NSUInteger arguments in WKRemoteObjectCoder.
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (167734 => 167735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2014-04-24 01:23:58 UTC (rev 167734)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2014-04-24 02:13:06 UTC (rev 167735)
</span><span class="lines">@@ -720,7 +720,7 @@
</span><span class="cx"> 
</span><span class="cx"> static inline void setViewportConfigurationMinimumLayoutSize(WebKit::WebPageProxy&amp; page, const CGSize&amp; size)
</span><span class="cx"> {
</span><del>-    page.setViewportConfigurationMinimumLayoutSize(WebCore::IntSize(CGCeiling(size.width), CGCeiling(size.height)));
</del><ins>+    page.setViewportConfigurationMinimumLayoutSize(WebCore::FloatSize(size));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_frameOrBoundsChanged
</span><span class="lines">@@ -1279,7 +1279,7 @@
</span><span class="cx"> {
</span><span class="cx">     _minimumLayoutSizeOverrideForMinimalUI = size;
</span><span class="cx">     if (!_isAnimatingResize)
</span><del>-        _page-&gt;setMinimumLayoutSizeForMinimalUI(WebCore::IntSize(CGCeiling(size.width), CGCeiling(size.height)));
</del><ins>+        _page-&gt;setMinimumLayoutSizeForMinimalUI(WebCore::FloatSize(size));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (UIEdgeInsets)_obscuredInsets
</span><span class="lines">@@ -1393,7 +1393,7 @@
</span><span class="cx">     CGRect unobscuredRect = UIEdgeInsetsInsetRect(newBounds, _obscuredInsets);
</span><span class="cx">     CGRect unobscuredRectInContentCoordinates = [self convertRect:unobscuredRect toView:_contentView.get()];
</span><span class="cx"> 
</span><del>-    _page-&gt;dynamicViewportSizeUpdate(WebCore::IntSize(CGCeiling(newMinimumLayoutSize.width), CGCeiling(newMinimumLayoutSize.height)), visibleRectInContentCoordinates, unobscuredRectInContentCoordinates, targetScale);
</del><ins>+    _page-&gt;dynamicViewportSizeUpdate(WebCore::FloatSize(newMinimumLayoutSize.width, newMinimumLayoutSize.height), visibleRectInContentCoordinates, unobscuredRectInContentCoordinates, targetScale);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_endAnimatedResize
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (167734 => 167735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-04-24 01:23:58 UTC (rev 167734)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-04-24 02:13:06 UTC (rev 167735)
</span><span class="lines">@@ -576,10 +576,10 @@
</span><span class="cx">     uint64_t nextVisibleContentRectUpdateID() const { return m_lastVisibleContentRectUpdate.updateID() + 1; }
</span><span class="cx">     uint64_t lastVisibleContentRectUpdateID() const { return m_lastVisibleContentRectUpdate.updateID(); }
</span><span class="cx"> 
</span><del>-    void dynamicViewportSizeUpdate(const WebCore::IntSize&amp; minimumLayoutSize, const WebCore::FloatRect&amp; targetExposedContentRect, const WebCore::FloatRect&amp; targetUnobscuredRect, double targetScale);
</del><ins>+    void dynamicViewportSizeUpdate(const WebCore::FloatSize&amp; minimumLayoutSize, const WebCore::FloatRect&amp; targetExposedContentRect, const WebCore::FloatRect&amp; targetUnobscuredRect, double targetScale);
</ins><span class="cx">     
</span><del>-    void setViewportConfigurationMinimumLayoutSize(const WebCore::IntSize&amp;);
-    void setMinimumLayoutSizeForMinimalUI(const WebCore::IntSize&amp;);
</del><ins>+    void setViewportConfigurationMinimumLayoutSize(const WebCore::FloatSize&amp;);
+    void setMinimumLayoutSizeForMinimalUI(const WebCore::FloatSize&amp;);
</ins><span class="cx">     void didCommitLayerTree(const WebKit::RemoteLayerTreeTransaction&amp;);
</span><span class="cx"> 
</span><span class="cx">     void selectWithGesture(const WebCore::IntPoint, WebCore::TextGranularity, uint32_t gestureType, uint32_t gestureState, PassRefPtr&lt;GestureCallback&gt;);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (167734 => 167735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2014-04-24 01:23:58 UTC (rev 167734)
+++ trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2014-04-24 02:13:06 UTC (rev 167735)
</span><span class="lines">@@ -188,17 +188,17 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::dynamicViewportSizeUpdate(const IntSize&amp; minimumLayoutSize, const FloatRect&amp; targetExposedContentRect, const FloatRect&amp; targetUnobscuredRect, double targetScale)
</del><ins>+void WebPageProxy::dynamicViewportSizeUpdate(const FloatSize&amp; minimumLayoutSize, const FloatRect&amp; targetExposedContentRect, const FloatRect&amp; targetUnobscuredRect, double targetScale)
</ins><span class="cx"> {
</span><span class="cx">     m_process-&gt;send(Messages::WebPage::DynamicViewportSizeUpdate(minimumLayoutSize, targetExposedContentRect, targetUnobscuredRect, targetScale), m_pageID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::setViewportConfigurationMinimumLayoutSize(const WebCore::IntSize&amp; size)
</del><ins>+void WebPageProxy::setViewportConfigurationMinimumLayoutSize(const WebCore::FloatSize&amp; size)
</ins><span class="cx"> {
</span><span class="cx">     m_process-&gt;send(Messages::WebPage::SetViewportConfigurationMinimumLayoutSize(size), m_pageID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::setMinimumLayoutSizeForMinimalUI(const WebCore::IntSize&amp; size)
</del><ins>+void WebPageProxy::setMinimumLayoutSizeForMinimalUI(const WebCore::FloatSize&amp; size)
</ins><span class="cx"> {
</span><span class="cx">     m_process-&gt;send(Messages::WebPage::SetMinimumLayoutSizeForMinimalUI(size), m_pageID);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (167734 => 167735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-04-24 01:23:58 UTC (rev 167734)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-04-24 02:13:06 UTC (rev 167735)
</span><span class="lines">@@ -4263,7 +4263,7 @@
</span><span class="cx">         m_viewportConfiguration.setDefaultConfiguration(ViewportConfiguration::webpageParameters());
</span><span class="cx"> 
</span><span class="cx">     m_viewportConfiguration.setViewportArguments(ViewportArguments());
</span><del>-    m_viewportConfiguration.setContentsSize(m_viewportConfiguration.minimumLayoutSize());
</del><ins>+    m_viewportConfiguration.setContentsSize(IntSize());
</ins><span class="cx">     viewportConfigurationChanged();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (167734 => 167735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-04-24 01:23:58 UTC (rev 167734)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-04-24 02:13:06 UTC (rev 167735)
</span><span class="lines">@@ -695,9 +695,9 @@
</span><span class="cx">     void updateVisibilityState(bool isInitialState = false);
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-    void setViewportConfigurationMinimumLayoutSize(const WebCore::IntSize&amp;);
-    void setMinimumLayoutSizeForMinimalUI(const WebCore::IntSize&amp;);
-    void dynamicViewportSizeUpdate(const WebCore::IntSize&amp; minimumLayoutSize, const WebCore::FloatRect&amp; targetExposedContentRect, const WebCore::FloatRect&amp; targetUnobscuredRect, double scale);
</del><ins>+    void setViewportConfigurationMinimumLayoutSize(const WebCore::FloatSize&amp;);
+    void setMinimumLayoutSizeForMinimalUI(const WebCore::FloatSize&amp;);
+    void dynamicViewportSizeUpdate(const WebCore::FloatSize&amp; minimumLayoutSize, const WebCore::FloatRect&amp; targetExposedContentRect, const WebCore::FloatRect&amp; targetUnobscuredRect, double scale);
</ins><span class="cx">     void viewportConfigurationChanged();
</span><span class="cx">     void updateVisibleContentRects(const VisibleContentRectUpdateInfo&amp;);
</span><span class="cx">     bool scaleWasSetByUIProcess() const { return m_scaleWasSetByUIProcess; }
</span><span class="lines">@@ -1165,7 +1165,7 @@
</span><span class="cx">     WebCore::FloatSize m_screenSize;
</span><span class="cx">     WebCore::FloatSize m_availableScreenSize;
</span><span class="cx">     WebCore::IntSize m_blockSelectionDesiredSize;
</span><del>-    WebCore::IntSize m_minimumLayoutSizeForMinimalUI;
</del><ins>+    WebCore::FloatSize m_minimumLayoutSizeForMinimalUI;
</ins><span class="cx">     bool m_inDynamicSizeUpdate;
</span><span class="cx">     HashMap&lt;std::pair&lt;WebCore::IntSize, double&gt;, WebCore::IntPoint&gt; m_dynamicSizeUpdateHistory;
</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 (167734 => 167735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2014-04-24 01:23:58 UTC (rev 167734)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2014-04-24 02:13:06 UTC (rev 167735)
</span><span class="lines">@@ -43,9 +43,9 @@
</span><span class="cx">     MouseEventSyncForTesting(WebKit::WebMouseEvent event) -&gt; (bool handled)
</span><span class="cx">     WheelEventSyncForTesting(WebKit::WebWheelEvent event) -&gt; (bool handled)
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-    SetViewportConfigurationMinimumLayoutSize(WebCore::IntSize size)
-    SetMinimumLayoutSizeForMinimalUI(WebCore::IntSize size)
-    DynamicViewportSizeUpdate(WebCore::IntSize minimumLayoutSize, WebCore::FloatRect targetExposedContentRect, WebCore::FloatRect targetUnobscuredRect, double scale)
</del><ins>+    SetViewportConfigurationMinimumLayoutSize(WebCore::FloatSize size)
+    SetMinimumLayoutSizeForMinimalUI(WebCore::FloatSize size)
+    DynamicViewportSizeUpdate(WebCore::FloatSize minimumLayoutSize, WebCore::FloatRect targetExposedContentRect, WebCore::FloatRect targetUnobscuredRect, double scale)
</ins><span class="cx"> 
</span><span class="cx">     HandleTap(WebCore::IntPoint point)
</span><span class="cx">     TapHighlightAtPosition(uint64_t requestID, WebCore::FloatPoint point)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (167734 => 167735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-04-24 01:23:58 UTC (rev 167734)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-04-24 02:13:06 UTC (rev 167735)
</span><span class="lines">@@ -1759,19 +1759,19 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPage::setViewportConfigurationMinimumLayoutSize(const IntSize&amp; size)
</del><ins>+void WebPage::setViewportConfigurationMinimumLayoutSize(const FloatSize&amp; size)
</ins><span class="cx"> {
</span><span class="cx">     m_viewportConfiguration.setMinimumLayoutSize(size);
</span><span class="cx">     viewportConfigurationChanged();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPage::setMinimumLayoutSizeForMinimalUI(const IntSize&amp; size)
</del><ins>+void WebPage::setMinimumLayoutSizeForMinimalUI(const FloatSize&amp; size)
</ins><span class="cx"> {
</span><span class="cx">     m_minimumLayoutSizeForMinimalUI = size;
</span><span class="cx">     viewportConfigurationChanged();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPage::dynamicViewportSizeUpdate(const IntSize&amp; minimumLayoutSize, const FloatRect&amp; targetExposedContentRect, const FloatRect&amp; targetUnobscuredRect, double targetScale)
</del><ins>+void WebPage::dynamicViewportSizeUpdate(const FloatSize&amp; minimumLayoutSize, const FloatRect&amp; targetExposedContentRect, const FloatRect&amp; targetUnobscuredRect, double targetScale)
</ins><span class="cx"> {
</span><span class="cx">     TemporaryChange&lt;bool&gt; dynamicSizeUpdateGuard(m_inDynamicSizeUpdate, true);
</span><span class="cx">     // FIXME: this does not handle the cases where the content would change the content size or scroll position from JavaScript.
</span><span class="lines">@@ -1930,19 +1930,19 @@
</span><span class="cx">     else
</span><span class="cx">         scale = initialScale;
</span><span class="cx"> 
</span><del>-    m_page-&gt;setZoomedOutPageScaleFactor(initialScale);
-    
</del><ins>+    m_page-&gt;setZoomedOutPageScaleFactor(m_viewportConfiguration.minimumScale());
+
</ins><span class="cx">     FrameView&amp; frameView = *mainFrameView();
</span><del>-    IntSize viewportSize = !m_minimumLayoutSizeForMinimalUI.isEmpty() ? m_minimumLayoutSizeForMinimalUI : m_viewportConfiguration.minimumLayoutSize();
</del><ins>+    FloatSize viewportSize = !m_minimumLayoutSizeForMinimalUI.isEmpty() ? m_minimumLayoutSizeForMinimalUI : m_viewportConfiguration.minimumLayoutSize();
</ins><span class="cx">     viewportSize.scale(1 / initialScale);
</span><del>-    frameView.setViewportSize(viewportSize);
</del><ins>+    frameView.setViewportSize(roundedIntSize(viewportSize));
</ins><span class="cx">     
</span><span class="cx">     IntPoint scrollPosition = frameView.scrollPosition();
</span><span class="cx">     if (!m_hasReceivedVisibleContentRectsAfterDidCommitLoad) {
</span><del>-        IntSize minimumLayoutSizeInDocumentCoordinate = m_viewportConfiguration.minimumLayoutSize();
-        minimumLayoutSizeInDocumentCoordinate.scale(scale);
-
-        IntRect unobscuredContentRect(scrollPosition, minimumLayoutSizeInDocumentCoordinate);
</del><ins>+        FloatSize minimumLayoutSizeInScrollViewCoordinates = m_viewportConfiguration.minimumLayoutSize();
+        minimumLayoutSizeInScrollViewCoordinates.scale(1 / scale);
+        IntSize minimumLayoutSizeInDocumentCoordinates = roundedIntSize(minimumLayoutSizeInScrollViewCoordinates);
+        IntRect unobscuredContentRect(scrollPosition, minimumLayoutSizeInDocumentCoordinates);
</ins><span class="cx">         frameView.setUnobscuredContentRect(unobscuredContentRect);
</span><span class="cx">         frameView.setScrollVelocity(0, 0, 0, monotonicallyIncreasingTime());
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>