<!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>[170744] 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/170744">170744</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2014-07-02 20:52:21 -0700 (Wed, 02 Jul 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[iOS][WK2] Make is safe/fast to use the animated resize API without resizing anything
https://bugs.webkit.org/show_bug.cgi?id=134570

Reviewed by Enrica Casucci.

Today, if someone calls _beginAnimatedResizeWithUpdates-_endAnimatedResize, it is always a very heavy process
forcing a relayout and can cause synchronous operations.

We should not force the caller of the API to maintain their own state tracking, we should do that for them.

With this patch, we track everything we need for a resize and only do the heavy lifting if anything has actually changed.

* UIProcess/API/Cocoa/WKWebView.mm:
(activeMinimumLayoutSize):
(activeMinimumLayoutSizeForMinimalUI):
(activeMaximumUnobscuredSize):
(activeOrientation):
This code is used in both _didRelaunchProcess and _beginAnimatedResizeWithUpdates. It is moved to static functions
to avoid having it in two places.

(-[WKWebView _didRelaunchProcess]):

(-[WKWebView _beginAnimatedResizeWithUpdates:]):
The updates now goes like this:
1) Set _isAnimatingResize to prevent the undesired side effects updateBlock() if we really need to resize.
2) Get all the original values before calling the update block.
3) Call the update block.
4a) If nothing useful for resize has changed, reset _isAnimatingResize to false.
    We also need to update the visible content rect because the update block may have changed something unrelated
    to the view size (scale, scroll position, etc).
4b) If we really need to resize, proceed as usual.

(-[WKWebView _endAnimatedResize]):
With the changes in _beginAnimatedResizeWithUpdates:, _isAnimatingResize is only set for real cases of animated resize,
bail out early if that flag isn't set.

