<!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>[169245] 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/169245">169245</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2014-05-22 21:13:19 -0700 (Thu, 22 May 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[iOS][WK2] Add support for minimal-ui viewports
https://bugs.webkit.org/show_bug.cgi?id=133162

Patch by Benjamin Poulain &lt;bpoulain@apple.com&gt; on 2014-05-22
Reviewed by Simon Fraser.


Source/WebCore: 
Add support for minimal-ui directly into the Viewport configuration.

ViewportConfiguration knows about two kinds of layout size in scrollview coordinates:
-normal size
-minimal ui size.

Initially, the page is initialized with resetMinimalUI() and starts with a normal layout.

At any time before the main resource is loaded, the Web page can update its viewport meta tag
to include minimal-ui. The viewport configuration is updated immediately to reflect the minimal-ui
layout size. Any layout after that takes minimal-ui into account.

* WebCore.exp.in:
* css/LengthFunctions.cpp:
(WebCore::minimumValueForLength):
(WebCore::floatValueForLength):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::viewportPercentageValue):
* dom/ViewportArguments.h:
(WebCore::ViewportArguments::operator==):
* page/FrameView.cpp:
(WebCore::FrameView::setViewportSizeForCSSViewportUnits):
(WebCore::FrameView::viewportSizeForCSSViewportUnits):
(WebCore::FrameView::setViewportSize): Deleted.
(WebCore::FrameView::viewportSize): Deleted.
* page/FrameView.h:
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::ViewportConfiguration):
(WebCore::ViewportConfiguration::setMinimumLayoutSize):
(WebCore::ViewportConfiguration::setMinimumLayoutSizeForMinimalUI):
(WebCore::ViewportConfiguration::activeMinimumLayoutSizeInScrollViewCoordinates):
(WebCore::ViewportConfiguration::resetMinimalUI):
(WebCore::ViewportConfiguration::pageWillRenderFirstFrame):
(WebCore::ViewportConfiguration::initialScale):
(WebCore::ViewportConfiguration::minimumScale):
(WebCore::ViewportConfiguration::updateConfiguration):
(WebCore::ViewportConfiguration::layoutWidth):
(WebCore::ViewportConfiguration::layoutHeight):
(WebCore::ViewportConfiguration::description):
* page/ViewportConfiguration.h:
(WebCore::ViewportConfiguration::minimumLayoutSizeForMinimalUI):
(WebCore::ViewportConfiguration::usesMinimalUI):
* rendering/RenderView.cpp:
(WebCore::RenderView::viewportSizeForCSSViewportUnits):
(WebCore::RenderView::viewportSize): Deleted.
* rendering/RenderView.h:

Source/WebKit2: 
In the WebKit2 layers, we have two parts to minimal-ui.
-In WebPage, we need to get the values from the UIProcess and setup the ViewportConfiguration.
 Another part is freezing the state on page load.
-In the UIProcess, we need to get the right information for layout and styling, and we need to tell
 the UI clients about minimal-ui changes.

* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setUsesMinimalUI:]):
(-[WKWebView _usesMinimalUI]):
(-[WKWebView _didCommitLayerTree:WebKit::]):
(-[WKWebView _frameOrBoundsChanged]):
(-[WKWebView _minimumLayoutSizeOverride]):
(-[WKWebView _setMinimumLayoutSizeOverride:]):
(-[WKWebView _minimumLayoutSizeOverrideForMinimalUI]):
(-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]):
(-[WKWebView _largestUnobscuredSizeOverride]):
(-[WKWebView _setMaximumUnobscuredSizeOverride:]):
(-[WKWebView _beginAnimatedResizeWithUpdates:]):
(setViewportConfigurationMinimumLayoutSize): Deleted.
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::setUsesMinimalUI):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::dynamicViewportSizeUpdate):
(WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSizeForMinimalUI):
(WebKit::WebPageProxy::setMaximumUnobscuredSize):
(WebKit::WebPageProxy::setUsesMinimalUI):
(WebKit::WebPageProxy::setMinimumLayoutSizeForMinimalUI): Deleted.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::WebPage::didCommitLoad):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::setViewportConfigurationMinimumLayoutSizeForMinimalUI):
(WebKit::WebPage::setMaximumUnobscuredSize):
(WebKit::WebPage::willFlushLayers):
(WebKit::WebPage::dynamicViewportSizeUpdate):
(WebKit::WebPage::viewportConfigurationChanged):
(WebKit::WebPage::updateViewportSizeForCSSViewportUnits):
(WebKit::WebPage::setMinimumLayoutSizeForMinimalUI): Deleted.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):</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="#trunkSourceWebCorecssLengthFunctionscpp">trunk/Source/WebCore/css/LengthFunctions.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolvercpp">trunk/Source/WebCore/css/StyleResolver.cpp</a></li>
<li><a href="#trunkSourceWebCoredomViewportArgumentsh">trunk/Source/WebCore/dom/ViewportArguments.h</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewh">trunk/Source/WebCore/page/FrameView.h</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="#trunkSourceWebCorerenderingRenderViewcpp">trunk/Source/WebCore/rendering/RenderView.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderViewh">trunk/Source/WebCore/rendering/RenderView.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKUIDelegatePrivateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewInternalh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewPrivateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessPageClienth">trunk/Source/WebKit2/UIProcess/PageClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxymessagesin">trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosPageClientImplIOSh">trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosPageClientImplIOSmm">trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm">trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp</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 (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebCore/ChangeLog        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -1,3 +1,57 @@
</span><ins>+2014-05-22  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
+
+        [iOS][WK2] Add support for minimal-ui viewports
+        https://bugs.webkit.org/show_bug.cgi?id=133162
+
+        Reviewed by Simon Fraser.
+
+        Add support for minimal-ui directly into the Viewport configuration.
+
+        ViewportConfiguration knows about two kinds of layout size in scrollview coordinates:
+        -normal size
+        -minimal ui size.
+
+        Initially, the page is initialized with resetMinimalUI() and starts with a normal layout.
+
+        At any time before the main resource is loaded, the Web page can update its viewport meta tag
+        to include minimal-ui. The viewport configuration is updated immediately to reflect the minimal-ui
+        layout size. Any layout after that takes minimal-ui into account.
+
+        * WebCore.exp.in:
+        * css/LengthFunctions.cpp:
+        (WebCore::minimumValueForLength):
+        (WebCore::floatValueForLength):
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::viewportPercentageValue):
+        * dom/ViewportArguments.h:
+        (WebCore::ViewportArguments::operator==):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::setViewportSizeForCSSViewportUnits):
+        (WebCore::FrameView::viewportSizeForCSSViewportUnits):
+        (WebCore::FrameView::setViewportSize): Deleted.
+        (WebCore::FrameView::viewportSize): Deleted.
+        * page/FrameView.h:
+        * page/ViewportConfiguration.cpp:
+        (WebCore::ViewportConfiguration::ViewportConfiguration):
+        (WebCore::ViewportConfiguration::setMinimumLayoutSize):
+        (WebCore::ViewportConfiguration::setMinimumLayoutSizeForMinimalUI):
+        (WebCore::ViewportConfiguration::activeMinimumLayoutSizeInScrollViewCoordinates):
+        (WebCore::ViewportConfiguration::resetMinimalUI):
+        (WebCore::ViewportConfiguration::pageWillRenderFirstFrame):
+        (WebCore::ViewportConfiguration::initialScale):
+        (WebCore::ViewportConfiguration::minimumScale):
+        (WebCore::ViewportConfiguration::updateConfiguration):
+        (WebCore::ViewportConfiguration::layoutWidth):
+        (WebCore::ViewportConfiguration::layoutHeight):
+        (WebCore::ViewportConfiguration::description):
+        * page/ViewportConfiguration.h:
+        (WebCore::ViewportConfiguration::minimumLayoutSizeForMinimalUI):
+        (WebCore::ViewportConfiguration::usesMinimalUI):
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::viewportSizeForCSSViewportUnits):
+        (WebCore::RenderView::viewportSize): Deleted.
+        * rendering/RenderView.h:
+
</ins><span class="cx"> 2014-05-22  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Can't type in status in facebook.com on iOS Safari because keyboard disappears
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -908,14 +908,17 @@
</span><span class="cx"> __ZN7WebCore21UserContentController6createEv
</span><span class="cx"> __ZN7WebCore21UserContentControllerD1Ev
</span><span class="cx"> __ZN7WebCore21UserContentURLPattern5parseERKN3WTF6StringE
</span><ins>+__ZN7WebCore21ViewportConfiguration14resetMinimalUIEv
</ins><span class="cx"> __ZN7WebCore21ViewportConfiguration15setContentsSizeERKNS_7IntSizeE
</span><span class="cx"> __ZN7WebCore21ViewportConfiguration17webpageParametersEv
</span><span class="cx"> __ZN7WebCore21ViewportConfiguration20setMinimumLayoutSizeERKNS_9FloatSizeE
</span><span class="cx"> __ZN7WebCore21ViewportConfiguration20setViewportArgumentsERKNS_17ViewportArgumentsE
</span><ins>+__ZN7WebCore21ViewportConfiguration21didFinishDocumentLoadEv
</ins><span class="cx"> __ZN7WebCore21ViewportConfiguration21xhtmlMobileParametersEv
</span><span class="cx"> __ZN7WebCore21ViewportConfiguration22textDocumentParametersEv
</span><span class="cx"> __ZN7WebCore21ViewportConfiguration23imageDocumentParametersEv
</span><span class="cx"> __ZN7WebCore21ViewportConfiguration23setDefaultConfigurationERKNS0_10ParametersE
</span><ins>+__ZN7WebCore21ViewportConfiguration32setMinimumLayoutSizeForMinimalUIERKNS_9FloatSizeE
</ins><span class="cx"> __ZN7WebCore21ViewportConfigurationC1Ev
</span><span class="cx"> __ZN7WebCore21WindowsLatin1EncodingEv
</span><span class="cx"> __ZN7WebCore21createCFURLFromBufferEPKcmPK7__CFURL
</span><span class="lines">@@ -1363,7 +1366,6 @@
</span><span class="cx"> __ZN7WebCore9FrameView14setTransparentEb
</span><span class="cx"> __ZN7WebCore9FrameView15setFooterHeightEi
</span><span class="cx"> __ZN7WebCore9FrameView15setHeaderHeightEi
</span><del>-__ZN7WebCore9FrameView15setViewportSizeENS_7IntSizeE
</del><span class="cx"> __ZN7WebCore9FrameView16setPaintBehaviorEj
</span><span class="cx"> __ZN7WebCore9FrameView17addScrollableAreaEPNS_14ScrollableAreaE
</span><span class="cx"> __ZN7WebCore9FrameView17paintControlTintsEv
</span><span class="lines">@@ -1388,6 +1390,7 @@
</span><span class="cx"> __ZN7WebCore9FrameView29setAutoSizeFixedMinimumHeightEi
</span><span class="cx"> __ZN7WebCore9FrameView29setShouldUpdateWhileOffscreenEb
</span><span class="cx"> __ZN7WebCore9FrameView31setVisualUpdatesAllowedByClientEb
</span><ins>+__ZN7WebCore9FrameView34setViewportSizeForCSSViewportUnitsENS_7IntSizeE
</ins><span class="cx"> __ZN7WebCore9FrameView37setScrollingPerformanceLoggingEnabledEb
</span><span class="cx"> __ZN7WebCore9FrameView37updateLayoutAndStyleIfNeededRecursiveEv
</span><span class="cx"> __ZN7WebCore9FrameView38scrollPositionChangedViaPlatformWidgetERKNS_8IntPointES3_
</span><span class="lines">@@ -1795,6 +1798,7 @@
</span><span class="cx"> __ZNK7WebCore21ViewportConfiguration10layoutSizeEv
</span><span class="cx"> __ZNK7WebCore21ViewportConfiguration12initialScaleEv
</span><span class="cx"> __ZNK7WebCore21ViewportConfiguration12minimumScaleEv
</span><ins>+__ZNK7WebCore21ViewportConfiguration46activeMinimumLayoutSizeInScrollViewCoordinatesEv
</ins><span class="cx"> __ZNK7WebCore22WheelEventDeltaTracker30dominantScrollGestureDirectionEv
</span><span class="cx"> __ZNK7WebCore23ApplicationCacheStorage11maximumSizeEv
</span><span class="cx"> __ZNK7WebCore23AuthenticationChallenge20authenticationClientEv
</span></span></pre></div>
<a id="trunkSourceWebCorecssLengthFunctionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/LengthFunctions.cpp (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/LengthFunctions.cpp        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebCore/css/LengthFunctions.cpp        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -54,21 +54,21 @@
</span><span class="cx">         return length.nonNanCalculatedValue(maximumValue);
</span><span class="cx">     case ViewportPercentageWidth:
</span><span class="cx">         if (renderView)
</span><del>-            return LayoutUnit(renderView-&gt;viewportSize().width() * length.viewportPercentageLength() / 100.0f);
</del><ins>+            return LayoutUnit(renderView-&gt;viewportSizeForCSSViewportUnits().width() * length.viewportPercentageLength() / 100.0f);
</ins><span class="cx">         return 0;
</span><span class="cx">     case ViewportPercentageHeight:
</span><span class="cx">         if (renderView)
</span><del>-            return LayoutUnit(renderView-&gt;viewportSize().height() * length.viewportPercentageLength() / 100.0f);
</del><ins>+            return LayoutUnit(renderView-&gt;viewportSizeForCSSViewportUnits().height() * length.viewportPercentageLength() / 100.0f);
</ins><span class="cx">         return 0;
</span><span class="cx">     case ViewportPercentageMin:
</span><span class="cx">         if (renderView) {
</span><del>-            IntSize viewportSize = renderView-&gt;viewportSize();
</del><ins>+            IntSize viewportSize = renderView-&gt;viewportSizeForCSSViewportUnits();
</ins><span class="cx">             return LayoutUnit(std::min(viewportSize.width(), viewportSize.height()) * length.viewportPercentageLength() / 100.0f);
</span><span class="cx">         }
</span><span class="cx">         return 0;
</span><span class="cx">     case ViewportPercentageMax:
</span><span class="cx">         if (renderView) {
</span><del>-            IntSize viewportSize = renderView-&gt;viewportSize();
</del><ins>+            IntSize viewportSize = renderView-&gt;viewportSizeForCSSViewportUnits();
</ins><span class="cx">             return LayoutUnit(std::max(viewportSize.width(), viewportSize.height()) * length.viewportPercentageLength() / 100.0f);
</span><span class="cx">         }
</span><span class="cx">         return 0;
</span><span class="lines">@@ -132,21 +132,21 @@
</span><span class="cx">         return length.nonNanCalculatedValue(maximumValue);                
</span><span class="cx">     case ViewportPercentageWidth:
</span><span class="cx">         if (renderView)
</span><del>-            return static_cast&lt;int&gt;(renderView-&gt;viewportSize().width() * length.viewportPercentageLength() / 100.0f);
</del><ins>+            return static_cast&lt;int&gt;(renderView-&gt;viewportSizeForCSSViewportUnits().width() * length.viewportPercentageLength() / 100.0f);
</ins><span class="cx">         return 0;
</span><span class="cx">     case ViewportPercentageHeight:
</span><span class="cx">         if (renderView)
</span><del>-            return static_cast&lt;int&gt;(renderView-&gt;viewportSize().height() * length.viewportPercentageLength() / 100.0f);
</del><ins>+            return static_cast&lt;int&gt;(renderView-&gt;viewportSizeForCSSViewportUnits().height() * length.viewportPercentageLength() / 100.0f);
</ins><span class="cx">         return 0;
</span><span class="cx">     case ViewportPercentageMin:
</span><span class="cx">         if (renderView) {
</span><del>-            IntSize viewportSize = renderView-&gt;viewportSize();
</del><ins>+            IntSize viewportSize = renderView-&gt;viewportSizeForCSSViewportUnits();
</ins><span class="cx">             return static_cast&lt;int&gt;(std::min(viewportSize.width(), viewportSize.height()) * length.viewportPercentageLength() / 100.0f);
</span><span class="cx">         }
</span><span class="cx">         return 0;
</span><span class="cx">     case ViewportPercentageMax:
</span><span class="cx">         if (renderView) {
</span><del>-            IntSize viewportSize = renderView-&gt;viewportSize();
</del><ins>+            IntSize viewportSize = renderView-&gt;viewportSizeForCSSViewportUnits();
</ins><span class="cx">             return static_cast&lt;int&gt;(std::max(viewportSize.width(), viewportSize.height()) * length.viewportPercentageLength() / 100.0f);
</span><span class="cx">         }
</span><span class="cx">         return 0;
</span><span class="lines">@@ -178,21 +178,21 @@
</span><span class="cx">         return length.nonNanCalculatedValue(maximumValue);
</span><span class="cx">     case ViewportPercentageWidth:
</span><span class="cx">         if (renderView)
</span><del>-            return static_cast&lt;int&gt;(renderView-&gt;viewportSize().width() * length.viewportPercentageLength() / 100.0f);
</del><ins>+            return static_cast&lt;int&gt;(renderView-&gt;viewportSizeForCSSViewportUnits().width() * length.viewportPercentageLength() / 100.0f);
</ins><span class="cx">         return 0;
</span><span class="cx">     case ViewportPercentageHeight:
</span><span class="cx">         if (renderView)
</span><del>-            return static_cast&lt;int&gt;(renderView-&gt;viewportSize().height() * length.viewportPercentageLength() / 100.0f);
</del><ins>+            return static_cast&lt;int&gt;(renderView-&gt;viewportSizeForCSSViewportUnits().height() * length.viewportPercentageLength() / 100.0f);
</ins><span class="cx">         return 0;
</span><span class="cx">     case ViewportPercentageMin:
</span><span class="cx">         if (renderView) {
</span><del>-            IntSize viewportSize = renderView-&gt;viewportSize();
</del><ins>+            IntSize viewportSize = renderView-&gt;viewportSizeForCSSViewportUnits();
</ins><span class="cx">             return static_cast&lt;int&gt;(std::min(viewportSize.width(), viewportSize.height()) * length.viewportPercentageLength() / 100.0f);
</span><span class="cx">         }
</span><span class="cx">         return 0;
</span><span class="cx">     case ViewportPercentageMax:
</span><span class="cx">         if (renderView) {
</span><del>-            IntSize viewportSize = renderView-&gt;viewportSize();
</del><ins>+            IntSize viewportSize = renderView-&gt;viewportSizeForCSSViewportUnits();
</ins><span class="cx">             return static_cast&lt;int&gt;(std::max(viewportSize.width(), viewportSize.height()) * length.viewportPercentageLength() / 100.0f);
</span><span class="cx">         }
</span><span class="cx">         return 0;
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.cpp (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.cpp        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebCore/css/StyleResolver.cpp        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -3616,8 +3616,8 @@
</span><span class="cx"> 
</span><span class="cx"> int StyleResolver::viewportPercentageValue(CSSPrimitiveValue&amp; unit, int percentage)
</span><span class="cx"> {
</span><del>-    int viewPortHeight = document().renderView()-&gt;viewportSize().height() * percentage / 100.0f;
-    int viewPortWidth = document().renderView()-&gt;viewportSize().width() * percentage / 100.0f;
</del><ins>+    int viewPortHeight = document().renderView()-&gt;viewportSizeForCSSViewportUnits().height() * percentage / 100.0f;
+    int viewPortWidth = document().renderView()-&gt;viewportSizeForCSSViewportUnits().width() * percentage / 100.0f;
</ins><span class="cx"> 
</span><span class="cx">     if (unit.isViewportPercentageHeight())
</span><span class="cx">         return viewPortHeight;
</span></span></pre></div>
<a id="trunkSourceWebCoredomViewportArgumentsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ViewportArguments.h (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ViewportArguments.h        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebCore/dom/ViewportArguments.h        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -115,10 +115,6 @@
</span><span class="cx">     {
</span><span class="cx">         // Used for figuring out whether to reset the viewport or not,
</span><span class="cx">         // thus we are not taking type into account.
</span><del>-#if PLATFORM(IOS)
-        // We ignore minimalUI for the same reason -- it is a higher-level
-        // property that doesn't affect the actual viewport.
-#endif
</del><span class="cx">         return width == other.width
</span><span class="cx">             &amp;&amp; minWidth == other.minWidth
</span><span class="cx">             &amp;&amp; maxWidth == other.maxWidth
</span><span class="lines">@@ -129,6 +125,9 @@
</span><span class="cx">             &amp;&amp; minZoom == other.minZoom
</span><span class="cx">             &amp;&amp; maxZoom == other.maxZoom
</span><span class="cx">             &amp;&amp; userZoom == other.userZoom
</span><ins>+#if PLATFORM(IOS)
+            &amp;&amp; minimalUI == other.minimalUI
+#endif
</ins><span class="cx">             &amp;&amp; orientation == other.orientation;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebCore/page/FrameView.cpp        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -4398,7 +4398,7 @@
</span><span class="cx">         view-&gt;compositor().scheduleLayerFlush(false /* canThrottle */);
</span><span class="cx"> }
</span><span class="cx">     
</span><del>-void FrameView::setViewportSize(IntSize size)
</del><ins>+void FrameView::setViewportSizeForCSSViewportUnits(IntSize size)
</ins><span class="cx"> {
</span><span class="cx">     if (m_hasOverrideViewportSize &amp;&amp; m_overrideViewportSize == size)
</span><span class="cx">         return;
</span><span class="lines">@@ -4410,7 +4410,7 @@
</span><span class="cx">         document-&gt;styleResolverChanged(DeferRecalcStyle);
</span><span class="cx"> }
</span><span class="cx">     
</span><del>-IntSize FrameView::viewportSize() const
</del><ins>+IntSize FrameView::viewportSizeForCSSViewportUnits() const
</ins><span class="cx"> {
</span><span class="cx">     if (m_hasOverrideViewportSize)
</span><span class="cx">         return m_overrideViewportSize;
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.h (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.h        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebCore/page/FrameView.h        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -220,8 +220,8 @@
</span><span class="cx"> 
</span><span class="cx">     void adjustViewSize();
</span><span class="cx">     
</span><del>-    void setViewportSize(IntSize);
-    IntSize viewportSize() const;
</del><ins>+    void setViewportSizeForCSSViewportUnits(IntSize);
+    IntSize viewportSizeForCSSViewportUnits() const;
</ins><span class="cx">     
</span><span class="cx">     virtual IntRect windowClipRect(bool clipToContents = true) const override;
</span><span class="cx">     IntRect windowClipRectForFrameOwner(const HTMLFrameOwnerElement*, bool clipToLayerContents) const;
</span></span></pre></div>
<a id="trunkSourceWebCorepageViewportConfigurationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/ViewportConfiguration.cpp (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ViewportConfiguration.cpp        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebCore/page/ViewportConfiguration.cpp        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -46,6 +46,9 @@
</span><span class="cx"> 
</span><span class="cx"> ViewportConfiguration::ViewportConfiguration()
</span><span class="cx">     : m_minimumLayoutSize(1024, 768)
</span><ins>+    , m_minimumLayoutSizeForMinimalUI(m_minimumLayoutSize)
+    , m_usesMinimalUI(false)
+    , m_pageDidFinishDocumentLoad(false)
</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">@@ -79,9 +82,23 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     m_minimumLayoutSize = minimumLayoutSize;
</span><del>-    updateConfiguration();
</del><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ViewportConfiguration::setMinimumLayoutSizeForMinimalUI(const FloatSize&amp; minimumLayoutSizeForMinimalUI)
+{
+    if (m_minimumLayoutSizeForMinimalUI == minimumLayoutSizeForMinimalUI)
+        return;
+
+    m_minimumLayoutSizeForMinimalUI = minimumLayoutSizeForMinimalUI;
+}
+
+const FloatSize&amp; ViewportConfiguration::activeMinimumLayoutSizeInScrollViewCoordinates() const
+{
+    if (m_usesMinimalUI)
+        return m_minimumLayoutSizeForMinimalUI;
+    return m_minimumLayoutSize;
+}
+
</ins><span class="cx"> void ViewportConfiguration::setViewportArguments(const ViewportArguments&amp; viewportArguments)
</span><span class="cx"> {
</span><span class="cx">     if (m_viewportArguments == viewportArguments)
</span><span class="lines">@@ -91,6 +108,17 @@
</span><span class="cx">     updateConfiguration();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ViewportConfiguration::resetMinimalUI()
+{
+    m_usesMinimalUI = false;
+    m_pageDidFinishDocumentLoad = false;
+}
+
+void ViewportConfiguration::didFinishDocumentLoad()
+{
+    m_pageDidFinishDocumentLoad = true;
+}
+
</ins><span class="cx"> IntSize ViewportConfiguration::layoutSize() const
</span><span class="cx"> {
</span><span class="cx">     return IntSize(layoutWidth(), layoutHeight());
</span><span class="lines">@@ -107,15 +135,16 @@
</span><span class="cx"> 
</span><span class="cx">     // If not, it is up to us to determine the initial scale.
</span><span class="cx">     // We want a scale small enough to fit the document width-wise.
</span><ins>+    const FloatSize&amp; minimumLayoutSize = activeMinimumLayoutSizeInScrollViewCoordinates();
</ins><span class="cx">     double width = m_contentSize.width() &gt; 0 ? m_contentSize.width() : layoutWidth();
</span><span class="cx">     double initialScale = 0;
</span><span class="cx">     if (width &gt; 0)
</span><del>-        initialScale = m_minimumLayoutSize.width() / width;
</del><ins>+        initialScale = minimumLayoutSize.width() / width;
</ins><span class="cx"> 
</span><span class="cx">     // Prevent the intial scale from shrinking to a height smaller than our view's minimum height.
</span><span class="cx">     double height = m_contentSize.height() &gt; 0 ? m_contentSize.height() : layoutHeight();
</span><del>-    if (height &gt; 0 &amp;&amp; height * initialScale &lt; m_minimumLayoutSize.height())
-        initialScale = m_minimumLayoutSize.height() / height;
</del><ins>+    if (height &gt; 0 &amp;&amp; height * initialScale &lt; minimumLayoutSize.height())
+        initialScale = minimumLayoutSize.height() / height;
</ins><span class="cx">     return std::min(std::max(initialScale, m_configuration.minimumScale), m_configuration.maximumScale);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -128,13 +157,14 @@
</span><span class="cx">     // If not, we still need to sanity check our value.
</span><span class="cx">     double minimumScale = m_configuration.minimumScale;
</span><span class="cx"> 
</span><ins>+    const FloatSize&amp; minimumLayoutSize = activeMinimumLayoutSizeInScrollViewCoordinates();
</ins><span class="cx">     double contentWidth = m_contentSize.width();
</span><del>-    if (contentWidth &gt; 0 &amp;&amp; contentWidth * minimumScale &lt; m_minimumLayoutSize.width())
-        minimumScale = m_minimumLayoutSize.width() / contentWidth;
</del><ins>+    if (contentWidth &gt; 0 &amp;&amp; contentWidth * minimumScale &lt; minimumLayoutSize.width())
+        minimumScale = minimumLayoutSize.width() / contentWidth;
</ins><span class="cx"> 
</span><span class="cx">     double contentHeight = m_contentSize.height();
</span><del>-    if (contentHeight &gt; 0 &amp;&amp; contentHeight * minimumScale &lt; m_minimumLayoutSize.height())
-        minimumScale = m_minimumLayoutSize.height() / contentHeight;
</del><ins>+    if (contentHeight &gt; 0 &amp;&amp; contentHeight * minimumScale &lt; minimumLayoutSize.height())
+        minimumScale = minimumLayoutSize.height() / contentHeight;
</ins><span class="cx"> 
</span><span class="cx">     minimumScale = std::min(std::max(minimumScale, m_configuration.minimumScale), m_configuration.maximumScale);
</span><span class="cx"> 
</span><span class="lines">@@ -243,76 +273,83 @@
</span><span class="cx"> 
</span><span class="cx">     if (viewportArgumentUserZoomIsSet(m_viewportArguments.userZoom))
</span><span class="cx">         m_configuration.allowsUserScaling = m_viewportArguments.userZoom != 0.;
</span><ins>+
+#if PLATFORM(IOS)
+    if (!m_pageDidFinishDocumentLoad)
+        m_usesMinimalUI = m_usesMinimalUI || m_viewportArguments.minimalUI;
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int ViewportConfiguration::layoutWidth() const
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!constraintsAreAllRelative(m_configuration));
</span><span class="cx"> 
</span><ins>+    const FloatSize&amp; minimumLayoutSize = activeMinimumLayoutSizeInScrollViewCoordinates();
</ins><span class="cx">     if (m_configuration.widthIsSet) {
</span><span class="cx">         // If we scale to fit, then accept the viewport width with sanity checking.
</span><span class="cx">         if (!m_configuration.initialScaleIsSet) {
</span><span class="cx">             double maximumScale = this-&gt;maximumScale();
</span><span class="cx">             double maximumContentWidthInViewportCoordinate = maximumScale * m_configuration.width;
</span><del>-            if (maximumContentWidthInViewportCoordinate &lt; m_minimumLayoutSize.width()) {
</del><ins>+            if (maximumContentWidthInViewportCoordinate &lt; minimumLayoutSize.width()) {
</ins><span class="cx">                 // The content zoomed to maxScale does not fit the the view. Return the minimum width
</span><span class="cx">                 // satisfying the constraint maximumScale.
</span><del>-                return std::round(m_minimumLayoutSize.width() / maximumScale);
</del><ins>+                return std::round(minimumLayoutSize.width() / maximumScale);
</ins><span class="cx">             }
</span><span class="cx">             return std::round(m_configuration.width);
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // If not, make sure the viewport width and initial scale can co-exist.
</span><span class="cx">         double initialContentWidthInViewportCoordinate = m_configuration.width * m_configuration.initialScale;
</span><del>-        if (initialContentWidthInViewportCoordinate &lt; m_minimumLayoutSize.width()) {
</del><ins>+        if (initialContentWidthInViewportCoordinate &lt; minimumLayoutSize.width()) {
</ins><span class="cx">             // The specified width does not fit in viewport. Return the minimum width that satisfy the initialScale constraint.
</span><del>-            return std::round(m_minimumLayoutSize.width() / m_configuration.initialScale);
</del><ins>+            return std::round(minimumLayoutSize.width() / m_configuration.initialScale);
</ins><span class="cx">         }
</span><span class="cx">         return std::round(m_configuration.width);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // If the page has a real scale, then just return the minimum size over the initial scale.
</span><span class="cx">     if (m_configuration.initialScaleIsSet &amp;&amp; !m_configuration.heightIsSet)
</span><del>-        return std::round(m_minimumLayoutSize.width() / m_configuration.initialScale);
</del><ins>+        return std::round(minimumLayoutSize.width() / m_configuration.initialScale);
</ins><span class="cx"> 
</span><del>-    if (m_minimumLayoutSize.height() &gt; 0)
-        return std::round(m_minimumLayoutSize.width() * layoutHeight() / m_minimumLayoutSize.height());
-    return m_minimumLayoutSize.width();
</del><ins>+    if (minimumLayoutSize.height() &gt; 0)
+        return std::round(minimumLayoutSize.width() * layoutHeight() / minimumLayoutSize.height());
+    return minimumLayoutSize.width();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int ViewportConfiguration::layoutHeight() const
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!constraintsAreAllRelative(m_configuration));
</span><span class="cx"> 
</span><ins>+    const FloatSize&amp; minimumLayoutSize = activeMinimumLayoutSizeInScrollViewCoordinates();
</ins><span class="cx">     if (m_configuration.heightIsSet) {
</span><span class="cx">         // If we scale to fit, then accept the viewport height with sanity checking.
</span><span class="cx">         if (!m_configuration.initialScaleIsSet) {
</span><span class="cx">             double maximumScale = this-&gt;maximumScale();
</span><span class="cx">             double maximumContentHeightInViewportCoordinate = maximumScale * m_configuration.height;
</span><del>-            if (maximumContentHeightInViewportCoordinate &lt; m_minimumLayoutSize.height()) {
</del><ins>+            if (maximumContentHeightInViewportCoordinate &lt; minimumLayoutSize.height()) {
</ins><span class="cx">                 // The content zoomed to maxScale does not fit the the view. Return the minimum height that
</span><span class="cx">                 // satisfy the constraint maximumScale.
</span><del>-                return std::round(m_minimumLayoutSize.height() / maximumScale);
</del><ins>+                return std::round(minimumLayoutSize.height() / maximumScale);
</ins><span class="cx">             }
</span><span class="cx">             return std::round(m_configuration.height);
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // If not, make sure the viewport width and initial scale can co-exist.
</span><span class="cx">         double initialContentHeightInViewportCoordinate = m_configuration.height * m_configuration.initialScale;
</span><del>-        if (initialContentHeightInViewportCoordinate &lt; m_minimumLayoutSize.height()) {
</del><ins>+        if (initialContentHeightInViewportCoordinate &lt; minimumLayoutSize.height()) {
</ins><span class="cx">             // The specified width does not fit in viewport. Return the minimum height that satisfy the initialScale constraint.
</span><del>-            return std::round(m_minimumLayoutSize.height() / m_configuration.initialScale);
</del><ins>+            return std::round(minimumLayoutSize.height() / m_configuration.initialScale);
</ins><span class="cx">         }
</span><span class="cx">         return std::round(m_configuration.height);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // If the page has a real scale, then just return the minimum size over the initial scale.
</span><span class="cx">     if (m_configuration.initialScaleIsSet &amp;&amp; !m_configuration.widthIsSet)
</span><del>-        return std::round(m_minimumLayoutSize.height() / m_configuration.initialScale);
</del><ins>+        return std::round(minimumLayoutSize.height() / m_configuration.initialScale);
</ins><span class="cx"> 
</span><del>-    if (m_minimumLayoutSize.width() &gt; 0)
-        return std::round(m_minimumLayoutSize.height() * layoutWidth() / m_minimumLayoutSize.width());
-    return m_minimumLayoutSize.height();
</del><ins>+    if (minimumLayoutSize.width() &gt; 0)
+        return std::round(minimumLayoutSize.height() * layoutWidth() / minimumLayoutSize.width());
+    return minimumLayoutSize.height();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #ifndef NDEBUG
</span><span class="lines">@@ -435,6 +472,8 @@
</span><span class="cx"> 
</span><span class="cx">     dumpProperty(ts, &quot;contentSize&quot;, m_contentSize);
</span><span class="cx">     dumpProperty(ts, &quot;minimumLayoutSize&quot;, m_minimumLayoutSize);
</span><ins>+    dumpProperty(ts, &quot;minimumLayoutSizeForMinimalUI&quot;, m_minimumLayoutSizeForMinimalUI);
+    ts &lt;&lt; &quot;(uses minimal UI &quot; &lt;&lt; m_usesMinimalUI &lt;&lt; &quot;)&quot;;
</ins><span class="cx"> 
</span><span class="cx">     ts &lt;&lt; &quot;\n&quot;;
</span><span class="cx">     ts.increaseIndent();
</span></span></pre></div>
<a id="trunkSourceWebCorepageViewportConfigurationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/ViewportConfiguration.h (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ViewportConfiguration.h        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebCore/page/ViewportConfiguration.h        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -74,14 +74,23 @@
</span><span class="cx">     const FloatSize&amp; minimumLayoutSize() const { return m_minimumLayoutSize; }
</span><span class="cx">     void setMinimumLayoutSize(const FloatSize&amp;);
</span><span class="cx"> 
</span><ins>+    const FloatSize&amp; minimumLayoutSizeForMinimalUI() const { return m_minimumLayoutSizeForMinimalUI.isEmpty() ? m_minimumLayoutSize : m_minimumLayoutSizeForMinimalUI; }
+    void setMinimumLayoutSizeForMinimalUI(const FloatSize&amp;);
+
+    const FloatSize&amp; activeMinimumLayoutSizeInScrollViewCoordinates() const;
+
</ins><span class="cx">     const ViewportArguments&amp; viewportArguments() const { return m_viewportArguments; }
</span><span class="cx">     void setViewportArguments(const ViewportArguments&amp;);
</span><span class="cx"> 
</span><ins>+    void resetMinimalUI();
+    void didFinishDocumentLoad();
+
</ins><span class="cx">     IntSize layoutSize() const;
</span><span class="cx">     double initialScale() const;
</span><span class="cx">     double minimumScale() const;
</span><span class="cx">     double maximumScale() const { return m_configuration.maximumScale; }
</span><span class="cx">     bool allowsUserScaling() const { return m_configuration.allowsUserScaling; }
</span><ins>+    bool usesMinimalUI() const { return m_usesMinimalUI; }
</ins><span class="cx"> 
</span><span class="cx">     static Parameters webpageParameters();
</span><span class="cx">     static Parameters textDocumentParameters();
</span><span class="lines">@@ -102,7 +111,11 @@
</span><span class="cx">     Parameters m_defaultConfiguration;
</span><span class="cx">     IntSize m_contentSize;
</span><span class="cx">     FloatSize m_minimumLayoutSize;
</span><ins>+    FloatSize m_minimumLayoutSizeForMinimalUI;
</ins><span class="cx">     ViewportArguments m_viewportArguments;
</span><ins>+
+    bool m_usesMinimalUI;
+    bool m_pageDidFinishDocumentLoad;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderView.cpp (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderView.cpp        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebCore/rendering/RenderView.cpp        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -1186,9 +1186,9 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntSize RenderView::viewportSize() const
</del><ins>+IntSize RenderView::viewportSizeForCSSViewportUnits() const
</ins><span class="cx"> {
</span><del>-    return frameView().viewportSize();
</del><ins>+    return frameView().viewportSizeForCSSViewportUnits();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderView::updateHitTestResult(HitTestResult&amp; result, const LayoutPoint&amp; point)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderView.h (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderView.h        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebCore/rendering/RenderView.h        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -205,7 +205,7 @@
</span><span class="cx"> 
</span><span class="cx">     IntervalArena* intervalArena();
</span><span class="cx"> 
</span><del>-    IntSize viewportSize() const;
</del><ins>+    IntSize viewportSizeForCSSViewportUnits() const;
</ins><span class="cx"> 
</span><span class="cx">     void setRenderQuoteHead(RenderQuote* head) { m_renderQuoteHead = head; }
</span><span class="cx">     RenderQuote* renderQuoteHead() const { return m_renderQuoteHead; }
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebKit2/ChangeLog        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -1,5 +1,62 @@
</span><span class="cx"> 2014-05-22  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        [iOS][WK2] Add support for minimal-ui viewports
+        https://bugs.webkit.org/show_bug.cgi?id=133162
+
+        Reviewed by Simon Fraser.
+
+        In the WebKit2 layers, we have two parts to minimal-ui.
+        -In WebPage, we need to get the values from the UIProcess and setup the ViewportConfiguration.
+         Another part is freezing the state on page load.
+        -In the UIProcess, we need to get the right information for layout and styling, and we need to tell
+         the UI clients about minimal-ui changes.
+
+        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _setUsesMinimalUI:]):
+        (-[WKWebView _usesMinimalUI]):
+        (-[WKWebView _didCommitLayerTree:WebKit::]):
+        (-[WKWebView _frameOrBoundsChanged]):
+        (-[WKWebView _minimumLayoutSizeOverride]):
+        (-[WKWebView _setMinimumLayoutSizeOverride:]):
+        (-[WKWebView _minimumLayoutSizeOverrideForMinimalUI]):
+        (-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]):
+        (-[WKWebView _largestUnobscuredSizeOverride]):
+        (-[WKWebView _setMaximumUnobscuredSizeOverride:]):
+        (-[WKWebView _beginAnimatedResizeWithUpdates:]):
+        (setViewportConfigurationMinimumLayoutSize): Deleted.
+        * UIProcess/API/Cocoa/WKWebViewInternal.h:
+        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/ios/PageClientImplIOS.h:
+        * UIProcess/ios/PageClientImplIOS.mm:
+        (WebKit::PageClientImpl::setUsesMinimalUI):
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
+        (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSizeForMinimalUI):
+        (WebKit::WebPageProxy::setMaximumUnobscuredSize):
+        (WebKit::WebPageProxy::setUsesMinimalUI):
+        (WebKit::WebPageProxy::setMinimumLayoutSizeForMinimalUI): Deleted.
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::WebPage):
+        (WebKit::WebPage::didCommitLoad):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::setViewportConfigurationMinimumLayoutSizeForMinimalUI):
+        (WebKit::WebPage::setMaximumUnobscuredSize):
+        (WebKit::WebPage::willFlushLayers):
+        (WebKit::WebPage::dynamicViewportSizeUpdate):
+        (WebKit::WebPage::viewportConfigurationChanged):
+        (WebKit::WebPage::updateViewportSizeForCSSViewportUnits):
+        (WebKit::WebPage::setMinimumLayoutSizeForMinimalUI): Deleted.
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
+        (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
+
+2014-05-22  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
+
</ins><span class="cx">         [iOS][WK2] Reset the special action-target of WKSyntheticClickTapGestureRecognizer on destruction
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=133165
</span><span class="cx">         &lt;rdar://problem/16283914&gt;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKUIDelegatePrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #if TARGET_OS_IPHONE
</span><span class="cx"> - (NSArray *)_webView:(WKWebView *)webView actionsForElement:(_WKActivatedElementInfo *)element defaultActions:(NSArray *)defaultActions;
</span><span class="cx"> - (void)_webView:(WKWebView *)webView didNotHandleTapAsClickAtPoint:(CGPoint)point;
</span><ins>+- (void)_webView:(WKWebView *)webView usesMinimalUI:(BOOL)wantMinimalUI;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx"> #import &quot;WKPreferencesInternal.h&quot;
</span><span class="cx"> #import &quot;WKProcessPoolInternal.h&quot;
</span><span class="cx"> #import &quot;WKUIDelegate.h&quot;
</span><ins>+#import &quot;WKUIDelegatePrivate.h&quot;
</ins><span class="cx"> #import &quot;WKUserContentControllerInternal.h&quot;
</span><span class="cx"> #import &quot;WKWebViewConfigurationInternal.h&quot;
</span><span class="cx"> #import &quot;WKWebViewContentProvider.h&quot;
</span><span class="lines">@@ -135,9 +136,14 @@
</span><span class="cx">     RetainPtr&lt;WKScrollView&gt; _scrollView;
</span><span class="cx">     RetainPtr&lt;WKContentView&gt; _contentView;
</span><span class="cx"> 
</span><del>-    BOOL _hasStaticMinimumLayoutSize;
</del><ins>+    BOOL _overridesMinimumLayoutSize;
</ins><span class="cx">     CGSize _minimumLayoutSizeOverride;
</span><ins>+    BOOL _overridesMinimumLayoutSizeForMinimalUI;
</ins><span class="cx">     CGSize _minimumLayoutSizeOverrideForMinimalUI;
</span><ins>+    BOOL _overridesMaximumUnobscuredSize;
+    CGSize _maximumUnobscuredSizeOverride;
+    BOOL _usesMinimalUI;
+    BOOL _needsToNotifyDelegateAboutMinimalUI;
</ins><span class="cx">     CGRect _inputViewBounds;
</span><span class="cx">     CGFloat _viewportMetaTagWidth;
</span><span class="cx"> 
</span><span class="lines">@@ -519,9 +525,21 @@
</span><span class="cx">     [_scrollView setBackgroundColor:uiBackgroundColor.get()];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)_setUsesMinimalUI:(BOOL)usesMinimalUI
+{
+    _usesMinimalUI = usesMinimalUI;
+    _needsToNotifyDelegateAboutMinimalUI = YES;
+}
+
+- (BOOL)_usesMinimalUI
+{
+    return _usesMinimalUI;
+}
+
</ins><span class="cx"> - (void)_didCommitLoadForMainFrame
</span><span class="cx"> {
</span><span class="cx">     _needsResetViewStateAfterCommitLoadForMainFrame = YES;
</span><ins>+    _usesMinimalUI = NO;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_didCommitLayerTree:(const WebKit::RemoteLayerTreeTransaction&amp;)layerTreeTransaction
</span><span class="lines">@@ -546,6 +564,14 @@
</span><span class="cx">     if (_gestureController)
</span><span class="cx">         _gestureController-&gt;setRenderTreeSize(layerTreeTransaction.renderTreeSize());
</span><span class="cx"> 
</span><ins>+    if (_needsToNotifyDelegateAboutMinimalUI || _needsResetViewStateAfterCommitLoadForMainFrame) {
+        _needsToNotifyDelegateAboutMinimalUI = NO;
+
+        auto delegate = _uiDelegate-&gt;delegate();
+        if ([delegate respondsToSelector:@selector(_webView:usesMinimalUI:)])
+            [static_cast&lt;id &lt;WKUIDelegatePrivate&gt;&gt;(delegate.get()) _webView:self usesMinimalUI:_usesMinimalUI];
+    }
+
</ins><span class="cx">     if (_needsResetViewStateAfterCommitLoadForMainFrame) {
</span><span class="cx">         _needsResetViewStateAfterCommitLoadForMainFrame = NO;
</span><span class="cx">         [_scrollView setContentOffset:CGPointMake(-_obscuredInsets.left, -_obscuredInsets.top)];
</span><span class="lines">@@ -929,17 +955,18 @@
</span><span class="cx">     [_contentView didZoomToScale:scale];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline void setViewportConfigurationMinimumLayoutSize(WebKit::WebPageProxy&amp; page, const CGSize&amp; size)
-{
-    page.setViewportConfigurationMinimumLayoutSize(WebCore::FloatSize(size));
-}
-
</del><span class="cx"> - (void)_frameOrBoundsChanged
</span><span class="cx"> {
</span><span class="cx">     CGRect bounds = self.bounds;
</span><ins>+    if (!_isAnimatingResize) {
+        if (!_overridesMinimumLayoutSize)
+            _page-&gt;setViewportConfigurationMinimumLayoutSize(WebCore::FloatSize(bounds.size));
+        if (!_overridesMinimumLayoutSizeForMinimalUI)
+            _page-&gt;setViewportConfigurationMinimumLayoutSizeForMinimalUI(WebCore::FloatSize(bounds.size));
+        if (!_overridesMaximumUnobscuredSize)
+            _page-&gt;setMaximumUnobscuredSize(WebCore::FloatSize(bounds.size));
+    }
</ins><span class="cx"> 
</span><del>-    if (!_hasStaticMinimumLayoutSize &amp;&amp; !_isAnimatingResize)
-        setViewportConfigurationMinimumLayoutSize(*_page, bounds.size);
</del><span class="cx">     [_scrollView setFrame:bounds];
</span><span class="cx">     [_contentView setMinimumSize:bounds.size];
</span><span class="cx">     [_customContentView web_setMinimumSize:bounds.size];
</span><span class="lines">@@ -1507,28 +1534,30 @@
</span><span class="cx"> 
</span><span class="cx"> - (CGSize)_minimumLayoutSizeOverride
</span><span class="cx"> {
</span><del>-    ASSERT(_hasStaticMinimumLayoutSize);
</del><ins>+    ASSERT(_overridesMinimumLayoutSize);
</ins><span class="cx">     return _minimumLayoutSizeOverride;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_setMinimumLayoutSizeOverride:(CGSize)minimumLayoutSizeOverride
</span><span class="cx"> {
</span><del>-    _hasStaticMinimumLayoutSize = YES;
</del><ins>+    _overridesMinimumLayoutSize = YES;
</ins><span class="cx">     _minimumLayoutSizeOverride = minimumLayoutSizeOverride;
</span><span class="cx">     if (!_isAnimatingResize)
</span><del>-        setViewportConfigurationMinimumLayoutSize(*_page, minimumLayoutSizeOverride);
</del><ins>+        _page-&gt;setViewportConfigurationMinimumLayoutSize(WebCore::FloatSize(minimumLayoutSizeOverride));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (CGSize)_minimumLayoutSizeOverrideForMinimalUI
</span><span class="cx"> {
</span><ins>+    ASSERT(_overridesMinimumLayoutSizeForMinimalUI);
</ins><span class="cx">     return _minimumLayoutSizeOverrideForMinimalUI;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_setMinimumLayoutSizeOverrideForMinimalUI:(CGSize)size
</span><span class="cx"> {
</span><ins>+    _overridesMinimumLayoutSizeForMinimalUI = YES;
</ins><span class="cx">     _minimumLayoutSizeOverrideForMinimalUI = size;
</span><span class="cx">     if (!_isAnimatingResize)
</span><del>-        _page-&gt;setMinimumLayoutSizeForMinimalUI(WebCore::FloatSize(size));
</del><ins>+        _page-&gt;setViewportConfigurationMinimumLayoutSizeForMinimalUI(WebCore::FloatSize(size));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (UIEdgeInsets)_obscuredInsets
</span><span class="lines">@@ -1551,6 +1580,24 @@
</span><span class="cx">     [self _updateVisibleContentRects];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (CGSize)_maximumUnobscuredSizeOverride
+{
+    ASSERT(_overridesMaximumUnobscuredSize);
+    return _maximumUnobscuredSizeOverride;
+}
+
+- (void)_setMaximumUnobscuredSizeOverride:(CGSize)size
+{
+    ASSERT(size.width &lt;= self.bounds.size.width &amp;&amp; size.height &lt;= self.bounds.size.height);
+    _overridesMaximumUnobscuredSize = YES;
+    if (CGSizeEqualToSize(_maximumUnobscuredSizeOverride, size))
+        return;
+
+    _maximumUnobscuredSizeOverride = size;
+    if (!_isAnimatingResize)
+        _page-&gt;setMaximumUnobscuredSize(WebCore::FloatSize(size));
+}
+
</ins><span class="cx"> - (void)_setBackgroundExtendsBeyondPage:(BOOL)backgroundExtends
</span><span class="cx"> {
</span><span class="cx">     _page-&gt;setBackgroundExtendsBeyondPage(backgroundExtends);
</span><span class="lines">@@ -1583,13 +1630,7 @@
</span><span class="cx">     _resizeAnimationView = adoptNS([[UIView alloc] init]);
</span><span class="cx">     [_scrollView insertSubview:_resizeAnimationView.get() atIndex:indexOfContentView];
</span><span class="cx">     [_resizeAnimationView addSubview:_contentView.get()];
</span><del>-
-    CGRect oldBounds = self.bounds;
-    CGSize oldMinimumLayoutSize = oldBounds.size;
-    if (_hasStaticMinimumLayoutSize)
-        oldMinimumLayoutSize = _minimumLayoutSizeOverride;
</del><span class="cx">     WebCore::FloatRect oldUnobscuredContentRect = _page-&gt;unobscuredContentRect();
</span><del>-    UIEdgeInsets oldInsets = _obscuredInsets;
</del><span class="cx"> 
</span><span class="cx">     updateBlock();
</span><span class="cx"> 
</span><span class="lines">@@ -1598,14 +1639,7 @@
</span><span class="cx"> 
</span><span class="cx">     CGRect newBounds = self.bounds;
</span><span class="cx">     CGSize newMinimumLayoutSize = newBounds.size;
</span><del>-    if (_hasStaticMinimumLayoutSize)
-        newMinimumLayoutSize = _minimumLayoutSizeOverride;
</del><span class="cx"> 
</span><del>-    if (CGSizeEqualToSize(newMinimumLayoutSize, oldMinimumLayoutSize)
-        &amp;&amp; CGRectEqualToRect(newBounds, oldBounds)
-        &amp;&amp; UIEdgeInsetsEqualToEdgeInsets(oldInsets, _obscuredInsets))
-        return;
-
</del><span class="cx">     CGSize contentSizeInContentViewCoordinates = [_contentView bounds].size;
</span><span class="cx">     [_scrollView setMinimumZoomScale:std::min(newMinimumLayoutSize.width / contentSizeInContentViewCoordinates.width, [_scrollView minimumZoomScale])];
</span><span class="cx">     [_scrollView setMaximumZoomScale:std::max(newMinimumLayoutSize.width / contentSizeInContentViewCoordinates.width, [_scrollView maximumZoomScale])];
</span><span class="lines">@@ -1651,7 +1685,19 @@
</span><span class="cx">     CGRect visibleRectInContentCoordinates = [self convertRect:newBounds toView:_contentView.get()];
</span><span class="cx">     CGRect unobscuredRectInContentCoordinates = [self convertRect:futureUnobscuredRectInSelfCoordinates toView:_contentView.get()];
</span><span class="cx"> 
</span><del>-    _page-&gt;dynamicViewportSizeUpdate(WebCore::FloatSize(newMinimumLayoutSize.width, newMinimumLayoutSize.height), visibleRectInContentCoordinates, unobscuredRectInContentCoordinates, futureUnobscuredRectInSelfCoordinates, targetScale);
</del><ins>+    CGSize minimumLayoutSize = newBounds.size;
+    if (_overridesMinimumLayoutSize)
+        minimumLayoutSize = _minimumLayoutSizeOverride;
+
+    CGSize minimumLayoutSizeForMinimalUI = minimumLayoutSize;
+    if (_overridesMinimumLayoutSizeForMinimalUI)
+        minimumLayoutSizeForMinimalUI = _minimumLayoutSizeOverrideForMinimalUI;
+
+    CGSize maximumUnobscuredSize = newBounds.size;
+    if (_overridesMaximumUnobscuredSize)
+        maximumUnobscuredSize = _maximumUnobscuredSizeOverride;
+
+    _page-&gt;dynamicViewportSizeUpdate(WebCore::FloatSize(minimumLayoutSize), WebCore::FloatSize(minimumLayoutSizeForMinimalUI), WebCore::FloatSize(maximumUnobscuredSize), visibleRectInContentCoordinates, unobscuredRectInContentCoordinates, futureUnobscuredRectInSelfCoordinates, targetScale);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_endAnimatedResize
</span><span class="lines">@@ -1744,6 +1790,15 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)_overrideLayoutParametersWithMinimumLayoutSize:(CGSize)minimumLayoutSize minimumLayoutSizeForMinimalUI:(CGSize)minimumLayoutSizeForMinimalUI maximumUnobscuredSizeOverride:(CGSize)maximumUnobscuredSizeOverride
+{
+    // FIXME: After Safari is updated to use this function instead of setting the parameters separately, we should remove
+    // the individual setters and send a single message to send everything at once to the WebProcess.
+    self._minimumLayoutSizeOverride = minimumLayoutSize;
+    self._minimumLayoutSizeOverrideForMinimalUI = minimumLayoutSizeForMinimalUI;
+    self._maximumUnobscuredSizeOverride = maximumUnobscuredSizeOverride;
+}
+
</ins><span class="cx"> - (UIView *)_viewForFindUI
</span><span class="cx"> {
</span><span class="cx">     return [self viewForZoomingInScrollView:[self scrollView]];
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -61,6 +61,9 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><ins>+
+@property (nonatomic, setter=_setUsesMinimalUI:) BOOL _usesMinimalUI;
+
</ins><span class="cx"> - (void)_didCommitLoadForMainFrame;
</span><span class="cx"> - (void)_didCommitLayerTree:(const WebKit::RemoteLayerTreeTransaction&amp;)layerTreeTransaction;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -95,9 +95,16 @@
</span><span class="cx"> - (void)_close;
</span><span class="cx"> 
</span><span class="cx"> #if TARGET_OS_IPHONE
</span><ins>+// DERECATED: The setters of the three following function are deprecated, please use overrideLayoutParameters.
+// Define the smallest size a page take with a regular viewport.
</ins><span class="cx"> @property (nonatomic, setter=_setMinimumLayoutSizeOverride:) CGSize _minimumLayoutSizeOverride;
</span><ins>+// Define the smallest size a page take with the minmal-ui viewport.
</ins><span class="cx"> @property (nonatomic, setter=_setMinimumLayoutSizeOverrideForMinimalUI:) CGSize _minimumLayoutSizeOverrideForMinimalUI;
</span><ins>+// Define the largest size the unobscured area can get for the current view bounds. This value is used to define viewport units.
+@property (nonatomic, setter=_setMaximumUnobscuredSizeOverride:) CGSize _maximumUnobscuredSizeOverride;
</ins><span class="cx"> 
</span><ins>+@property (nonatomic, readonly) BOOL _usesMinimalUI;
+
</ins><span class="cx"> // Define the inset of the scrollview unusable by the web page.
</span><span class="cx"> @property (nonatomic, setter=_setObscuredInsets:) UIEdgeInsets _obscuredInsets;
</span><span class="cx"> 
</span><span class="lines">@@ -123,6 +130,8 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_snapshotRect:(CGRect)rectInViewCoordinates intoImageOfWidth:(CGFloat)imageWidth completionHandler:(void(^)(CGImageRef))completionHandler;
</span><span class="cx"> 
</span><ins>+- (void)_overrideLayoutParametersWithMinimumLayoutSize:(CGSize)minimumLayoutSize minimumLayoutSizeForMinimalUI:(CGSize)minimumLayoutSizeForMinimalUI maximumUnobscuredSizeOverride:(CGSize)maximumUnobscuredSizeOverride;
+
</ins><span class="cx"> - (UIView *)_viewForFindUI;
</span><span class="cx"> 
</span><span class="cx"> // FIXME: Remove this once nobody uses it.
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPageClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/PageClient.h        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -257,6 +257,7 @@
</span><span class="cx">     virtual void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect&amp; elementRect) = 0;
</span><span class="cx">     virtual void zoomToRect(WebCore::FloatRect, double minimumScale, double maximumScale) = 0;
</span><span class="cx">     virtual void didChangeViewportMetaTagWidth(float) = 0;
</span><ins>+    virtual void setUsesMinimalUI(bool) = 0;
</ins><span class="cx">     virtual double minimumZoomScale() const = 0;
</span><span class="cx">     virtual WebCore::FloatSize contentsSize() const = 0;
</span><span class="cx">     virtual void didFinishDrawingPagesToPDF(const IPC::DataReference&amp;) = 0;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -595,10 +595,11 @@
</span><span class="cx">     enum class UnobscuredRectConstraint { ConstrainedToDocumentRect, Unconstrained };
</span><span class="cx">     WebCore::FloatRect computeCustomFixedPositionRect(const WebCore::FloatRect&amp; unobscuredContentRect, double displayedContentScale, UnobscuredRectConstraint = UnobscuredRectConstraint::Unconstrained) const;
</span><span class="cx"> 
</span><del>-    void dynamicViewportSizeUpdate(const WebCore::FloatSize&amp; minimumLayoutSize, const WebCore::FloatRect&amp; targetExposedContentRect, const WebCore::FloatRect&amp; targetUnobscuredRect, const WebCore::FloatRect&amp; targetUnobscuredRectInScrollViewCoordinates, double targetScale);
</del><ins>+    void dynamicViewportSizeUpdate(const WebCore::FloatSize&amp; minimumLayoutSize, const WebCore::FloatSize&amp; minimumLayoutSizeForMinimalUI, const WebCore::FloatSize&amp; maximumUnobscuredSize, const WebCore::FloatRect&amp; targetExposedContentRect, const WebCore::FloatRect&amp; targetUnobscuredRect, const WebCore::FloatRect&amp; targetUnobscuredRectInScrollViewCoordinates, double targetScale);
</ins><span class="cx">     
</span><span class="cx">     void setViewportConfigurationMinimumLayoutSize(const WebCore::FloatSize&amp;);
</span><del>-    void setMinimumLayoutSizeForMinimalUI(const WebCore::FloatSize&amp;);
</del><ins>+    void setViewportConfigurationMinimumLayoutSizeForMinimalUI(const WebCore::FloatSize&amp;);
+    void setMaximumUnobscuredSize(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 class="lines">@@ -633,6 +634,7 @@
</span><span class="cx">     void commitPotentialTapFailed();
</span><span class="cx">     void didNotHandleTapAsClick(const WebCore::IntPoint&amp;);
</span><span class="cx">     void viewportMetaTagWidthDidChange(float width);
</span><ins>+    void setUsesMinimalUI(bool);
</ins><span class="cx">     void didFinishDrawingPagesToPDF(const IPC::DataReference&amp;);
</span><span class="cx">     void contentSizeCategoryDidChange(const String&amp; contentSizeCategory);
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -172,6 +172,7 @@
</span><span class="cx">     CommitPotentialTapFailed()
</span><span class="cx">     DidNotHandleTapAsClick(WebCore::IntPoint point)
</span><span class="cx">     ViewportMetaTagWidthDidChange(float width)
</span><ins>+    SetUsesMinimalUI(bool usesMinimalUI)
</ins><span class="cx">     DidFinishDrawingPagesToPDF(IPC::DataReference pdfData)
</span><span class="cx"> #endif
</span><span class="cx"> #if PLATFORM(GTK)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -123,6 +123,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual bool handleRunOpenPanel(WebPageProxy*, WebFrameProxy*, WebOpenPanelParameters*, WebOpenPanelResultListenerProxy*) override;
</span><span class="cx">     virtual void didChangeViewportMetaTagWidth(float) override;
</span><ins>+    virtual void setUsesMinimalUI(bool) override;
</ins><span class="cx">     virtual double minimumZoomScale() const override;
</span><span class="cx">     virtual WebCore::FloatSize contentsSize() const override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -189,6 +189,11 @@
</span><span class="cx">     [m_webView _setViewportMetaTagWidth:newWidth];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void PageClientImpl::setUsesMinimalUI(bool usesMinimalUI)
+{
+    [m_webView _setUsesMinimalUI:usesMinimalUI];
+}
+
</ins><span class="cx"> double PageClientImpl::minimumZoomScale() const
</span><span class="cx"> {
</span><span class="cx">     if (UIScrollView *scroller = [m_webView scrollView])
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -235,9 +235,9 @@
</span><span class="cx">     return FrameView::rectForViewportConstrainedObjects(enclosingLayoutRect(constrainedUnobscuredRect), roundedLayoutSize(contentsSize), displayedContentScale, false, StickToViewportBounds);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::dynamicViewportSizeUpdate(const FloatSize&amp; minimumLayoutSize, const FloatRect&amp; targetExposedContentRect, const FloatRect&amp; targetUnobscuredRect, const FloatRect&amp; targetUnobscuredRectInScrollViewCoordinates,  double targetScale)
</del><ins>+void WebPageProxy::dynamicViewportSizeUpdate(const FloatSize&amp; minimumLayoutSize, const WebCore::FloatSize&amp; minimumLayoutSizeForMinimalUI, const WebCore::FloatSize&amp; maximumUnobscuredSize, const FloatRect&amp; targetExposedContentRect, const FloatRect&amp; targetUnobscuredRect, const FloatRect&amp; targetUnobscuredRectInScrollViewCoordinates,  double targetScale)
</ins><span class="cx"> {
</span><del>-    m_process-&gt;send(Messages::WebPage::DynamicViewportSizeUpdate(minimumLayoutSize, targetExposedContentRect, targetUnobscuredRect, targetUnobscuredRectInScrollViewCoordinates, targetScale), m_pageID);
</del><ins>+    m_process-&gt;send(Messages::WebPage::DynamicViewportSizeUpdate(minimumLayoutSize, minimumLayoutSizeForMinimalUI, maximumUnobscuredSize, targetExposedContentRect, targetUnobscuredRect, targetUnobscuredRectInScrollViewCoordinates, targetScale), m_pageID);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPageProxy::setViewportConfigurationMinimumLayoutSize(const WebCore::FloatSize&amp; size)
</span><span class="lines">@@ -245,11 +245,16 @@
</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::FloatSize&amp; size)
</del><ins>+void WebPageProxy::setViewportConfigurationMinimumLayoutSizeForMinimalUI(const WebCore::FloatSize&amp; size)
</ins><span class="cx"> {
</span><del>-    m_process-&gt;send(Messages::WebPage::SetMinimumLayoutSizeForMinimalUI(size), m_pageID);
</del><ins>+    m_process-&gt;send(Messages::WebPage::SetViewportConfigurationMinimumLayoutSizeForMinimalUI(size), m_pageID);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebPageProxy::setMaximumUnobscuredSize(const WebCore::FloatSize&amp; size)
+{
+    m_process-&gt;send(Messages::WebPage::SetMaximumUnobscuredSize(size), m_pageID);
+}
+
</ins><span class="cx"> void WebPageProxy::didCommitLayerTree(const WebKit::RemoteLayerTreeTransaction&amp; layerTreeTransaction)
</span><span class="cx"> {
</span><span class="cx">     m_pageExtendedBackgroundColor = layerTreeTransaction.pageExtendedBackgroundColor();
</span><span class="lines">@@ -649,6 +654,11 @@
</span><span class="cx">     m_pageClient.didChangeViewportMetaTagWidth(width);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebPageProxy::setUsesMinimalUI(bool usesMinimalUI)
+{
+    m_pageClient.setUsesMinimalUI(usesMinimalUI);
+}
+
</ins><span class="cx"> void WebPageProxy::didFinishDrawingPagesToPDF(const IPC::DataReference&amp; pdfData)
</span><span class="cx"> {
</span><span class="cx">     m_pageClient.didFinishDrawingPagesToPDF(pdfData);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -499,6 +499,8 @@
</span><span class="cx">     if (!webPage)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    webPage-&gt;didFinishDocumentLoad(m_frame);
+
</ins><span class="cx">     RefPtr&lt;API::Object&gt; userData;
</span><span class="cx"> 
</span><span class="cx">     // Notify the bundle client.
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -4313,6 +4313,7 @@
</span><span class="cx">     WebProcess::shared().eventDispatcher().clearQueuedTouchEventsForPage(*this);
</span><span class="cx"> 
</span><span class="cx">     resetViewportDefaultConfiguration(frame);
</span><ins>+    m_viewportConfiguration.resetMinimalUI();
</ins><span class="cx">     m_viewportConfiguration.setViewportArguments(ViewportArguments());
</span><span class="cx">     m_viewportConfiguration.setContentsSize(IntSize());
</span><span class="cx">     viewportConfigurationChanged();
</span><span class="lines">@@ -4327,6 +4328,16 @@
</span><span class="cx">     updateMainFrameScrollOffsetPinning();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebPage::didFinishDocumentLoad(WebFrame* frame)
+{
+#if PLATFORM(IOS)
+    if (!frame-&gt;isMainFrame())
+        return;
+
+    m_viewportConfiguration.didFinishDocumentLoad();
+#endif // PLATFORM(IOS)
+}
+
</ins><span class="cx"> void WebPage::didFinishLoad(WebFrame* frame)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -249,6 +249,7 @@
</span><span class="cx">     void didStartPageTransition();
</span><span class="cx">     void didCompletePageTransition();
</span><span class="cx">     void didCommitLoad(WebFrame*);
</span><ins>+    void didFinishDocumentLoad(WebFrame*);
</ins><span class="cx">     void didFinishLoad(WebFrame*);
</span><span class="cx">     void show();
</span><span class="cx">     String userAgent() const { return m_userAgent; }
</span><span class="lines">@@ -713,8 +714,9 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     void setViewportConfigurationMinimumLayoutSize(const WebCore::FloatSize&amp;);
</span><del>-    void setMinimumLayoutSizeForMinimalUI(const WebCore::FloatSize&amp;);
-    void dynamicViewportSizeUpdate(const WebCore::FloatSize&amp; minimumLayoutSize, const WebCore::FloatRect&amp; targetExposedContentRect, const WebCore::FloatRect&amp; targetUnobscuredRect, const WebCore::FloatRect&amp; targetUnobscuredRectInScrollViewCoordinates, double scale);
</del><ins>+    void setViewportConfigurationMinimumLayoutSizeForMinimalUI(const WebCore::FloatSize&amp;);
+    void setMaximumUnobscuredSize(const WebCore::FloatSize&amp;);
+    void dynamicViewportSizeUpdate(const WebCore::FloatSize&amp; minimumLayoutSize, const WebCore::FloatSize&amp; minimumLayoutSizeForMinimalUI, const WebCore::FloatSize&amp; maximumUnobscuredSize, const WebCore::FloatRect&amp; targetExposedContentRect, const WebCore::FloatRect&amp; targetUnobscuredRect, const WebCore::FloatRect&amp; targetUnobscuredRectInScrollViewCoordinates, double scale);
</ins><span class="cx">     void updateVisibleContentRects(const VisibleContentRectUpdateInfo&amp;);
</span><span class="cx">     bool scaleWasSetByUIProcess() const { return m_scaleWasSetByUIProcess; }
</span><span class="cx">     void willStartUserTriggeredZooming();
</span><span class="lines">@@ -822,6 +824,7 @@
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     void resetViewportDefaultConfiguration(WebFrame* mainFrame);
</span><span class="cx">     void viewportConfigurationChanged();
</span><ins>+    void updateViewportSizeForCSSViewportUnits();
</ins><span class="cx"> 
</span><span class="cx">     static void convertSelectionRectsToRootView(WebCore::FrameView*, Vector&lt;WebCore::SelectionRect&gt;&amp;);
</span><span class="cx">     PassRefPtr&lt;WebCore::Range&gt; rangeForWebSelectionAtPosition(const WebCore::IntPoint&amp;, const WebCore::VisiblePosition&amp;, SelectionFlags&amp;);
</span><span class="lines">@@ -1203,7 +1206,7 @@
</span><span class="cx">     WebCore::FloatSize m_availableScreenSize;
</span><span class="cx">     RefPtr&lt;WebCore::Range&gt; m_currentBlockSelection;
</span><span class="cx">     WebCore::IntSize m_blockSelectionDesiredSize;
</span><del>-    WebCore::FloatSize m_minimumLayoutSizeForMinimalUI;
</del><ins>+    WebCore::FloatSize m_maximumUnobscuredSize;
</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">     RefPtr&lt;WebCore::Node&gt; m_pendingSyntheticClickNode;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagemessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -44,8 +44,9 @@
</span><span class="cx">     WheelEventSyncForTesting(WebKit::WebWheelEvent event) -&gt; (bool handled)
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     SetViewportConfigurationMinimumLayoutSize(WebCore::FloatSize size)
</span><del>-    SetMinimumLayoutSizeForMinimalUI(WebCore::FloatSize size)
-    DynamicViewportSizeUpdate(WebCore::FloatSize minimumLayoutSize, WebCore::FloatRect targetExposedContentRect, WebCore::FloatRect targetUnobscuredRect, WebCore::FloatRect targetUnobscuredRectInScrollViewCoordinates, double scale)
</del><ins>+    SetViewportConfigurationMinimumLayoutSizeForMinimalUI(WebCore::FloatSize size)
+    SetMaximumUnobscuredSize(WebCore::FloatSize size)
+    DynamicViewportSizeUpdate(WebCore::FloatSize minimumLayoutSize, WebCore::FloatSize minimumLayoutSizeForMinimalUI,  WebCore::FloatSize maximumUnobscuredSize, WebCore::FloatRect targetExposedContentRect, WebCore::FloatRect targetUnobscuredRect, WebCore::FloatRect targetUnobscuredRectInScrollViewCoordinates, double scale)
</ins><span class="cx"> 
</span><span class="cx">     HandleTap(WebCore::IntPoint point)
</span><span class="cx">     PotentialTapAtPosition(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 (169244 => 169245)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-05-23 04:06:05 UTC (rev 169244)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-05-23 04:13:19 UTC (rev 169245)
</span><span class="lines">@@ -128,10 +128,14 @@
</span><span class="cx"> void WebPage::viewportPropertiesDidChange(const ViewportArguments&amp; viewportArguments)
</span><span class="cx"> {
</span><span class="cx">     float oldWidth = m_viewportConfiguration.viewportArguments().width;
</span><ins>+    bool wasUsingMinimalUI = m_viewportConfiguration.usesMinimalUI();
</ins><span class="cx"> 
</span><span class="cx">     m_viewportConfiguration.setViewportArguments(viewportArguments);
</span><span class="cx">     viewportConfigurationChanged();
</span><span class="cx"> 
</span><ins>+    if (wasUsingMinimalUI != m_viewportConfiguration.usesMinimalUI())
+        send(Messages::WebPageProxy::SetUsesMinimalUI(m_viewportConfiguration.usesMinimalUI()));
+
</ins><span class="cx">     if (oldWidth != viewportArguments.width)
</span><span class="cx">         send(Messages::WebPageProxy::ViewportMetaTagWidthDidChange(viewportArguments.width));
</span><span class="cx"> }
</span><span class="lines">@@ -1915,13 +1919,19 @@
</span><span class="cx">     viewportConfigurationChanged();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPage::setMinimumLayoutSizeForMinimalUI(const FloatSize&amp; size)
</del><ins>+void WebPage::setViewportConfigurationMinimumLayoutSizeForMinimalUI(const FloatSize&amp; size)
</ins><span class="cx"> {
</span><del>-    resetTextAutosizingBeforeLayoutIfNeeded(m_minimumLayoutSizeForMinimalUI, size);
-    m_minimumLayoutSizeForMinimalUI = size;
</del><ins>+    resetTextAutosizingBeforeLayoutIfNeeded(m_viewportConfiguration.minimumLayoutSizeForMinimalUI(), size);
+    m_viewportConfiguration.setMinimumLayoutSizeForMinimalUI(size);
</ins><span class="cx">     viewportConfigurationChanged();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebPage::setMaximumUnobscuredSize(const FloatSize&amp; maximumUnobscuredSize)
+{
+    m_maximumUnobscuredSize = maximumUnobscuredSize;
+    updateViewportSizeForCSSViewportUnits();
+}
+
</ins><span class="cx"> static inline bool withinEpsilon(float a, float b)
</span><span class="cx"> {
</span><span class="cx">     return fabs(a - b) &lt; std::numeric_limits&lt;float&gt;::epsilon();
</span><span class="lines">@@ -1940,7 +1950,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPage::dynamicViewportSizeUpdate(const FloatSize&amp; minimumLayoutSize, const FloatRect&amp; targetExposedContentRect, const FloatRect&amp; targetUnobscuredRect, const WebCore::FloatRect&amp; targetUnobscuredRectInScrollViewCoordinates, double targetScale)
</del><ins>+void WebPage::dynamicViewportSizeUpdate(const FloatSize&amp; minimumLayoutSize, const FloatSize&amp; minimumLayoutSizeForMinimalUI, const WebCore::FloatSize&amp; maximumUnobscuredSize, const FloatRect&amp; targetExposedContentRect, const FloatRect&amp; targetUnobscuredRect, const WebCore::FloatRect&amp; targetUnobscuredRectInScrollViewCoordinates, 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">@@ -1979,9 +1989,14 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     resetTextAutosizingBeforeLayoutIfNeeded(m_viewportConfiguration.minimumLayoutSize(), minimumLayoutSize);
</span><ins>+    resetTextAutosizingBeforeLayoutIfNeeded(m_viewportConfiguration.minimumLayoutSizeForMinimalUI(), minimumLayoutSizeForMinimalUI);
</ins><span class="cx">     m_viewportConfiguration.setMinimumLayoutSize(minimumLayoutSize);
</span><ins>+    m_viewportConfiguration.setMinimumLayoutSizeForMinimalUI(minimumLayoutSizeForMinimalUI);
</ins><span class="cx">     IntSize newLayoutSize = m_viewportConfiguration.layoutSize();
</span><ins>+
</ins><span class="cx">     setFixedLayoutSize(newLayoutSize);
</span><ins>+    setMaximumUnobscuredSize(maximumUnobscuredSize);
+
</ins><span class="cx">     frameView.updateLayoutAndStyleIfNeededRecursive();
</span><span class="cx"> 
</span><span class="cx">     IntSize newContentSize = frameView.contentsSize();
</span><span class="lines">@@ -2152,14 +2167,12 @@
</span><span class="cx"> 
</span><span class="cx">     m_page-&gt;setZoomedOutPageScaleFactor(m_viewportConfiguration.minimumScale());
</span><span class="cx"> 
</span><ins>+    updateViewportSizeForCSSViewportUnits();
+
</ins><span class="cx">     FrameView&amp; frameView = *mainFrameView();
</span><del>-    FloatSize viewportSize = !m_minimumLayoutSizeForMinimalUI.isEmpty() ? m_minimumLayoutSizeForMinimalUI : m_viewportConfiguration.minimumLayoutSize();
-    viewportSize.scale(1 / initialScale);
-    frameView.setViewportSize(roundedIntSize(viewportSize));
-    
</del><span class="cx">     IntPoint scrollPosition = frameView.scrollPosition();
</span><span class="cx">     if (!m_hasReceivedVisibleContentRectsAfterDidCommitLoad) {
</span><del>-        FloatSize minimumLayoutSizeInScrollViewCoordinates = m_viewportConfiguration.minimumLayoutSize();
</del><ins>+        FloatSize minimumLayoutSizeInScrollViewCoordinates = m_viewportConfiguration.activeMinimumLayoutSizeInScrollViewCoordinates();
</ins><span class="cx">         minimumLayoutSizeInScrollViewCoordinates.scale(1 / scale);
</span><span class="cx">         IntSize minimumLayoutSizeInDocumentCoordinates = roundedIntSize(minimumLayoutSizeInScrollViewCoordinates);
</span><span class="cx">         IntRect unobscuredContentRect(scrollPosition, minimumLayoutSizeInDocumentCoordinates);
</span><span class="lines">@@ -2176,10 +2189,21 @@
</span><span class="cx">         // This takes scale into account, so do after the scale change.
</span><span class="cx">         frameView.setCustomFixedPositionLayoutRect(enclosingIntRect(frameView.viewportConstrainedObjectsRect()));
</span><span class="cx"> 
</span><del>-        frameView.setCustomSizeForResizeEvent(expandedIntSize(m_viewportConfiguration.minimumLayoutSize()));
</del><ins>+        frameView.setCustomSizeForResizeEvent(expandedIntSize(m_viewportConfiguration.activeMinimumLayoutSizeInScrollViewCoordinates()));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebPage::updateViewportSizeForCSSViewportUnits()
+{
+    FloatSize largestUnobscuredRect = m_maximumUnobscuredSize;
+    if (largestUnobscuredRect.isEmpty())
+        largestUnobscuredRect = m_viewportConfiguration.minimumLayoutSizeForMinimalUI();
+
+    FrameView&amp; frameView = *mainFrameView();
+    largestUnobscuredRect.scale(1 / m_viewportConfiguration.initialScale());
+    frameView.setViewportSizeForCSSViewportUnits(roundedIntSize(largestUnobscuredRect));
+}
+
</ins><span class="cx"> void WebPage::applicationWillResignActive()
</span><span class="cx"> {
</span><span class="cx">     [[NSNotificationCenter defaultCenter] postNotificationName:WebUIApplicationWillResignActiveNotification object:nil];
</span></span></pre>
</div>
</div>

</body>
</html>