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

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

<h3>Log Message</h3>
<pre>[iOS][WK2] Add SPI to do a dynamic viewport update without showing any content
https://bugs.webkit.org/show_bug.cgi?id=135010

Reviewed by Darin Adler.

This patch add a new SPI, [WKWebView _resizeWhileHidingContentWithUpdates:] to perform all the work
of a dynamic viewport size update, but instead of animating the old content, it is hidden.

The patch is built on top of the animated resize mechanism. Instead of having an animation driving
the beginning and end, we let the content do that. The dynamic resize begins, it runs for as long as
the WebProcess needs, and it ends when first layer tree commit with the new content is processed.

The attribute &quot;_isAnimatingResize&quot; is generalized to support two modes of resizing: animated and
hiding content.

The attribute &quot;_hasCommittedLoadForMainFrame&quot; is rather silly. It is only needed because
[WKWebView _resizeWhileHidingContentWithUpdates:] is intended to be called a lot before the page
is initialized, and doing an animated resize would trash the WebProcess state.
I wish I had a better solution, this is not great.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _processDidExit]):
(-[WKWebView _didCommitLoadForMainFrame]):
(-[WKWebView _didCommitLayerTree:]):
This is the key to make this work properly. We want _resizeWhileHidingContentWithUpdates: to behave
exactly like an animated resize to avoid bugs. So we went to the whole update mechanism using
_resizeAnimationTransformAdjustments to accumulate the adjustments, now we need to restore a correct
view state.

Calling [WKWebView _endAnimatedResize] will do exactly that, but we need to make sure we do not hit
the synchronization path or we would be blocked there for a while, which is what we are trying to avoid.

After <a href="http://trac.webkit.org/projects/webkit/changeset/171154">r171154</a>, WebPageProxy keeps track of what stage of dynamic viewport update we are in. Since we are
executing the layer tree update stage, with the right transaction ID, WebPageProxy already knows we have
everything we need and does not use any synchronous messages.

