<!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>[212537] branches/safari-603-branch</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/212537">212537</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2017-02-16 23:49:41 -0800 (Thu, 16 Feb 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/212459">r212459</a>. rdar://problem/29322051</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari603branchLayoutTestsChangeLog">branches/safari-603-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari603branchLayoutTestsscrollingcoordinatoriossynclayerpositionsafterscrollexpectedtxt">branches/safari-603-branch/LayoutTests/scrollingcoordinator/ios/sync-layer-positions-after-scroll-expected.txt</a></li>
<li><a href="#branchessafari603branchLayoutTestsscrollingcoordinatoriossynclayerpositionsafterscrollhtml">branches/safari-603-branch/LayoutTests/scrollingcoordinator/ios/sync-layer-positions-after-scroll.html</a></li>
<li><a href="#branchessafari603branchSourceWebKit2ChangeLog">branches/safari-603-branch/Source/WebKit2/ChangeLog</a></li>
<li><a href="#branchessafari603branchSourceWebKit2UIProcessAPICocoaWKWebViewmm">branches/safari-603-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#branchessafari603branchSourceWebKit2UIProcessAPICocoaWKWebViewInternalh">branches/safari-603-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h</a></li>
<li><a href="#branchessafari603branchSourceWebKit2UIProcessAPICocoaWKWebViewPrivateh">branches/safari-603-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h</a></li>
<li><a href="#branchessafari603branchSourceWebKit2UIProcessiosWKContentViewmm">branches/safari-603-branch/Source/WebKit2/UIProcess/ios/WKContentView.mm</a></li>
<li><a href="#branchessafari603branchSourceWebKit2UIProcessiosWKContentViewInteractionmm">branches/safari-603-branch/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm</a></li>
<li><a href="#branchessafari603branchSourceWebKit2UIProcessiosWKScrollViewmm">branches/safari-603-branch/Source/WebKit2/UIProcess/ios/WKScrollView.mm</a></li>
<li><a href="#branchessafari603branchToolsChangeLog">branches/safari-603-branch/Tools/ChangeLog</a></li>
<li><a href="#branchessafari603branchToolsDumpRenderTreeiosUIScriptControllerIOSmm">branches/safari-603-branch/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm</a></li>
<li><a href="#branchessafari603branchToolsDumpRenderTreemacUIScriptControllerMacmm">branches/safari-603-branch/Tools/DumpRenderTree/mac/UIScriptControllerMac.mm</a></li>
<li><a href="#branchessafari603branchToolsTestRunnerSharedUIScriptContextBindingsUIScriptControlleridl">branches/safari-603-branch/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl</a></li>
<li><a href="#branchessafari603branchToolsTestRunnerSharedUIScriptContextUIScriptControllercpp">branches/safari-603-branch/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp</a></li>
<li><a href="#branchessafari603branchToolsTestRunnerSharedUIScriptContextUIScriptControllerh">branches/safari-603-branch/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h</a></li>
<li><a href="#branchessafari603branchToolsWebKitTestRunnercocoaTestRunnerWKWebViewmm">branches/safari-603-branch/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm</a></li>
<li><a href="#branchessafari603branchToolsWebKitTestRunneriosUIScriptControllerIOSmm">branches/safari-603-branch/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm</a></li>
<li><a href="#branchessafari603branchToolsWebKitTestRunnermacUIScriptControllerMacmm">branches/safari-603-branch/Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari603branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/LayoutTests/ChangeLog (212536 => 212537)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/ChangeLog        2017-02-17 06:26:54 UTC (rev 212536)
+++ branches/safari-603-branch/LayoutTests/ChangeLog        2017-02-17 07:49:41 UTC (rev 212537)
</span><span class="lines">@@ -1,5 +1,27 @@
</span><span class="cx"> 2017-02-16  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r212459. rdar://problem/29322051
+
+    2017-02-16  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+            WKWebView inside a UICollectionView flashes when items are inserted above it
+            https://bugs.webkit.org/show_bug.cgi?id=168376
+            &lt;rdar://problem/29322051&gt;
+
+            Reviewed by Simon Fraser.
+
+            * scrollingcoordinator/ios/sync-layer-positions-after-scroll.html:
+            * scrollingcoordinator/ios/sync-layer-positions-after-scroll-expected.txt:
+            Make use of doAfterVisibleContentRectUpdate; we previously were
+            guaranteed by message ordering that our uiScriptComplete message
+            would arrive after the visible content rect update, but that is
+            no longer the case.
+
+            Also, adjust to have a initial scale and flexible viewport in order
+            to work around https://bugs.webkit.org/show_bug.cgi?id=168403.
+
+2017-02-16  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r212350. rdar://problem/30450379
</span><span class="cx"> 
</span><span class="cx">     2017-02-14  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari603branchLayoutTestsscrollingcoordinatoriossynclayerpositionsafterscrollexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/LayoutTests/scrollingcoordinator/ios/sync-layer-positions-after-scroll-expected.txt (212536 => 212537)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/scrollingcoordinator/ios/sync-layer-positions-after-scroll-expected.txt        2017-02-17 06:26:54 UTC (rev 212536)
+++ branches/safari-603-branch/LayoutTests/scrollingcoordinator/ios/sync-layer-positions-after-scroll-expected.txt        2017-02-17 07:49:41 UTC (rev 212537)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-visibleRectAfterScroll: {&quot;left&quot;:0,&quot;top&quot;:190,&quot;width&quot;:800,&quot;height&quot;:600}
</del><ins>+visibleRectAfterScroll: {&quot;left&quot;:0,&quot;top&quot;:190,&quot;width&quot;:320,&quot;height&quot;:548}
</ins><span class="cx"> (GraphicsLayer
</span><span class="cx">   (anchor 0.00 0.00)
</span><span class="cx">   (bounds 1308.00 2021.00)
</span></span></pre></div>
<a id="branchessafari603branchLayoutTestsscrollingcoordinatoriossynclayerpositionsafterscrollhtml"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/LayoutTests/scrollingcoordinator/ios/sync-layer-positions-after-scroll.html (212536 => 212537)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/scrollingcoordinator/ios/sync-layer-positions-after-scroll.html        2017-02-17 06:26:54 UTC (rev 212536)
+++ branches/safari-603-branch/LayoutTests/scrollingcoordinator/ios/sync-layer-positions-after-scroll.html        2017-02-17 07:49:41 UTC (rev 212537)
</span><span class="lines">@@ -1,7 +1,8 @@
</span><del>-&lt;!DOCTYPE html&gt;
</del><ins>+&lt;!DOCTYPE html&gt; &lt;!-- webkit-test-runner [ useFlexibleViewport=true ] --&gt;
</ins><span class="cx"> 
</span><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><ins>+    &lt;meta name=&quot;viewport&quot; content=&quot;initial-scale=1.0&quot;&gt;
</ins><span class="cx">     &lt;style&gt;
</span><span class="cx">         body {
</span><span class="cx">             width: 1300px;
</span><span class="lines">@@ -75,7 +76,9 @@
</span><span class="cx">                 };
</span><span class="cx"> 
</span><span class="cx">                 uiController.sendEventStream(JSON.stringify(movedFingerDownStream), function() {
</span><del>-                    uiController.uiScriptComplete(JSON.stringify(uiController.contentVisibleRect));
</del><ins>+                    uiController.doAfterVisibleContentRectUpdate(function () {
+                        uiController.uiScriptComplete(JSON.stringify(uiController.contentVisibleRect));
+                    });
</ins><span class="cx">                 });
</span><span class="cx">             })();`;
</span><span class="cx">         }
</span><span class="lines">@@ -102,7 +105,7 @@
</span><span class="cx">                 testRunner.runUIScript(getDragUIScript(xPos, startY, xPos, endY), function(visibleRectAfterScroll) {
</span><span class="cx">                     var result = 'visibleRectAfterScroll: ' + visibleRectAfterScroll + '\n' + internals.layerTreeAsText(document);
</span><span class="cx">                     document.getElementById('layers').textContent = result;
</span><del>-                    // Now send the finel touch up.
</del><ins>+                    // Now send the final touch up.
</ins><span class="cx">                     testRunner.runUIScript(getFingerUpUIScript(xPos, endY), function() {
</span><span class="cx">                         testRunner.notifyDone();
</span><span class="cx">                     });
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/ChangeLog (212536 => 212537)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/ChangeLog        2017-02-17 06:26:54 UTC (rev 212536)
+++ branches/safari-603-branch/Source/WebKit2/ChangeLog        2017-02-17 07:49:41 UTC (rev 212537)
</span><span class="lines">@@ -1,5 +1,83 @@
</span><span class="cx"> 2017-02-16  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r212459. rdar://problem/29322051
+
+    2017-02-16  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+            WKWebView inside a UICollectionView flashes when items are inserted above it
+            https://bugs.webkit.org/show_bug.cgi?id=168376
+            &lt;rdar://problem/29322051&gt;
+
+            Reviewed by Simon Fraser.
+
+            Previously, we would immediately send visible content rect updates
+            whenever we scrolled, or our frame or bounds changed, or ... a whole
+            bunch of other things. This message would be immediately sent to the
+            Web Content process, and coalesced at the whims of the Web Content process
+            main thread. However, if we received multiple such updates within the
+            same runloop cycle in the UI process, the Web Content process could
+            send back layer tree commits for intermediate states that would
+            never make it to the screen.
+
+            In the UICollectionView case, UIKit would first scroll to the new location
+            (potentially putting the WKWebView totally off-screen), and then update
+            our frame (back on screen), and we would get two layer tree commits;
+            one, with less tile coverage than needed to cover the area, and another
+            with full coverage.
+
+            Instead, wait until just before we commit the UI-side layer tree (and
+            thus everyone is done moving things around) to push the new visible
+            rect info to the Web Content process.
+
+            So far, I have not found a way to test that reliably fails before
+            and reliably passes after without adding a ton of supporting code to WebKit.
+
+            * UIProcess/API/Cocoa/WKWebView.mm:
+            (-[WKWebView _didInvokeUIScrollViewDelegateCallback]):
+            (-[WKWebView _didCommitLayerTree:]):
+            (-[WKWebView _didFinishScrolling]):
+            (-[WKWebView scrollViewDidScroll:]):
+            (-[WKWebView scrollViewDidZoom:]):
+            (-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
+            (-[WKWebView _scrollViewDidInterruptDecelerating:]):
+            (-[WKWebView _didScroll]):
+            (-[WKWebView _enclosingScrollerScrollingEnded:]):
+            (-[WKWebView _frameOrBoundsChanged]):
+            (-[WKWebView _scheduleVisibleContentRectUpdate]):
+            (-[WKWebView _scrollViewIsInStableState:]):
+            (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
+            (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
+            (-[WKWebView _setObscuredInsets:]):
+            (-[WKWebView _endInteractiveObscuredInsetsChange]):
+            (-[WKWebView _beginAnimatedResizeWithUpdates:]):
+            (-[WKWebView _endAnimatedResize]):
+            (-[WKWebView _updateVisibleContentRects]): Deleted.
+            (-[WKWebView _updateVisibleContentRectAfterScrollInView:]): Deleted.
+            * UIProcess/API/Cocoa/WKWebViewInternal.h:
+            * UIProcess/ios/WKContentView.mm:
+            (-[WKContentView _didCommitLayerTree:]):
+            * UIProcess/ios/WKContentViewInteraction.mm:
+            (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
+            (-[WKContentView _stopAssistingNode]):
+            * UIProcess/ios/WKScrollView.mm:
+            (-[WKScrollView setContentInset:]):
+            Have existing callers of _updateVisibleContentRect* instead call
+            _scheduleVisibleContentRectUpdate*.
+
+            In _scheduleVisibleContentRectUpdate, schedule a pre-commit callback
+            in which we will compute the new visible content rect information
+            and send it to the Web Content process.
+
+            Keep track of the stable state of the scroll view which most recently
+            scheduled an update, and use that to inform _updateVisibleContentRects.
+            This matches the previous behavior where the updates might get coalesced
+            in the Web Content process, and the most recent update wins.
+
+            Make a few callers of _updateVisibleContentRectAfterScrollInView
+            that passed in our scroll view just use _scheduleVisibleContentRectUpdate instead.
+
+2017-02-16  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r212312. rdar://problem/30505482
</span><span class="cx"> 
</span><span class="cx">     2017-02-14  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (212536 => 212537)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2017-02-17 06:26:54 UTC (rev 212536)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2017-02-17 07:49:41 UTC (rev 212537)
</span><span class="lines">@@ -280,6 +280,10 @@
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;std::function&lt;void ()&gt;&gt; _snapshotsDeferredDuringResize;
</span><span class="cx">     RetainPtr&lt;NSMutableArray&gt; _stableStatePresentationUpdateCallbacks;
</span><ins>+
+    BOOL _hasInstalledPreCommitHandlerForVisibleRectUpdate;
+    BOOL _visibleContentRectUpdateScheduledFromScrollViewInStableState;
+    Vector&lt;BlockPtr&lt;void ()&gt;&gt; _visibleContentRectUpdateCallbacks;
</ins><span class="cx"> #endif
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     std::unique_ptr&lt;WebKit::WebViewImpl&gt; _impl;
</span><span class="lines">@@ -1135,7 +1139,7 @@
</span><span class="cx">     _delayUpdateVisibleContentRects = NO;
</span><span class="cx">     if (_hadDelayedUpdateVisibleContentRects) {
</span><span class="cx">         _hadDelayedUpdateVisibleContentRects = NO;
</span><del>-        [self _updateVisibleContentRectAfterScrollInView:_scrollView.get()];
</del><ins>+        [self _scheduleVisibleContentRectUpdate];
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1397,7 +1401,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (needUpdateVisbleContentRects)
</span><del>-        [self _updateVisibleContentRects];
</del><ins>+        [self _scheduleVisibleContentRectUpdate];
</ins><span class="cx"> 
</span><span class="cx">     if (WebKit::RemoteLayerTreeScrollingPerformanceData* scrollPerfData = _page-&gt;scrollingPerformanceData())
</span><span class="cx">         scrollPerfData-&gt;didCommitLayerTree([self visibleRectInViewCoordinates]);
</span><span class="lines">@@ -1922,7 +1926,7 @@
</span><span class="cx">     if (![self usesStandardContentView])
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    [self _updateVisibleContentRectAfterScrollInView:_scrollView.get()];
</del><ins>+    [self _scheduleVisibleContentRectUpdate];
</ins><span class="cx">     [_contentView didFinishScrolling];
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1976,7 +1980,7 @@
</span><span class="cx">     if (![self usesStandardContentView])
</span><span class="cx">         [_customContentView scrollViewDidScroll:(UIScrollView *)scrollView];
</span><span class="cx"> 
</span><del>-    [self _updateVisibleContentRectAfterScrollInView:scrollView];
</del><ins>+    [self _scheduleVisibleContentRectUpdateAfterScrollInView:scrollView];
</ins><span class="cx">     
</span><span class="cx">     if (WebKit::RemoteLayerTreeScrollingPerformanceData* scrollPerfData = _page-&gt;scrollingPerformanceData())
</span><span class="cx">         scrollPerfData-&gt;didScroll([self visibleRectInViewCoordinates]);
</span><span class="lines">@@ -1985,13 +1989,13 @@
</span><span class="cx"> - (void)scrollViewDidZoom:(UIScrollView *)scrollView
</span><span class="cx"> {
</span><span class="cx">     [self _updateScrollViewBackground];
</span><del>-    [self _updateVisibleContentRectAfterScrollInView:scrollView];
</del><ins>+    [self _scheduleVisibleContentRectUpdateAfterScrollInView:scrollView];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(CGFloat)scale
</span><span class="cx"> {
</span><span class="cx">     ASSERT(scrollView == _scrollView);
</span><del>-    [self _updateVisibleContentRectAfterScrollInView:scrollView];
</del><ins>+    [self _scheduleVisibleContentRectUpdateAfterScrollInView:scrollView];
</ins><span class="cx">     [_contentView didZoomToScale:scale];
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2006,7 +2010,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     [_contentView didInterruptScrolling];
</span><del>-    [self _updateVisibleContentRectAfterScrollInView:scrollView];
</del><ins>+    [self _scheduleVisibleContentRectUpdateAfterScrollInView:scrollView];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (CGRect)_visibleRectInEnclosingScrollView:(UIScrollView *)enclosingScrollView
</span><span class="lines">@@ -2037,7 +2041,7 @@
</span><span class="cx"> // Called when some ancestor UIScrollView scrolls.
</span><span class="cx"> - (void)_didScroll
</span><span class="cx"> {
</span><del>-    [self _updateVisibleContentRectAfterScrollInView:[self _scroller]];
</del><ins>+    [self _scheduleVisibleContentRectUpdateAfterScrollInView:[self _scroller]];
</ins><span class="cx"> 
</span><span class="cx">     const NSTimeInterval ScrollingEndedTimerInterval = 0.032;
</span><span class="cx">     if (!_enclosingScrollViewScrollTimer) {
</span><span class="lines">@@ -2055,7 +2059,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    [self _updateVisibleContentRects];
</del><ins>+    [self _scheduleVisibleContentRectUpdate];
</ins><span class="cx">     [_enclosingScrollViewScrollTimer invalidate];
</span><span class="cx">     _enclosingScrollViewScrollTimer = nil;
</span><span class="cx"> }
</span><span class="lines">@@ -2075,7 +2079,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     [_customContentView web_setMinimumSize:bounds.size];
</span><del>-    [self _updateVisibleContentRects];
</del><ins>+    [self _scheduleVisibleContentRectUpdate];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Unobscured content rect where the user can interact. When the keyboard is up, this should be the area above or below the keyboard, wherever there is enough space.
</span><span class="lines">@@ -2098,23 +2102,22 @@
</span><span class="cx">     return !pointsEqualInDevicePixels(contentOffset, boundedOffset, deviceScaleFactor);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_updateVisibleContentRects
</del><ins>+- (void)_scheduleVisibleContentRectUpdate
</ins><span class="cx"> {
</span><del>-    // For visible rect updates not associated with a spefic UIScrollView, just consider our own scroller.
-    [self _updateVisibleContentRectAfterScrollInView:_scrollView.get()];
</del><ins>+    // For visible rect updates not associated with a specific UIScrollView, just consider our own scroller.
+    [self _scheduleVisibleContentRectUpdateAfterScrollInView:_scrollView.get()];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_updateVisibleContentRectAfterScrollInView:(UIScrollView *)scrollView
</del><ins>+- (BOOL)_scrollViewIsInStableState:(UIScrollView *)scrollView
</ins><span class="cx"> {
</span><span class="cx">     BOOL isStableState = !([scrollView isDragging] || [scrollView isDecelerating] || [scrollView isZooming] || [scrollView _isAnimatingZoom] || [scrollView _isScrollingToTop]);
</span><span class="cx"> 
</span><span class="cx">     if (isStableState &amp;&amp; scrollView == _scrollView.get())
</span><span class="cx">         isStableState = !_isChangingObscuredInsetsInteractively;
</span><del>-    
</del><ins>+
</ins><span class="cx">     if (isStableState &amp;&amp; scrollView == _scrollView.get())
</span><span class="cx">         isStableState = ![self _scrollViewIsRubberBanding];
</span><span class="cx"> 
</span><del>-    // FIXME: this can be made static after we stop supporting iOS 8.x.
</del><span class="cx">     if (isStableState &amp;&amp; [scrollView respondsToSelector:@selector(_isInterruptingDeceleration)])
</span><span class="cx">         isStableState = ![scrollView performSelector:@selector(_isInterruptingDeceleration)];
</span><span class="cx"> 
</span><span class="lines">@@ -2121,9 +2124,25 @@
</span><span class="cx">     if (NSNumber *stableOverride = self._stableStateOverride)
</span><span class="cx">         isStableState = stableOverride.boolValue;
</span><span class="cx"> 
</span><del>-    [self _updateContentRectsWithState:isStableState];
</del><ins>+    return isStableState;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)_scheduleVisibleContentRectUpdateAfterScrollInView:(UIScrollView *)scrollView
+{
+    _visibleContentRectUpdateScheduledFromScrollViewInStableState = [self _scrollViewIsInStableState:scrollView];
+
+    if (_hasInstalledPreCommitHandlerForVisibleRectUpdate)
+        return;
+
+    _hasInstalledPreCommitHandlerForVisibleRectUpdate = YES;
+
+    [CATransaction addCommitHandler:[retainedSelf = retainPtr(self)] {
+        WKWebView *webView = retainedSelf.get();
+        [webView _updateVisibleContentRects];
+        webView-&gt;_hasInstalledPreCommitHandlerForVisibleRectUpdate = NO;
+    } forPhase:kCATransactionPhasePreCommit];
+}
+
</ins><span class="cx"> static bool scrollViewCanScroll(UIScrollView *scrollView)
</span><span class="cx"> {
</span><span class="cx">     if (!scrollView)
</span><span class="lines">@@ -2162,8 +2181,10 @@
</span><span class="cx">     return extendedBounds;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_updateContentRectsWithState:(BOOL)inStableState
</del><ins>+- (void)_updateVisibleContentRects
</ins><span class="cx"> {
</span><ins>+    BOOL inStableState = _visibleContentRectUpdateScheduledFromScrollViewInStableState;
+
</ins><span class="cx">     if (![self usesStandardContentView]) {
</span><span class="cx">         [_customContentView web_computedContentInsetDidChange];
</span><span class="cx">         return;
</span><span class="lines">@@ -2221,6 +2242,11 @@
</span><span class="cx">         inStableState:inStableState
</span><span class="cx">         isChangingObscuredInsetsInteractively:_isChangingObscuredInsetsInteractively
</span><span class="cx">         enclosedInScrollableAncestorView:scrollViewCanScroll([self _scroller])];
</span><ins>+
+    while (!_visibleContentRectUpdateCallbacks.isEmpty()) {
+        auto callback = _visibleContentRectUpdateCallbacks.takeLast();
+        callback();
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_didFinishLoadForMainFrame
</span><span class="lines">@@ -2266,7 +2292,7 @@
</span><span class="cx">             _totalScrollViewBottomInsetAdjustmentForKeyboard += bottomInsetAfterAdjustment - bottomInsetBeforeAdjustment;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    [self _updateVisibleContentRects];
</del><ins>+    [self _scheduleVisibleContentRectUpdate];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)_shouldUpdateKeyboardWithInfo:(NSDictionary *)keyboardInfo
</span><span class="lines">@@ -4168,7 +4194,7 @@
</span><span class="cx"> 
</span><span class="cx">     _obscuredInsets = obscuredInsets;
</span><span class="cx"> 
</span><del>-    [self _updateVisibleContentRects];
</del><ins>+    [self _scheduleVisibleContentRectUpdate];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_setInterfaceOrientationOverride:(UIInterfaceOrientation)interfaceOrientation
</span><span class="lines">@@ -4241,7 +4267,7 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(_isChangingObscuredInsetsInteractively);
</span><span class="cx">     _isChangingObscuredInsetsInteractively = NO;
</span><del>-    [self _updateVisibleContentRects];
</del><ins>+    [self _scheduleVisibleContentRectUpdate];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_hideContentUntilNextUpdate
</span><span class="lines">@@ -4287,7 +4313,7 @@
</span><span class="cx">             _page-&gt;setMaximumUnobscuredSize(WebCore::FloatSize(newMaximumUnobscuredSize));
</span><span class="cx">         if (_overridesInterfaceOrientation)
</span><span class="cx">             _page-&gt;setDeviceOrientation(newOrientation);
</span><del>-        [self _updateVisibleContentRects];
</del><ins>+        [self _scheduleVisibleContentRectUpdate];
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -4297,7 +4323,7 @@
</span><span class="cx">         &amp;&amp; oldOrientation == newOrientation
</span><span class="cx">         &amp;&amp; UIEdgeInsetsEqualToEdgeInsets(oldObscuredInsets, newObscuredInsets)) {
</span><span class="cx">         _dynamicViewportUpdateMode = DynamicViewportUpdateMode::NotResizing;
</span><del>-        [self _updateVisibleContentRects];
</del><ins>+        [self _scheduleVisibleContentRectUpdate];
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -4414,7 +4440,7 @@
</span><span class="cx"> 
</span><span class="cx">     _dynamicViewportUpdateMode = DynamicViewportUpdateMode::NotResizing;
</span><span class="cx">     [_contentView setHidden:NO];
</span><del>-    [self _updateVisibleContentRects];
</del><ins>+    [self _scheduleVisibleContentRectUpdate];
</ins><span class="cx"> 
</span><span class="cx">     while (!_snapshotsDeferredDuringResize.isEmpty())
</span><span class="cx">         _snapshotsDeferredDuringResize.takeLast()();
</span><span class="lines">@@ -4984,6 +5010,16 @@
</span><span class="cx">     [self _doAfterNextPresentationUpdate:updateBlock];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)_doAfterNextVisibleContentRectUpdate:(void (^)(void))updateBlock
+{
+#if PLATFORM(IOS)
+    _visibleContentRectUpdateCallbacks.append(makeBlockPtr(updateBlock));
+    [self _scheduleVisibleContentRectUpdate];
+#else
+    dispatch_async(dispatch_get_main_queue(), updateBlock);
+#endif
+}
+
</ins><span class="cx"> - (void)_disableBackForwardSnapshotVolatilityForTesting
</span><span class="cx"> {
</span><span class="cx">     WebKit::ViewSnapshotStore::singleton().setDisableSnapshotVolatilityForTesting(true);
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2UIProcessAPICocoaWKWebViewInternalh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h (212536 => 212537)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h        2017-02-17 06:26:54 UTC (rev 212536)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h        2017-02-17 07:49:41 UTC (rev 212537)
</span><span class="lines">@@ -99,9 +99,7 @@
</span><span class="cx"> - (void)_willInvokeUIScrollViewDelegateCallback;
</span><span class="cx"> - (void)_didInvokeUIScrollViewDelegateCallback;
</span><span class="cx"> 
</span><del>-- (void)_updateVisibleContentRects;
-- (void)_updateVisibleContentRectAfterScrollInView:(UIScrollView *)scrollView;
-- (void)_updateContentRectsWithState:(BOOL)inStableState;
</del><ins>+- (void)_scheduleVisibleContentRectUpdate;
</ins><span class="cx"> 
</span><span class="cx"> - (void)_didFinishLoadForMainFrame;
</span><span class="cx"> - (void)_didFailLoadForMainFrame;
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2UIProcessAPICocoaWKWebViewPrivateh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h (212536 => 212537)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h        2017-02-17 06:26:54 UTC (rev 212536)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h        2017-02-17 07:49:41 UTC (rev 212537)
</span><span class="lines">@@ -322,6 +322,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_doAfterNextPresentationUpdate:(void (^)(void))updateBlock WK_API_AVAILABLE(macosx(10.12), ios(10.0));
</span><span class="cx"> - (void)_doAfterNextPresentationUpdateWithoutWaitingForPainting:(void (^)(void))updateBlock WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
</span><ins>+- (void)_doAfterNextVisibleContentRectUpdate:(void (^)(void))updateBlock WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
</ins><span class="cx"> 
</span><span class="cx"> - (void)_disableBackForwardSnapshotVolatilityForTesting WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2UIProcessiosWKContentViewmm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/ios/WKContentView.mm (212536 => 212537)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/UIProcess/ios/WKContentView.mm        2017-02-17 06:26:54 UTC (rev 212536)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/ios/WKContentView.mm        2017-02-17 07:49:41 UTC (rev 212537)
</span><span class="lines">@@ -572,7 +572,7 @@
</span><span class="cx">         [self updateFixedClippingView:fixedPositionRect];
</span><span class="cx"> 
</span><span class="cx">         // We need to push the new content bounds to the webview to update fixed position rects.
</span><del>-        [_webView _updateVisibleContentRects];
</del><ins>+        [_webView _scheduleVisibleContentRectUpdate];
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     // Updating the selection requires a full editor state. If the editor state is missing post layout
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2UIProcessiosWKContentViewInteractionmm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (212536 => 212537)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2017-02-17 06:26:54 UTC (rev 212536)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2017-02-17 07:49:41 UTC (rev 212537)
</span><span class="lines">@@ -3713,7 +3713,7 @@
</span><span class="cx">     
</span><span class="cx">     // The custom fixed position rect behavior is affected by -isAssistingNode, so if that changes we need to recompute rects.
</span><span class="cx">     if (editableChanged)
</span><del>-        [_webView _updateVisibleContentRects];
</del><ins>+        [_webView _scheduleVisibleContentRectUpdate];
</ins><span class="cx">     
</span><span class="cx">     [self _displayFormNodeInputView];
</span><span class="cx"> 
</span><span class="lines">@@ -3747,7 +3747,7 @@
</span><span class="cx"> 
</span><span class="cx">     // The custom fixed position rect behavior is affected by -isAssistingNode, so if that changes we need to recompute rects.
</span><span class="cx">     if (editableChanged)
</span><del>-        [_webView _updateVisibleContentRects];
</del><ins>+        [_webView _scheduleVisibleContentRectUpdate];
</ins><span class="cx"> 
</span><span class="cx">     [_webView didEndFormControlInteraction];
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2UIProcessiosWKScrollViewmm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/ios/WKScrollView.mm (212536 => 212537)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/UIProcess/ios/WKScrollView.mm        2017-02-17 06:26:54 UTC (rev 212536)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/ios/WKScrollView.mm        2017-02-17 07:49:41 UTC (rev 212537)
</span><span class="lines">@@ -222,7 +222,7 @@
</span><span class="cx"> {
</span><span class="cx">     [super setContentInset:contentInset];
</span><span class="cx"> 
</span><del>-    [_internalDelegate _updateVisibleContentRects];
</del><ins>+    [_internalDelegate _scheduleVisibleContentRectUpdate];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Fetch top/left rubberband amounts (as negative values).
</span></span></pre></div>
<a id="branchessafari603branchToolsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/ChangeLog (212536 => 212537)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/ChangeLog        2017-02-17 06:26:54 UTC (rev 212536)
+++ branches/safari-603-branch/Tools/ChangeLog        2017-02-17 07:49:41 UTC (rev 212537)
</span><span class="lines">@@ -1,5 +1,38 @@
</span><span class="cx"> 2017-02-16  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r212459. rdar://problem/29322051
+
+    2017-02-16  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+            WKWebView inside a UICollectionView flashes when items are inserted above it
+            https://bugs.webkit.org/show_bug.cgi?id=168376
+            &lt;rdar://problem/29322051&gt;
+
+            Reviewed by Simon Fraser.
+
+            * WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
+            (-[TestRunnerWKWebView _setStableStateOverride:]):
+            Update the one external caller of this internal method...
+
+            * DumpRenderTree/ios/UIScriptControllerIOS.mm:
+            (WTR::UIScriptController::doAfterVisibleContentRectUpdate):
+            * DumpRenderTree/mac/UIScriptControllerMac.mm:
+            (WTR::UIScriptController::doAfterVisibleContentRectUpdate):
+            * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
+            * TestRunnerShared/UIScriptContext/UIScriptController.cpp:
+            (WTR::UIScriptController::doAfterVisibleContentRectUpdate):
+            * TestRunnerShared/UIScriptContext/UIScriptController.h:
+            * WebKitTestRunner/ios/UIScriptControllerIOS.mm:
+            (WTR::UIScriptController::doAfterVisibleContentRectUpdate):
+            * WebKitTestRunner/mac/UIScriptControllerMac.mm:
+            (WTR::UIScriptController::doAfterVisibleContentRectUpdate):
+            Expose doAfterVisibleContentRectUpdate to DRT and WKTR. It is called
+            back after we dispatch a visible content rect update from the UI process
+            to the Web Content process, so any messages sent from the block will arrive
+            after the visible content rect update.
+
+2017-02-16  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r212134. rdar://problem/30313696
</span><span class="cx"> 
</span><span class="cx">     2017-02-10  Brady Eidson  &lt;beidson@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari603branchToolsDumpRenderTreeiosUIScriptControllerIOSmm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm (212536 => 212537)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm        2017-02-17 06:26:54 UTC (rev 212536)
+++ branches/safari-603-branch/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm        2017-02-17 07:49:41 UTC (rev 212537)
</span><span class="lines">@@ -63,6 +63,11 @@
</span><span class="cx">     doAsyncTask(callback);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UIScriptController::doAfterVisibleContentRectUpdate(JSValueRef callback)
+{
+    doAsyncTask(callback);
+}
+
</ins><span class="cx"> void UIScriptController::zoomToScale(double scale, JSValueRef callback)
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;UIScriptController&gt; protectedThis(this);
</span></span></pre></div>
<a id="branchessafari603branchToolsDumpRenderTreemacUIScriptControllerMacmm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/DumpRenderTree/mac/UIScriptControllerMac.mm (212536 => 212537)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/DumpRenderTree/mac/UIScriptControllerMac.mm        2017-02-17 06:26:54 UTC (rev 212536)
+++ branches/safari-603-branch/Tools/DumpRenderTree/mac/UIScriptControllerMac.mm        2017-02-17 07:49:41 UTC (rev 212537)
</span><span class="lines">@@ -59,6 +59,11 @@
</span><span class="cx">     doAsyncTask(callback);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UIScriptController::doAfterVisibleContentRectUpdate(JSValueRef callback)
+{
+    doAsyncTask(callback);
+}
+
</ins><span class="cx"> void UIScriptController::insertText(JSStringRef, int, int)
</span><span class="cx"> {
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari603branchToolsTestRunnerSharedUIScriptContextBindingsUIScriptControlleridl"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl (212536 => 212537)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl        2017-02-17 06:26:54 UTC (rev 212536)
+++ branches/safari-603-branch/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl        2017-02-17 07:49:41 UTC (rev 212537)
</span><span class="lines">@@ -31,6 +31,8 @@
</span><span class="cx">     void doAfterPresentationUpdate(object callback); // Call the callback after sending a message to the WebProcess and receiving a subsequent update.
</span><span class="cx">     void doAfterNextStablePresentationUpdate(object callback);
</span><span class="cx"> 
</span><ins>+    void doAfterVisibleContentRectUpdate(object callback);
+
</ins><span class="cx">     void simulateAccessibilitySettingsChangeNotification(object callback);
</span><span class="cx"> 
</span><span class="cx">     // Interaction.
</span></span></pre></div>
<a id="branchessafari603branchToolsTestRunnerSharedUIScriptContextUIScriptControllercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp (212536 => 212537)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp        2017-02-17 06:26:54 UTC (rev 212536)
+++ branches/safari-603-branch/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp        2017-02-17 07:49:41 UTC (rev 212537)
</span><span class="lines">@@ -74,6 +74,10 @@
</span><span class="cx"> void UIScriptController::doAfterNextStablePresentationUpdate(JSValueRef)
</span><span class="cx"> {
</span><span class="cx"> }
</span><ins>+
+void UIScriptController::doAfterVisibleContentRectUpdate(JSValueRef)
+{
+}
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> void UIScriptController::setDidStartFormControlInteractionCallback(JSValueRef callback)
</span></span></pre></div>
<a id="branchessafari603branchToolsTestRunnerSharedUIScriptContextUIScriptControllerh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h (212536 => 212537)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h        2017-02-17 06:26:54 UTC (rev 212536)
+++ branches/safari-603-branch/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h        2017-02-17 07:49:41 UTC (rev 212537)
</span><span class="lines">@@ -54,6 +54,7 @@
</span><span class="cx">     void doAsyncTask(JSValueRef callback);
</span><span class="cx">     void doAfterPresentationUpdate(JSValueRef callback);
</span><span class="cx">     void doAfterNextStablePresentationUpdate(JSValueRef callback);
</span><ins>+    void doAfterVisibleContentRectUpdate(JSValueRef callback);
</ins><span class="cx"> 
</span><span class="cx">     void zoomToScale(double scale, JSValueRef callback);
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari603branchToolsWebKitTestRunnercocoaTestRunnerWKWebViewmm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm (212536 => 212537)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm        2017-02-17 06:26:54 UTC (rev 212536)
+++ branches/safari-603-branch/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm        2017-02-17 07:49:41 UTC (rev 212537)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> - (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(UIView *)view;
</span><span class="cx"> - (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(CGFloat)scale;
</span><span class="cx"> - (void)_didFinishScrolling;
</span><del>-- (void)_updateVisibleContentRects;
</del><ins>+- (void)_scheduleVisibleContentRectUpdate;
</ins><span class="cx"> 
</span><span class="cx"> @end
</span><span class="cx"> #endif
</span><span class="lines">@@ -184,7 +184,7 @@
</span><span class="cx"> - (void)_setStableStateOverride:(NSNumber *)overrideBoolean
</span><span class="cx"> {
</span><span class="cx">     m_stableStateOverride = overrideBoolean;
</span><del>-    [self _updateVisibleContentRects];
</del><ins>+    [self _scheduleVisibleContentRectUpdate];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="branchessafari603branchToolsWebKitTestRunneriosUIScriptControllerIOSmm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm (212536 => 212537)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm        2017-02-17 06:26:54 UTC (rev 212536)
+++ branches/safari-603-branch/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm        2017-02-17 07:49:41 UTC (rev 212537)
</span><span class="lines">@@ -94,6 +94,18 @@
</span><span class="cx">     }];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UIScriptController::doAfterVisibleContentRectUpdate(JSValueRef callback)
+{
+    TestRunnerWKWebView *webView = TestController::singleton().mainWebView()-&gt;platformView();
+
+    unsigned callbackID = m_context-&gt;prepareForAsyncTask(callback, CallbackTypeNonPersistent);
+    [webView _doAfterNextVisibleContentRectUpdate:^ {
+        if (!m_context)
+            return;
+        m_context-&gt;asyncTaskComplete(callbackID);
+    }];
+}
+
</ins><span class="cx"> void UIScriptController::zoomToScale(double scale, JSValueRef callback)
</span><span class="cx"> {
</span><span class="cx">     TestRunnerWKWebView *webView = TestController::singleton().mainWebView()-&gt;platformView();
</span></span></pre></div>
<a id="branchessafari603branchToolsWebKitTestRunnermacUIScriptControllerMacmm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm (212536 => 212537)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm        2017-02-17 06:26:54 UTC (rev 212536)
+++ branches/safari-603-branch/Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm        2017-02-17 07:49:41 UTC (rev 212537)
</span><span class="lines">@@ -66,6 +66,11 @@
</span><span class="cx">     doAsyncTask(callback);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UIScriptController::doAfterVisibleContentRectUpdate(JSValueRef callback)
+{
+    doAsyncTask(callback);
+}
+
</ins><span class="cx"> void UIScriptController::insertText(JSStringRef text, int location, int length)
</span><span class="cx"> {
</span><span class="cx"> #if WK_API_ENABLED
</span></span></pre>
</div>
</div>

</body>
</html>