The remaining code is unchanged, it is just not indented due to the removal of the if() branch.</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>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (170743 => 170744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-07-03 03:31:05 UTC (rev 170743)
+++ trunk/Source/WebKit2/ChangeLog        2014-07-03 03:52:21 UTC (rev 170744)
</span><span class="lines">@@ -1,3 +1,43 @@
</span><ins>+2014-07-02  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
+
+        [iOS][WK2] Make is safe/fast to use the animated resize API without resizing anything
+        https://bugs.webkit.org/show_bug.cgi?id=134570
+
+        Reviewed by Enrica Casucci.
+
+        Today, if someone calls _beginAnimatedResizeWithUpdates-_endAnimatedResize, it is always a very heavy process
+        forcing a relayout and can cause synchronous operations.
+
+        We should not force the caller of the API to maintain their own state tracking, we should do that for them.
+
+        With this patch, we track everything we need for a resize and only do the heavy lifting if anything has actually changed.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (activeMinimumLayoutSize):
+        (activeMinimumLayoutSizeForMinimalUI):
+        (activeMaximumUnobscuredSize):
+        (activeOrientation):
+        This code is used in both _didRelaunchProcess and _beginAnimatedResizeWithUpdates. It is moved to static functions
+        to avoid having it in two places.
+
+        (-[WKWebView _didRelaunchProcess]):
+
+        (-[WKWebView _beginAnimatedResizeWithUpdates:]):
+        The updates now goes like this:
+        1) Set _isAnimatingResize to prevent the undesired side effects updateBlock() if we really need to resize.
+        2) Get all the original values before calling the update block.
+        3) Call the update block.
+        4a) If nothing useful for resize has changed, reset _isAnimatingResize to false.
+            We also need to update the visible content rect because the update block may have changed something unrelated
+            to the view size (scale, scroll position, etc).
+        4b) If we really need to resize, proceed as usual.
+
+        (-[WKWebView _endAnimatedResize]):
+        With the changes in _beginAnimatedResizeWithUpdates:, _isAnimatingResize is only set for real cases of animated resize,
+        bail out early if that flag isn't set.
+
+        The remaining code is unchanged, it is just not indented due to the removal of the if() branch.
+
</ins><span class="cx"> 2014-07-02  Roger Fong  &lt;roger_fong@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Improve handling of primary offscreen plugins.
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (170743 => 170744)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2014-07-03 03:31:05 UTC (rev 170743)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2014-07-03 03:52:21 UTC (rev 170744)
</span><span class="lines">@@ -1553,13 +1553,36 @@
</span><span class="cx">     _page-&gt;process().terminate();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+static WebCore::FloatSize activeMinimumLayoutSize(WKWebView *webView, const CGRect&amp; bounds)
+{
+    return WebCore::FloatSize(webView-&gt;_overridesMinimumLayoutSize ? webView-&gt;_minimumLayoutSizeOverride : bounds.size);
+}
+
+static WebCore::FloatSize activeMinimumLayoutSizeForMinimalUI(WKWebView *webView, WebCore::FloatSize minimumLayoutSize)
+{
+    return webView-&gt;_overridesMinimumLayoutSizeForMinimalUI ? WebCore::FloatSize(webView-&gt;_minimumLayoutSizeOverrideForMinimalUI) : minimumLayoutSize;
+}
+
+static WebCore::FloatSize activeMaximumUnobscuredSize(WKWebView *webView, const CGRect&amp; bounds)
+{
+    return WebCore::FloatSize(webView-&gt;_overridesMaximumUnobscuredSize ? webView-&gt;_maximumUnobscuredSizeOverride : bounds.size);
+}
+
+static int32_t activeOrientation(WKWebView *webView)
+{
+    return webView-&gt;_overridesInterfaceOrientation ? deviceOrientationForUIInterfaceOrientation(webView-&gt;_interfaceOrientationOverride) : webView-&gt;_page-&gt;deviceOrientation();
+}
+#endif
+
</ins><span class="cx"> - (void)_didRelaunchProcess
</span><span class="cx"> {
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-    WebCore::FloatSize boundsSize(self.bounds.size);
-    _page-&gt;setViewportConfigurationMinimumLayoutSize(_overridesMinimumLayoutSize ? WebCore::FloatSize(_minimumLayoutSizeOverride) : boundsSize);
-    _page-&gt;setViewportConfigurationMinimumLayoutSizeForMinimalUI(_overridesMinimumLayoutSizeForMinimalUI ? WebCore::FloatSize(_minimumLayoutSizeOverrideForMinimalUI) : boundsSize);
-    _page-&gt;setMaximumUnobscuredSize(_overridesMaximumUnobscuredSize ? WebCore::FloatSize(_maximumUnobscuredSizeOverride) : boundsSize);
</del><ins>+    CGRect bounds = self.bounds;
+    WebCore::FloatSize minimalLayoutSize = activeMinimumLayoutSize(self, bounds);
+    _page-&gt;setViewportConfigurationMinimumLayoutSize(minimalLayoutSize);
+    _page-&gt;setViewportConfigurationMinimumLayoutSizeForMinimalUI(activeMinimumLayoutSizeForMinimalUI(self, minimalLayoutSize));
+    _page-&gt;setMaximumUnobscuredSize(activeMaximumUnobscuredSize(self, bounds));
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2026,34 +2049,56 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_beginAnimatedResizeWithUpdates:(void (^)(void))updateBlock
</span><span class="cx"> {
</span><del>-    _isAnimatingResize = YES;
-
</del><span class="cx">     if (_customContentView) {
</span><span class="cx">         updateBlock();
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    _isAnimatingResize = YES;
+
+    CGRect oldBounds = self.bounds;
+    WebCore::FloatSize oldMinimumLayoutSize = activeMinimumLayoutSize(self, oldBounds);
+    WebCore::FloatSize oldMinimumLayoutSizeForMinimalUI = activeMinimumLayoutSizeForMinimalUI(self, oldMinimumLayoutSize);
+    WebCore::FloatSize oldMaximumUnobscuredSize = activeMaximumUnobscuredSize(self, oldBounds);
+    int32_t oldOrientation = activeOrientation(self);
+    UIEdgeInsets oldObscuredInsets = _obscuredInsets;
+    WebCore::FloatRect oldUnobscuredContentRect = _page-&gt;unobscuredContentRect();
+
+    updateBlock();
+
+    CGRect newBounds = self.bounds;
+    WebCore::FloatSize newMinimumLayoutSize = activeMinimumLayoutSize(self, newBounds);
+    WebCore::FloatSize newMinimumLayoutSizeForMinimalUI = activeMinimumLayoutSizeForMinimalUI(self, newMinimumLayoutSize);
+    WebCore::FloatSize newMaximumUnobscuredSize = activeMaximumUnobscuredSize(self, newBounds);
+    int32_t newOrientation = activeOrientation(self);
+    UIEdgeInsets newObscuredInsets = _obscuredInsets;
+
+    if (CGRectEqualToRect(oldBounds, newBounds)
+        &amp;&amp; oldMinimumLayoutSize == newMinimumLayoutSize
+        &amp;&amp; oldMinimumLayoutSizeForMinimalUI == newMinimumLayoutSizeForMinimalUI
+        &amp;&amp; oldMaximumUnobscuredSize == newMaximumUnobscuredSize
+        &amp;&amp; oldOrientation == newOrientation
+        &amp;&amp; UIEdgeInsetsEqualToEdgeInsets(oldObscuredInsets, newObscuredInsets)) {
+        _isAnimatingResize = NO;
+        [self _updateVisibleContentRects];
+        return;
+    }
+
</ins><span class="cx">     _resizeAnimationTransformAdjustments = CATransform3DIdentity;
</span><span class="cx"> 
</span><span class="cx">     NSUInteger indexOfContentView = [[_scrollView subviews] indexOfObject:_contentView.get()];
</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>-    WebCore::FloatRect oldUnobscuredContentRect = _page-&gt;unobscuredContentRect();
</del><span class="cx"> 
</span><del>-    updateBlock();
-
-    CGRect newBounds = self.bounds;
-    CGSize newMinimumLayoutSize = newBounds.size;
-
</del><span class="cx">     CGSize contentSizeInContentViewCoordinates = [_contentView bounds].size;
</span><del>-    [_scrollView setMinimumZoomScale:std::min(newMinimumLayoutSize.width / contentSizeInContentViewCoordinates.width, [_scrollView minimumZoomScale])];
-    [_scrollView setMaximumZoomScale:std::max(newMinimumLayoutSize.width / contentSizeInContentViewCoordinates.width, [_scrollView maximumZoomScale])];
</del><ins>+    [_scrollView setMinimumZoomScale:std::min(newMinimumLayoutSize.width() / contentSizeInContentViewCoordinates.width, [_scrollView minimumZoomScale])];
+    [_scrollView setMaximumZoomScale:std::max(newMinimumLayoutSize.width() / contentSizeInContentViewCoordinates.width, [_scrollView maximumZoomScale])];
</ins><span class="cx"> 
</span><span class="cx">     // Compute the new scale to keep the current content width in the scrollview.
</span><span class="cx">     CGFloat oldWebViewWidthInContentViewCoordinates = oldUnobscuredContentRect.width();
</span><span class="cx">     CGFloat visibleContentViewWidthInContentCoordinates = std::min(contentSizeInContentViewCoordinates.width, oldWebViewWidthInContentViewCoordinates);
</span><del>-    CGFloat targetScale = newMinimumLayoutSize.width / visibleContentViewWidthInContentCoordinates;
</del><ins>+    CGFloat targetScale = newMinimumLayoutSize.width() / visibleContentViewWidthInContentCoordinates;
</ins><span class="cx">     CGFloat resizeAnimationViewAnimationScale = targetScale / contentZoomScale(self);
</span><span class="cx">     [_resizeAnimationView setTransform:CGAffineTransformMakeScale(resizeAnimationViewAnimationScale, resizeAnimationViewAnimationScale)];
</span><span class="cx"> 
</span><span class="lines">@@ -2091,68 +2136,49 @@
</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>-    CGSize minimumLayoutSize = newBounds.size;
-    if (_overridesMinimumLayoutSize)
-        minimumLayoutSize = _minimumLayoutSizeOverride;
-
-    CGSize minimumLayoutSizeForMinimalUI = minimumLayoutSize;
-    if (_overridesMinimumLayoutSizeForMinimalUI)
-        minimumLayoutSizeForMinimalUI = _minimumLayoutSizeOverrideForMinimalUI;
-
-    CGSize maximumUnobscuredSize = newBounds.size;
-    if (_overridesMaximumUnobscuredSize)
-        maximumUnobscuredSize = _maximumUnobscuredSizeOverride;
-
-    int32_t orientation;
-    if (_overridesInterfaceOrientation)
-        orientation = deviceOrientationForUIInterfaceOrientation(_interfaceOrientationOverride);
-    else
-        orientation = _page-&gt;deviceOrientation();
-
-    _page-&gt;dynamicViewportSizeUpdate(WebCore::FloatSize(minimumLayoutSize), WebCore::FloatSize(minimumLayoutSizeForMinimalUI), WebCore::FloatSize(maximumUnobscuredSize), visibleRectInContentCoordinates, unobscuredRectInContentCoordinates, futureUnobscuredRectInSelfCoordinates, targetScale, orientation);
</del><ins>+    _page-&gt;dynamicViewportSizeUpdate(newMinimumLayoutSize, newMinimumLayoutSizeForMinimalUI, newMaximumUnobscuredSize, visibleRectInContentCoordinates, unobscuredRectInContentCoordinates, futureUnobscuredRectInSelfCoordinates, targetScale, newOrientation);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_endAnimatedResize
</span><span class="cx"> {
</span><ins>+    if (!_isAnimatingResize)
+        return;
+
</ins><span class="cx">     _page-&gt;synchronizeDynamicViewportUpdate();
</span><span class="cx"> 
</span><del>-    if (!_customContentView &amp;&amp; _isAnimatingResize) {
-        NSUInteger indexOfResizeAnimationView = [[_scrollView subviews] indexOfObject:_resizeAnimationView.get()];
-        [_scrollView insertSubview:_contentView.get() atIndex:indexOfResizeAnimationView];
</del><ins>+    NSUInteger indexOfResizeAnimationView = [[_scrollView subviews] indexOfObject:_resizeAnimationView.get()];
+    [_scrollView insertSubview:_contentView.get() atIndex:indexOfResizeAnimationView];
</ins><span class="cx"> 
</span><del>-        CALayer *contentViewLayer = [_contentView layer];
-        CATransform3D resizeAnimationTransformAdjustements = _resizeAnimationTransformAdjustments;
-        CGFloat adjustmentScale = resizeAnimationTransformAdjustements.m11;
-        contentViewLayer.sublayerTransform = CATransform3DIdentity;
</del><ins>+    CALayer *contentViewLayer = [_contentView layer];
+    CGFloat adjustmentScale = _resizeAnimationTransformAdjustments.m11;
+    contentViewLayer.sublayerTransform = CATransform3DIdentity;
</ins><span class="cx"> 
</span><del>-        CGFloat animatingScaleTarget = [[_resizeAnimationView layer] transform].m11;
-        CALayer *contentLayer = [_contentView layer];
-        CATransform3D contentLayerTransform = contentLayer.transform;
-        CGFloat currentScale = [[_resizeAnimationView layer] transform].m11 * contentLayerTransform.m11;
</del><ins>+    CGFloat animatingScaleTarget = [[_resizeAnimationView layer] transform].m11;
+    CALayer *contentLayer = [_contentView layer];
+    CATransform3D contentLayerTransform = contentLayer.transform;
+    CGFloat currentScale = [[_resizeAnimationView layer] transform].m11 * contentLayerTransform.m11;
</ins><span class="cx"> 
</span><del>-        // We cannot use [UIScrollView setZoomScale:] directly because the UIScrollView delegate would get a callback with
-        // an invalid contentOffset. The real content offset is only set below.
-        // Since there is no public API for setting both the zoomScale and the contentOffset, we set the zoomScale manually
-        // on the zoom layer and then only change the contentOffset.
-        CGFloat adjustedScale = adjustmentScale * currentScale;
-        contentLayerTransform.m11 = adjustedScale;
-        contentLayerTransform.m22 = adjustedScale;
-        contentLayer.transform = contentLayerTransform;
</del><ins>+    // We cannot use [UIScrollView setZoomScale:] directly because the UIScrollView delegate would get a callback with
+    // an invalid contentOffset. The real content offset is only set below.
+    // Since there is no public API for setting both the zoomScale and the contentOffset, we set the zoomScale manually
+    // on the zoom layer and then only change the contentOffset.
+    CGFloat adjustedScale = adjustmentScale * currentScale;
+    contentLayerTransform.m11 = adjustedScale;
+    contentLayerTransform.m22 = adjustedScale;
+    contentLayer.transform = contentLayerTransform;
</ins><span class="cx"> 
</span><del>-        CGPoint currentScrollOffset = [_scrollView contentOffset];
-        double horizontalScrollAdjustement = _resizeAnimationTransformAdjustments.m41 * animatingScaleTarget;
-        double verticalScrollAdjustment = _resizeAnimationTransformAdjustments.m42 * animatingScaleTarget;
</del><ins>+    CGPoint currentScrollOffset = [_scrollView contentOffset];
+    double horizontalScrollAdjustement = _resizeAnimationTransformAdjustments.m41 * animatingScaleTarget;
+    double verticalScrollAdjustment = _resizeAnimationTransformAdjustments.m42 * animatingScaleTarget;
</ins><span class="cx"> 
</span><del>-        [_scrollView setContentSize:roundScrollViewContentSize(*_page, [_contentView frame].size)];
-        [_scrollView setContentOffset:CGPointMake(currentScrollOffset.x - horizontalScrollAdjustement, currentScrollOffset.y - verticalScrollAdjustment)];
</del><ins>+    [_scrollView setContentSize:roundScrollViewContentSize(*_page, [_contentView frame].size)];
+    [_scrollView setContentOffset:CGPointMake(currentScrollOffset.x - horizontalScrollAdjustement, currentScrollOffset.y - verticalScrollAdjustment)];
</ins><span class="cx"> 
</span><del>-        [_resizeAnimationView removeFromSuperview];
-        _resizeAnimationView = nil;
-    }
</del><ins>+    [_resizeAnimationView removeFromSuperview];
+    _resizeAnimationView = nil;
+    _resizeAnimationTransformAdjustments = CATransform3DIdentity;
</ins><span class="cx"> 
</span><span class="cx">     _isAnimatingResize = NO;
</span><del>-    _resizeAnimationTransformAdjustments = CATransform3DIdentity;
-
</del><span class="cx">     [self _updateVisibleContentRects];
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>