(-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
(-[WKWebView _restorePageStateToExposedRect:scale:]):
(-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
(-[WKWebView _scrollToContentOffset:]):
(-[WKWebView _frameOrBoundsChanged]):
(-[WKWebView _updateVisibleContentRects]):
(-[WKWebView _setMinimumLayoutSizeOverride:]):
(-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]):
(-[WKWebView _setInterfaceOrientationOverride:]):
(-[WKWebView _setMaximumUnobscuredSizeOverride:]):
(-[WKWebView _beginAnimatedResizeWithUpdates:]):
(-[WKWebView _endAnimatedResize]):
(-[WKWebView _resizeWhileHidingContentWithUpdates:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewPrivateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (171200 => 171201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-07-17 22:02:26 UTC (rev 171200)
+++ trunk/Source/WebKit2/ChangeLog        2014-07-17 22:08:41 UTC (rev 171201)
</span><span class="lines">@@ -1,3 +1,56 @@
</span><ins>+2014-07-17  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
+
+        [iOS][WK2] Add SPI to do a dynamic viewport update without showing any content
+        https://bugs.webkit.org/show_bug.cgi?id=135010
+
+        Reviewed by Darin Adler.
+
+        This patch add a new SPI, [WKWebView _resizeWhileHidingContentWithUpdates:] to perform all the work
+        of a dynamic viewport size update, but instead of animating the old content, it is hidden.
+
+        The patch is built on top of the animated resize mechanism. Instead of having an animation driving
+        the beginning and end, we let the content do that. The dynamic resize begins, it runs for as long as
+        the WebProcess needs, and it ends when first layer tree commit with the new content is processed.
+
+        The attribute &quot;_isAnimatingResize&quot; is generalized to support two modes of resizing: animated and
+        hiding content.
+
+        The attribute &quot;_hasCommittedLoadForMainFrame&quot; is rather silly. It is only needed because
+        [WKWebView _resizeWhileHidingContentWithUpdates:] is intended to be called a lot before the page
+        is initialized, and doing an animated resize would trash the WebProcess state.
+        I wish I had a better solution, this is not great.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _processDidExit]):
+        (-[WKWebView _didCommitLoadForMainFrame]):
+        (-[WKWebView _didCommitLayerTree:]):
+        This is the key to make this work properly. We want _resizeWhileHidingContentWithUpdates: to behave
+        exactly like an animated resize to avoid bugs. So we went to the whole update mechanism using
+        _resizeAnimationTransformAdjustments to accumulate the adjustments, now we need to restore a correct
+        view state.
+
+        Calling [WKWebView _endAnimatedResize] will do exactly that, but we need to make sure we do not hit
+        the synchronization path or we would be blocked there for a while, which is what we are trying to avoid.
+
+        After r171154, WebPageProxy keeps track of what stage of dynamic viewport update we are in. Since we are
+        executing the layer tree update stage, with the right transaction ID, WebPageProxy already knows we have
+        everything we need and does not use any synchronous messages.
+
+        (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
+        (-[WKWebView _restorePageStateToExposedRect:scale:]):
+        (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
+        (-[WKWebView _scrollToContentOffset:]):
+        (-[WKWebView _frameOrBoundsChanged]):
+        (-[WKWebView _updateVisibleContentRects]):
+        (-[WKWebView _setMinimumLayoutSizeOverride:]):
+        (-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]):
+        (-[WKWebView _setInterfaceOrientationOverride:]):
+        (-[WKWebView _setMaximumUnobscuredSizeOverride:]):
+        (-[WKWebView _beginAnimatedResizeWithUpdates:]):
+        (-[WKWebView _endAnimatedResize]):
+        (-[WKWebView _resizeWhileHidingContentWithUpdates:]):
+        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+
</ins><span class="cx"> 2014-07-17  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Mac] Full screen video not always animating in the correct Space
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (171200 => 171201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2014-07-17 22:02:26 UTC (rev 171200)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2014-07-17 22:08:41 UTC (rev 171201)
</span><span class="lines">@@ -118,6 +118,13 @@
</span><span class="cx"> - (UIViewController *)_rootAncestorViewController;
</span><span class="cx"> - (UIViewController *)_viewControllerForSupportedInterfaceOrientations;
</span><span class="cx"> @end
</span><ins>+
+enum class DynamicViewportUpdateMode {
+    NotResizing,
+    ResizingWithAnimation,
+    ResizingWithDocumentHidden,
+};
+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="lines">@@ -166,9 +173,10 @@
</span><span class="cx">     UIInterfaceOrientation _interfaceOrientationOverride;
</span><span class="cx">     BOOL _overridesInterfaceOrientation;
</span><span class="cx"> 
</span><ins>+    BOOL _hasCommittedLoadForMainFrame;
</ins><span class="cx">     BOOL _needsResetViewStateAfterCommitLoadForMainFrame;
</span><span class="cx">     uint64_t _firstPaintAfterCommitLoadTransactionID;
</span><del>-    BOOL _isAnimatingResize;
</del><ins>+    DynamicViewportUpdateMode _dynamicViewportUpdateMode;
</ins><span class="cx">     CATransform3D _resizeAnimationTransformAdjustments;
</span><span class="cx">     uint64_t _resizeAnimationTransformTransactionID;
</span><span class="cx">     RetainPtr&lt;UIView&gt; _resizeAnimationView;
</span><span class="lines">@@ -740,14 +748,13 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_processDidExit
</span><span class="cx"> {
</span><del>-    if (!_customContentView &amp;&amp; _isAnimatingResize) {
</del><ins>+    if (!_customContentView &amp;&amp; _dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing) {
</ins><span class="cx">         NSUInteger indexOfResizeAnimationView = [[_scrollView subviews] indexOfObject:_resizeAnimationView.get()];
</span><span class="cx">         [_scrollView insertSubview:_contentView.get() atIndex:indexOfResizeAnimationView];
</span><span class="cx">         [_scrollView insertSubview:[_contentView unscaledView] atIndex:indexOfResizeAnimationView + 1];
</span><span class="cx">         [_resizeAnimationView removeFromSuperview];
</span><span class="cx">         _resizeAnimationView = nil;
</span><span class="cx"> 
</span><del>-        _isAnimatingResize = NO;
</del><span class="cx">         _resizeAnimationTransformAdjustments = CATransform3DIdentity;
</span><span class="cx">     }
</span><span class="cx">     [_contentView setFrame:self.bounds];
</span><span class="lines">@@ -756,7 +763,10 @@
</span><span class="cx">     [_scrollView setZoomScale:1];
</span><span class="cx"> 
</span><span class="cx">     _viewportMetaTagWidth = -1;
</span><ins>+    _hasCommittedLoadForMainFrame = NO;
</ins><span class="cx">     _needsResetViewStateAfterCommitLoadForMainFrame = NO;
</span><ins>+    _dynamicViewportUpdateMode = DynamicViewportUpdateMode::NotResizing;
+    [_contentView setHidden:NO];
</ins><span class="cx">     _needsToRestoreExposedRect = NO;
</span><span class="cx">     _needsToRestoreUnobscuredCenter = NO;
</span><span class="cx">     _scrollViewBackgroundColor = WebCore::Color();
</span><span class="lines">@@ -768,6 +778,7 @@
</span><span class="cx"> {
</span><span class="cx">     _firstPaintAfterCommitLoadTransactionID = toRemoteLayerTreeDrawingAreaProxy(_page-&gt;drawingArea())-&gt;nextLayerTreeTransactionID();
</span><span class="cx"> 
</span><ins>+    _hasCommittedLoadForMainFrame = YES;
</ins><span class="cx">     _needsResetViewStateAfterCommitLoadForMainFrame = YES;
</span><span class="cx">     _usesMinimalUI = NO;
</span><span class="cx"> }
</span><span class="lines">@@ -804,9 +815,14 @@
</span><span class="cx">     if (_customContentView)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (_isAnimatingResize) {
-        if (layerTreeTransaction.transactionID() &gt;= _resizeAnimationTransformTransactionID)
</del><ins>+    if (_dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing) {
+        if (layerTreeTransaction.transactionID() &gt;= _resizeAnimationTransformTransactionID) {
</ins><span class="cx">             [_resizeAnimationView layer].sublayerTransform = _resizeAnimationTransformAdjustments;
</span><ins>+            if (_dynamicViewportUpdateMode == DynamicViewportUpdateMode::ResizingWithDocumentHidden) {
+                [_contentView setHidden:NO];
+                [self _endAnimatedResize];
+            }
+        }
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -869,7 +885,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_dynamicViewportUpdateChangedTargetToScale:(double)newScale position:(CGPoint)newScrollPosition nextValidLayerTreeTransactionID:(uint64_t)nextValidLayerTreeTransactionID
</span><span class="cx"> {
</span><del>-    if (_isAnimatingResize) {
</del><ins>+    if (_dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing) {
</ins><span class="cx">         CGFloat animatingScaleTarget = [[_resizeAnimationView layer] transform].m11;
</span><span class="cx">         double currentTargetScale = animatingScaleTarget * [[_contentView layer] transform].m11;
</span><span class="cx">         double scale = newScale / currentTargetScale;
</span><span class="lines">@@ -886,7 +902,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_restorePageStateToExposedRect:(WebCore::FloatRect)exposedRect scale:(double)scale
</span><span class="cx"> {
</span><del>-    if (_isAnimatingResize)
</del><ins>+    if (_dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (_customContentView)
</span><span class="lines">@@ -901,7 +917,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_restorePageStateToUnobscuredCenter:(WebCore::FloatPoint)center scale:(double)scale
</span><span class="cx"> {
</span><del>-    if (_isAnimatingResize)
</del><ins>+    if (_dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (_customContentView)
</span><span class="lines">@@ -987,7 +1003,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_scrollToContentOffset:(WebCore::FloatPoint)contentOffset
</span><span class="cx"> {
</span><del>-    if (_isAnimatingResize)
</del><ins>+    if (_dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     WebCore::FloatPoint scaledOffset = contentOffset;
</span><span class="lines">@@ -1332,7 +1348,7 @@
</span><span class="cx">     CGRect bounds = self.bounds;
</span><span class="cx">     [_scrollView setFrame:bounds];
</span><span class="cx"> 
</span><del>-    if (!_isAnimatingResize) {
</del><ins>+    if (_dynamicViewportUpdateMode == DynamicViewportUpdateMode::NotResizing) {
</ins><span class="cx">         if (!_overridesMinimumLayoutSize)
</span><span class="cx">             _page-&gt;setViewportConfigurationMinimumLayoutSize(WebCore::FloatSize(bounds.size));
</span><span class="cx">         if (!_overridesMinimumLayoutSizeForMinimalUI)
</span><span class="lines">@@ -1368,7 +1384,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (_isAnimatingResize)
</del><ins>+    if (_dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (_needsResetViewStateAfterCommitLoadForMainFrame)
</span><span class="lines">@@ -2027,7 +2043,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     _minimumLayoutSizeOverride = minimumLayoutSizeOverride;
</span><del>-    if (!_isAnimatingResize)
</del><ins>+    if (_dynamicViewportUpdateMode == DynamicViewportUpdateMode::NotResizing)
</ins><span class="cx">         _page-&gt;setViewportConfigurationMinimumLayoutSize(WebCore::FloatSize(minimumLayoutSizeOverride));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2044,7 +2060,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     _minimumLayoutSizeOverrideForMinimalUI = size;
</span><del>-    if (!_isAnimatingResize)
</del><ins>+    if (_dynamicViewportUpdateMode == DynamicViewportUpdateMode::NotResizing)
</ins><span class="cx">         _page-&gt;setViewportConfigurationMinimumLayoutSizeForMinimalUI(WebCore::FloatSize(size));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2080,7 +2096,7 @@
</span><span class="cx"> 
</span><span class="cx">     _interfaceOrientationOverride = interfaceOrientation;
</span><span class="cx"> 
</span><del>-    if (!_isAnimatingResize)
</del><ins>+    if (_dynamicViewportUpdateMode == DynamicViewportUpdateMode::NotResizing)
</ins><span class="cx">         _page-&gt;setDeviceOrientation(deviceOrientationForUIInterfaceOrientation(_interfaceOrientationOverride));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2104,7 +2120,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     _maximumUnobscuredSizeOverride = size;
</span><del>-    if (!_isAnimatingResize)
</del><ins>+    if (_dynamicViewportUpdateMode == DynamicViewportUpdateMode::NotResizing)
</ins><span class="cx">         _page-&gt;setMaximumUnobscuredSize(WebCore::FloatSize(size));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2133,12 +2149,12 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_beginAnimatedResizeWithUpdates:(void (^)(void))updateBlock
</span><span class="cx"> {
</span><del>-    if (_customContentView) {
</del><ins>+    if (_customContentView || !_hasCommittedLoadForMainFrame) {
</ins><span class="cx">         updateBlock();
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    _isAnimatingResize = YES;
</del><ins>+    _dynamicViewportUpdateMode = DynamicViewportUpdateMode::ResizingWithAnimation;
</ins><span class="cx"> 
</span><span class="cx">     CGRect oldBounds = self.bounds;
</span><span class="cx">     WebCore::FloatSize oldMinimumLayoutSize = activeMinimumLayoutSize(self, oldBounds);
</span><span class="lines">@@ -2163,7 +2179,7 @@
</span><span class="cx">         &amp;&amp; oldMaximumUnobscuredSize == newMaximumUnobscuredSize
</span><span class="cx">         &amp;&amp; oldOrientation == newOrientation
</span><span class="cx">         &amp;&amp; UIEdgeInsetsEqualToEdgeInsets(oldObscuredInsets, newObscuredInsets)) {
</span><del>-        _isAnimatingResize = NO;
</del><ins>+        _dynamicViewportUpdateMode = DynamicViewportUpdateMode::NotResizing;
</ins><span class="cx">         [self _updateVisibleContentRects];
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -2227,7 +2243,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_endAnimatedResize
</span><span class="cx"> {
</span><del>-    if (!_isAnimatingResize)
</del><ins>+    if (_dynamicViewportUpdateMode == DynamicViewportUpdateMode::NotResizing)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     _page-&gt;synchronizeDynamicViewportUpdate();
</span><span class="lines">@@ -2265,10 +2281,20 @@
</span><span class="cx">     _resizeAnimationView = nil;
</span><span class="cx">     _resizeAnimationTransformAdjustments = CATransform3DIdentity;
</span><span class="cx"> 
</span><del>-    _isAnimatingResize = NO;
</del><ins>+    _dynamicViewportUpdateMode = DynamicViewportUpdateMode::NotResizing;
+    [_contentView setHidden:NO];
</ins><span class="cx">     [self _updateVisibleContentRects];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)_resizeWhileHidingContentWithUpdates:(void (^)(void))updateBlock
+{
+    [self _beginAnimatedResizeWithUpdates:updateBlock];
+    if (_dynamicViewportUpdateMode == DynamicViewportUpdateMode::ResizingWithAnimation) {
+        [_contentView setHidden:YES];
+        _dynamicViewportUpdateMode = DynamicViewportUpdateMode::ResizingWithDocumentHidden;
+    }
+}
+
</ins><span class="cx"> - (void)_setOverlaidAccessoryViewsInset:(CGSize)inset
</span><span class="cx"> {
</span><span class="cx">     [_customContentView web_setOverlaidAccessoryViewsInset:inset];
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h (171200 => 171201)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h        2014-07-17 22:02:26 UTC (rev 171200)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h        2014-07-17 22:08:41 UTC (rev 171201)
</span><span class="lines">@@ -137,6 +137,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_beginAnimatedResizeWithUpdates:(void (^)(void))updateBlock;
</span><span class="cx"> - (void)_endAnimatedResize;
</span><ins>+- (void)_resizeWhileHidingContentWithUpdates:(void (^)(void))updateBlock;
</ins><span class="cx"> 
</span><span class="cx"> - (void)_snapshotRect:(CGRect)rectInViewCoordinates intoImageOfWidth:(CGFloat)imageWidth completionHandler:(void(^)(CGImageRef))completionHandler;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>