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

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

<h3>Log Message</h3>
<pre>[iOS WK2] Stop using exposedContentRect for history scroll state restoration
https://bugs.webkit.org/show_bug.cgi?id=156392

Reviewed by Tim Horton.

A future commit will alter the meaning of exposedContentRect on iOS to take into
account clipped out parts of the WKWebView. To achieve this, wean history restoration
off of using exposedContentRect for scroll state restoration. It did this to restore
the page to the same position relative to the view's top-left (to avoid jiggles caused
by changing obscured insets).

Do this by pushing the left/top obscured insets down with visible content rects updates,
storing them on ScrollView, and adding them to HistoryItem. Those insets are then used
for scroll state restoration in WKWebView.

Source/WebCore:

* history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem):
* history/HistoryItem.h:
(WebCore::HistoryItem::obscuredInset):
(WebCore::HistoryItem::setObscuredInset):
* loader/HistoryController.cpp:
(WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
* platform/ScrollView.h:
(WebCore::ScrollView::platformObscuredInset):
(WebCore::ScrollView::platformSetObscuredInset):

Source/WebKit2:

* Shared/VisibleContentRectUpdateInfo.cpp: Add FloatSize for obscuredInset.
(WebKit::VisibleContentRectUpdateInfo::encode):
(WebKit::VisibleContentRectUpdateInfo::decode):
* Shared/VisibleContentRectUpdateInfo.h:
(WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
(WebKit::VisibleContentRectUpdateInfo::obscuredInset):
(WebKit::operator==):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _processDidExit]): Rename _needsToRestoreExposedRect to _needsToRestoreScrollPosition
(-[WKWebView _didCommitLayerTree:]): Restore the scroll position using the scaled scrollOffset minus
the old obscuredInset.
(-[WKWebView _layerTreeCommitComplete]):
(-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]):
(-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
(-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]):
(-[WKWebView _updateVisibleContentRects]):
(-[WKWebView _restorePageStateToExposedRect:scrollOrigin:scale:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::restorePageState):
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::updateVisibleContentRects):
(WebKit::WebPageProxy::restorePageState):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::restorePageState):
(WebKit::WebPage::updateVisibleContentRects):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehistoryHistoryItemcpp">trunk/Source/WebCore/history/HistoryItem.cpp</a></li>
<li><a href="#trunkSourceWebCorehistoryHistoryItemh">trunk/Source/WebCore/history/HistoryItem.h</a></li>
<li><a href="#trunkSourceWebCoreloaderHistoryControllercpp">trunk/Source/WebCore/loader/HistoryController.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollViewh">trunk/Source/WebCore/platform/ScrollView.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedVisibleContentRectUpdateInfocpp">trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedVisibleContentRectUpdateInfoh">trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewInternalh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessPageClienth">trunk/Source/WebKit2/UIProcess/PageClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxymessagesin">trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosPageClientImplIOSh">trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosPageClientImplIOSmm">trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKContentViewh">trunk/Source/WebKit2/UIProcess/ios/WKContentView.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKContentViewmm">trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm">trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm">trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (199232 => 199233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-08 17:21:32 UTC (rev 199232)
+++ trunk/Source/WebCore/ChangeLog        2016-04-08 17:22:19 UTC (rev 199233)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2016-04-07  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        [iOS WK2] Stop using exposedContentRect for history scroll state restoration
+        https://bugs.webkit.org/show_bug.cgi?id=156392
+
+        Reviewed by Tim Horton.
+
+        A future commit will alter the meaning of exposedContentRect on iOS to take into
+        account clipped out parts of the WKWebView. To achieve this, wean history restoration
+        off of using exposedContentRect for scroll state restoration. It did this to restore
+        the page to the same position relative to the view's top-left (to avoid jiggles caused
+        by changing obscured insets).
+
+        Do this by pushing the left/top obscured insets down with visible content rects updates,
+        storing them on ScrollView, and adding them to HistoryItem. Those insets are then used
+        for scroll state restoration in WKWebView.
+
+        * history/HistoryItem.cpp:
+        (WebCore::HistoryItem::HistoryItem):
+        * history/HistoryItem.h:
+        (WebCore::HistoryItem::obscuredInset):
+        (WebCore::HistoryItem::setObscuredInset):
+        * loader/HistoryController.cpp:
+        (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
+        * platform/ScrollView.h:
+        (WebCore::ScrollView::platformObscuredInset):
+        (WebCore::ScrollView::platformSetObscuredInset):
+
</ins><span class="cx"> 2016-04-08  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Build fix followup to http://trac.webkit.org/changeset/199230
</span></span></pre></div>
<a id="trunkSourceWebCorehistoryHistoryItemcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/history/HistoryItem.cpp (199232 => 199233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/history/HistoryItem.cpp        2016-04-08 17:21:32 UTC (rev 199232)
+++ trunk/Source/WebCore/history/HistoryItem.cpp        2016-04-08 17:22:19 UTC (rev 199233)
</span><span class="lines">@@ -62,11 +62,6 @@
</span><span class="cx">     , m_itemSequenceNumber(generateSequenceNumber())
</span><span class="cx">     , m_documentSequenceNumber(generateSequenceNumber())
</span><span class="cx">     , m_pruningReason(PruningReason::None)
</span><del>-#if PLATFORM(IOS)
-    , m_scale(0)
-    , m_scaleIsInitial(false)
-    , m_bookmarkID(0)
-#endif
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -80,12 +75,7 @@
</span><span class="cx">     , m_itemSequenceNumber(generateSequenceNumber())
</span><span class="cx">     , m_documentSequenceNumber(generateSequenceNumber())
</span><span class="cx">     , m_pruningReason(PruningReason::None)
</span><del>-#if PLATFORM(IOS)
-    , m_scale(0)
-    , m_scaleIsInitial(false)
-    , m_bookmarkID(0)
-#endif
-{    
</del><ins>+{
</ins><span class="cx">     iconDatabase().retainIconForPageURL(m_urlString);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -100,11 +90,6 @@
</span><span class="cx">     , m_itemSequenceNumber(generateSequenceNumber())
</span><span class="cx">     , m_documentSequenceNumber(generateSequenceNumber())
</span><span class="cx">     , m_pruningReason(PruningReason::None)
</span><del>-#if PLATFORM(IOS)
-    , m_scale(0)
-    , m_scaleIsInitial(false)
-    , m_bookmarkID(0)
-#endif
</del><span class="cx"> {
</span><span class="cx">     iconDatabase().retainIconForPageURL(m_urlString);
</span><span class="cx"> }
</span><span class="lines">@@ -132,6 +117,7 @@
</span><span class="cx">     , m_formContentType(item.m_formContentType)
</span><span class="cx">     , m_pruningReason(PruningReason::None)
</span><span class="cx"> #if PLATFORM(IOS)
</span><ins>+    , m_obscuredInset(item.m_obscuredInset)
</ins><span class="cx">     , m_scale(item.m_scale)
</span><span class="cx">     , m_scaleIsInitial(item.m_scaleIsInitial)
</span><span class="cx">     , m_bookmarkID(item.m_bookmarkID)
</span></span></pre></div>
<a id="trunkSourceWebCorehistoryHistoryItemh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/history/HistoryItem.h (199232 => 199233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/history/HistoryItem.h        2016-04-08 17:21:32 UTC (rev 199232)
+++ trunk/Source/WebCore/history/HistoryItem.h        2016-04-08 17:22:19 UTC (rev 199233)
</span><span class="lines">@@ -179,6 +179,9 @@
</span><span class="cx">     IntRect unobscuredContentRect() const { return m_unobscuredContentRect; }
</span><span class="cx">     void setUnobscuredContentRect(IntRect unobscuredContentRect) { m_unobscuredContentRect = unobscuredContentRect; }
</span><span class="cx"> 
</span><ins>+    FloatSize obscuredInset() const { return m_obscuredInset; }
+    void setObscuredInset(const FloatSize&amp; inset) { m_obscuredInset = inset; }
+
</ins><span class="cx">     FloatSize minimumLayoutSizeInScrollViewCoordinates() const { return m_minimumLayoutSizeInScrollViewCoordinates; }
</span><span class="cx">     void setMinimumLayoutSizeInScrollViewCoordinates(FloatSize minimumLayoutSizeInScrollViewCoordinates) { m_minimumLayoutSizeInScrollViewCoordinates = minimumLayoutSizeInScrollViewCoordinates; }
</span><span class="cx"> 
</span><span class="lines">@@ -265,11 +268,12 @@
</span><span class="cx">     IntRect m_unobscuredContentRect;
</span><span class="cx">     FloatSize m_minimumLayoutSizeInScrollViewCoordinates;
</span><span class="cx">     IntSize m_contentSize;
</span><del>-    float m_scale;
-    bool m_scaleIsInitial;
</del><ins>+    FloatSize m_obscuredInset;
+    float m_scale { 1 };
+    bool m_scaleIsInitial { false };
</ins><span class="cx">     ViewportArguments m_viewportArguments;
</span><span class="cx"> 
</span><del>-    uint32_t m_bookmarkID;
</del><ins>+    uint32_t m_bookmarkID { 0 };
</ins><span class="cx">     String m_sharedLinkUniqueIdentifier;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderHistoryControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/HistoryController.cpp (199232 => 199233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/HistoryController.cpp        2016-04-08 17:21:32 UTC (rev 199232)
+++ trunk/Source/WebCore/loader/HistoryController.cpp        2016-04-08 17:22:19 UTC (rev 199233)
</span><span class="lines">@@ -82,6 +82,7 @@
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     item-&gt;setExposedContentRect(frameView-&gt;exposedContentRect());
</span><span class="cx">     item-&gt;setUnobscuredContentRect(frameView-&gt;unobscuredContentRect());
</span><ins>+    item-&gt;setObscuredInset(frameView-&gt;platformObscuredInset());
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     Page* page = m_frame.page();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollView.h (199232 => 199233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollView.h        2016-04-08 17:21:32 UTC (rev 199232)
+++ trunk/Source/WebCore/platform/ScrollView.h        2016-04-08 17:22:19 UTC (rev 199233)
</span><span class="lines">@@ -378,6 +378,11 @@
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT void scrollOffsetChangedViaPlatformWidget(const ScrollOffset&amp; oldOffset, const ScrollOffset&amp; newOffset);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    FloatSize platformObscuredInset() const { return m_obscuredInset; }
+    void platformSetObscuredInset(FloatSize inset) { m_obscuredInset = inset; }
+#endif
+
</ins><span class="cx"> protected:
</span><span class="cx">     ScrollView();
</span><span class="cx"> 
</span><span class="lines">@@ -447,11 +452,13 @@
</span><span class="cx">     // whether it is safe to blit on scroll.
</span><span class="cx">     bool m_canBlitOnScroll;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
</ins><span class="cx">     // FIXME: exposedContentRect is a very similar concept to fixedVisibleContentRect except it does not differentiate
</span><span class="cx">     // between exposed and unobscured areas. The two attributes should eventually be merged.
</span><del>-#if PLATFORM(IOS)
</del><span class="cx">     FloatRect m_exposedContentRect;
</span><span class="cx">     FloatSize m_unobscuredContentSize;
</span><ins>+    // This is only used for history scroll position restoration.
+    FloatSize m_obscuredInset;
</ins><span class="cx"> #else
</span><span class="cx">     IntRect m_fixedVisibleContentRect;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (199232 => 199233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-04-08 17:21:32 UTC (rev 199232)
+++ trunk/Source/WebKit2/ChangeLog        2016-04-08 17:22:19 UTC (rev 199233)
</span><span class="lines">@@ -1,3 +1,55 @@
</span><ins>+2016-04-07  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        [iOS WK2] Stop using exposedContentRect for history scroll state restoration
+        https://bugs.webkit.org/show_bug.cgi?id=156392
+
+        Reviewed by Tim Horton.
+
+        A future commit will alter the meaning of exposedContentRect on iOS to take into
+        account clipped out parts of the WKWebView. To achieve this, wean history restoration
+        off of using exposedContentRect for scroll state restoration. It did this to restore
+        the page to the same position relative to the view's top-left (to avoid jiggles caused
+        by changing obscured insets).
+
+        Do this by pushing the left/top obscured insets down with visible content rects updates,
+        storing them on ScrollView, and adding them to HistoryItem. Those insets are then used
+        for scroll state restoration in WKWebView.
+
+        * Shared/VisibleContentRectUpdateInfo.cpp: Add FloatSize for obscuredInset.
+        (WebKit::VisibleContentRectUpdateInfo::encode):
+        (WebKit::VisibleContentRectUpdateInfo::decode):
+        * Shared/VisibleContentRectUpdateInfo.h:
+        (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
+        (WebKit::VisibleContentRectUpdateInfo::obscuredInset):
+        (WebKit::operator==):
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _processDidExit]): Rename _needsToRestoreExposedRect to _needsToRestoreScrollPosition
+        (-[WKWebView _didCommitLayerTree:]): Restore the scroll position using the scaled scrollOffset minus
+        the old obscuredInset.
+        (-[WKWebView _layerTreeCommitComplete]):
+        (-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]):
+        (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
+        (-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]):
+        (-[WKWebView _updateVisibleContentRects]):
+        (-[WKWebView _restorePageStateToExposedRect:scrollOrigin:scale:]): Deleted.
+        * UIProcess/API/Cocoa/WKWebViewInternal.h:
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/ios/PageClientImplIOS.h:
+        * UIProcess/ios/PageClientImplIOS.mm:
+        (WebKit::PageClientImpl::restorePageState):
+        * UIProcess/ios/WKContentView.h:
+        * UIProcess/ios/WKContentView.mm:
+        (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
+        (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]): Deleted.
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::updateVisibleContentRects):
+        (WebKit::WebPageProxy::restorePageState):
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::restorePageState):
+        (WebKit::WebPage::updateVisibleContentRects):
+
</ins><span class="cx"> 2016-04-08  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Modern IDB (Blob support): Write blobs to temporary files and move them to the correct location when storing them.
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedVisibleContentRectUpdateInfocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.cpp (199232 => 199233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.cpp        2016-04-08 17:21:32 UTC (rev 199232)
+++ trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.cpp        2016-04-08 17:22:19 UTC (rev 199233)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx">     encoder &lt;&lt; m_unobscuredContentRect;
</span><span class="cx">     encoder &lt;&lt; m_unobscuredRectInScrollViewCoordinates;
</span><span class="cx">     encoder &lt;&lt; m_customFixedPositionRect;
</span><ins>+    encoder &lt;&lt; m_obscuredInset;
</ins><span class="cx">     encoder &lt;&lt; m_lastLayerTreeTransactionID;
</span><span class="cx">     encoder &lt;&lt; m_scale;
</span><span class="cx">     encoder &lt;&lt; m_timestamp;
</span><span class="lines">@@ -57,6 +58,8 @@
</span><span class="cx">         return false;
</span><span class="cx">     if (!decoder.decode(result.m_customFixedPositionRect))
</span><span class="cx">         return false;
</span><ins>+    if (!decoder.decode(result.m_obscuredInset))
+        return false;
</ins><span class="cx">     if (!decoder.decode(result.m_lastLayerTreeTransactionID))
</span><span class="cx">         return false;
</span><span class="cx">     if (!decoder.decode(result.m_scale))
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedVisibleContentRectUpdateInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.h (199232 => 199233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.h        2016-04-08 17:21:32 UTC (rev 199232)
+++ trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.h        2016-04-08 17:22:19 UTC (rev 199233)
</span><span class="lines">@@ -39,11 +39,15 @@
</span><span class="cx"> public:
</span><span class="cx">     VisibleContentRectUpdateInfo() = default;
</span><span class="cx"> 
</span><del>-    VisibleContentRectUpdateInfo(const WebCore::FloatRect&amp; exposedContentRect, const WebCore::FloatRect&amp; unobscuredContentRect, const WebCore::FloatRect&amp; unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect&amp; customFixedPositionRect, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit, double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate, uint64_t lastLayerTreeTransactionId)
</del><ins>+    VisibleContentRectUpdateInfo(const WebCore::FloatRect&amp; exposedContentRect, const WebCore::FloatRect&amp; unobscuredContentRect,
+        const WebCore::FloatRect&amp; unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect&amp; customFixedPositionRect,
+        const WebCore::FloatSize&amp; obscuredInset, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit,
+        double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate, uint64_t lastLayerTreeTransactionId)
</ins><span class="cx">         : m_exposedContentRect(exposedContentRect)
</span><span class="cx">         , m_unobscuredContentRect(unobscuredContentRect)
</span><span class="cx">         , m_unobscuredRectInScrollViewCoordinates(unobscuredRectInScrollViewCoordinates)
</span><span class="cx">         , m_customFixedPositionRect(customFixedPositionRect)
</span><ins>+        , m_obscuredInset(obscuredInset)
</ins><span class="cx">         , m_lastLayerTreeTransactionID(lastLayerTreeTransactionId)
</span><span class="cx">         , m_scale(scale)
</span><span class="cx">         , m_timestamp(timestamp)
</span><span class="lines">@@ -60,6 +64,8 @@
</span><span class="cx">     const WebCore::FloatRect&amp; unobscuredContentRect() const { return m_unobscuredContentRect; }
</span><span class="cx">     const WebCore::FloatRect&amp; unobscuredRectInScrollViewCoordinates() const { return m_unobscuredRectInScrollViewCoordinates; }
</span><span class="cx">     const WebCore::FloatRect&amp; customFixedPositionRect() const { return m_customFixedPositionRect; }
</span><ins>+    const WebCore::FloatSize obscuredInset() const { return m_obscuredInset; }
+
</ins><span class="cx">     double scale() const { return m_scale; }
</span><span class="cx">     bool inStableState() const { return m_inStableState; }
</span><span class="cx">     bool isChangingObscuredInsetsInteractively() const { return m_isChangingObscuredInsetsInteractively; }
</span><span class="lines">@@ -80,6 +86,7 @@
</span><span class="cx">     WebCore::FloatRect m_unobscuredContentRect;
</span><span class="cx">     WebCore::FloatRect m_unobscuredRectInScrollViewCoordinates;
</span><span class="cx">     WebCore::FloatRect m_customFixedPositionRect;
</span><ins>+    WebCore::FloatSize m_obscuredInset;
</ins><span class="cx">     uint64_t m_lastLayerTreeTransactionID { 0 };
</span><span class="cx">     double m_scale { -1 };
</span><span class="cx">     double m_timestamp { 0 };
</span><span class="lines">@@ -98,6 +105,7 @@
</span><span class="cx">         &amp;&amp; a.exposedContentRect() == b.exposedContentRect()
</span><span class="cx">         &amp;&amp; a.unobscuredContentRect() == b.unobscuredContentRect()
</span><span class="cx">         &amp;&amp; a.customFixedPositionRect() == b.customFixedPositionRect()
</span><ins>+        &amp;&amp; a.obscuredInset() == b.obscuredInset()
</ins><span class="cx">         &amp;&amp; a.horizontalVelocity() == b.horizontalVelocity()
</span><span class="cx">         &amp;&amp; a.verticalVelocity() == b.verticalVelocity()
</span><span class="cx">         &amp;&amp; a.scaleChangeRate() == b.scaleChangeRate()
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (199232 => 199233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2016-04-08 17:21:32 UTC (rev 199232)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2016-04-08 17:22:19 UTC (rev 199233)
</span><span class="lines">@@ -224,9 +224,11 @@
</span><span class="cx">     Optional&lt;CGRect&gt; _frozenVisibleContentRect;
</span><span class="cx">     Optional&lt;CGRect&gt; _frozenUnobscuredContentRect;
</span><span class="cx"> 
</span><del>-    BOOL _needsToRestoreExposedRect;
-    BOOL _commitDidRestoreExposedRect;
-    WebCore::FloatRect _exposedRectToRestore;
</del><ins>+    BOOL _needsToRestoreScrollPosition;
+    BOOL _commitDidRestoreScrollPosition;
+    WebCore::FloatPoint _scrollOffsetToRestore;
+    WebCore::FloatSize _obscuredInsetWhenSaved;
+
</ins><span class="cx">     BOOL _needsToRestoreUnobscuredCenter;
</span><span class="cx">     WebCore::FloatPoint _unobscuredCenterToRestore;
</span><span class="cx">     uint64_t _firstTransactionIDAfterPageRestore;
</span><span class="lines">@@ -1112,7 +1114,7 @@
</span><span class="cx">     _needsResetViewStateAfterCommitLoadForMainFrame = NO;
</span><span class="cx">     _dynamicViewportUpdateMode = DynamicViewportUpdateMode::NotResizing;
</span><span class="cx">     [_contentView setHidden:NO];
</span><del>-    _needsToRestoreExposedRect = NO;
</del><ins>+    _needsToRestoreScrollPosition = NO;
</ins><span class="cx">     _needsToRestoreUnobscuredCenter = NO;
</span><span class="cx">     _scrollViewBackgroundColor = WebCore::Color();
</span><span class="cx">     _delayUpdateVisibleContentRects = NO;
</span><span class="lines">@@ -1211,15 +1213,17 @@
</span><span class="cx"> 
</span><span class="cx">     bool isTransactionAfterPageRestore = layerTreeTransaction.transactionID() &gt;= _firstTransactionIDAfterPageRestore;
</span><span class="cx"> 
</span><del>-    if (_needsToRestoreExposedRect &amp;&amp; isTransactionAfterPageRestore) {
-        _needsToRestoreExposedRect = NO;
</del><ins>+    if (_needsToRestoreScrollPosition &amp;&amp; isTransactionAfterPageRestore) {
+        _needsToRestoreScrollPosition = NO;
</ins><span class="cx"> 
</span><span class="cx">         if (areEssentiallyEqualAsFloat(contentZoomScale(self), _scaleToRestore)) {
</span><del>-            WebCore::FloatPoint exposedPosition = _exposedRectToRestore.location();
-            exposedPosition.scale(_scaleToRestore, _scaleToRestore);
</del><ins>+            WebCore::FloatPoint scaledScrollOffset = _scrollOffsetToRestore;
+            scaledScrollOffset.scale(_scaleToRestore, _scaleToRestore);
+            WebCore::FloatPoint contentOffsetInScrollViewCoordinates = scaledScrollOffset - _obscuredInsetWhenSaved;
</ins><span class="cx"> 
</span><del>-            changeContentOffsetBoundedInValidRange(_scrollView.get(), exposedPosition);
-            _commitDidRestoreExposedRect = YES;
</del><ins>+            changeContentOffsetBoundedInValidRange(_scrollView.get(), contentOffsetInScrollViewCoordinates);
+            _commitDidRestoreScrollPosition = YES;
+
</ins><span class="cx">             if (_gestureController)
</span><span class="cx">                 _gestureController-&gt;didRestoreScrollPosition();
</span><span class="cx">         }
</span><span class="lines">@@ -1250,7 +1254,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_layerTreeCommitComplete
</span><span class="cx"> {
</span><del>-    _commitDidRestoreExposedRect = NO;
</del><ins>+    _commitDidRestoreScrollPosition = NO;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_dynamicViewportUpdateChangedTargetToScale:(double)newScale position:(CGPoint)newScrollPosition nextValidLayerTreeTransactionID:(uint64_t)nextValidLayerTreeTransactionID
</span><span class="lines">@@ -1280,7 +1284,7 @@
</span><span class="cx">         _gestureController-&gt;didRestoreScrollPosition();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_restorePageStateToExposedRect:(WebCore::FloatRect)exposedRect scrollOrigin:(WebCore::IntPoint)scrollOrigin scale:(double)scale
</del><ins>+- (void)_restorePageScrollPosition:(WebCore::FloatPoint)scrollPosition scrollOrigin:(WebCore::FloatPoint)scrollOrigin previousObscuredInset:(WebCore::FloatSize)obscuredInset scale:(double)scale
</ins><span class="cx"> {
</span><span class="cx">     if (_dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing)
</span><span class="cx">         return;
</span><span class="lines">@@ -1289,12 +1293,11 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     _needsToRestoreUnobscuredCenter = NO;
</span><del>-    _needsToRestoreExposedRect = YES;
</del><ins>+    _needsToRestoreScrollPosition = YES;
</ins><span class="cx">     _firstTransactionIDAfterPageRestore = downcast&lt;WebKit::RemoteLayerTreeDrawingAreaProxy&gt;(*_page-&gt;drawingArea()).nextLayerTreeTransactionID();
</span><span class="cx">     
</span><del>-    // Move the exposed rect into scrollView coordinates.
-    exposedRect.move(toFloatSize(scrollOrigin));
-    _exposedRectToRestore = exposedRect;
</del><ins>+    _scrollOffsetToRestore = WebCore::ScrollableArea::scrollOffsetFromPosition(WebCore::FloatPoint(scrollPosition), WebCore::toFloatSize(scrollOrigin));
+    _obscuredInsetWhenSaved = obscuredInset;
</ins><span class="cx">     _scaleToRestore = scale;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1306,7 +1309,7 @@
</span><span class="cx">     if (_customContentView)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    _needsToRestoreExposedRect = NO;
</del><ins>+    _needsToRestoreScrollPosition = NO;
</ins><span class="cx">     _needsToRestoreUnobscuredCenter = YES;
</span><span class="cx">     _firstTransactionIDAfterPageRestore = downcast&lt;WebKit::RemoteLayerTreeDrawingAreaProxy&gt;(*_page-&gt;drawingArea()).nextLayerTreeTransactionID();
</span><span class="cx">     _unobscuredCenterToRestore = center;
</span><span class="lines">@@ -1405,7 +1408,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_scrollToContentScrollPosition:(WebCore::FloatPoint)scrollPosition scrollOrigin:(WebCore::IntPoint)scrollOrigin
</span><span class="cx"> {
</span><del>-    if (_commitDidRestoreExposedRect || _dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing)
</del><ins>+    if (_commitDidRestoreScrollPosition || _dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     WebCore::FloatPoint contentOffset = WebCore::ScrollableArea::scrollOffsetFromPosition(scrollPosition, toFloatSize(scrollOrigin));
</span><span class="lines">@@ -1931,6 +1934,7 @@
</span><span class="cx">     [_contentView didUpdateVisibleRect:visibleRectInContentCoordinates
</span><span class="cx">         unobscuredRect:unobscuredRectInContentCoordinates
</span><span class="cx">         unobscuredRectInScrollViewCoordinates:unobscuredRect
</span><ins>+        obscuredInset:CGSizeMake(_obscuredInsets.left, _obscuredInsets.top)
</ins><span class="cx">         scale:scaleFactor minimumScale:[_scrollView minimumZoomScale]
</span><span class="cx">         inStableState:isStableState
</span><span class="cx">         isChangingObscuredInsetsInteractively:_isChangingObscuredInsetsInteractively];
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h (199232 => 199233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h        2016-04-08 17:21:32 UTC (rev 199232)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h        2016-04-08 17:22:19 UTC (rev 199233)
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_dynamicViewportUpdateChangedTargetToScale:(double)newScale position:(CGPoint)newScrollPosition nextValidLayerTreeTransactionID:(uint64_t)nextValidLayerTreeTransactionID;
</span><span class="cx"> - (void)_couldNotRestorePageState;
</span><del>-- (void)_restorePageStateToExposedRect:(WebCore::FloatRect)exposedRect scrollOrigin:(WebCore::IntPoint)scrollOrigin scale:(double)scale;
</del><ins>+- (void)_restorePageScrollPosition:(WebCore::FloatPoint)scrollPosition scrollOrigin:(WebCore::FloatPoint)scrollOrigin previousObscuredInset:(WebCore::FloatSize)topInset scale:(double)scale;
</ins><span class="cx"> - (void)_restorePageStateToUnobscuredCenter:(WebCore::FloatPoint)center scale:(double)scale; // FIXME: needs scroll origin?
</span><span class="cx"> 
</span><span class="cx"> - (PassRefPtr&lt;WebKit::ViewSnapshot&gt;)_takeViewSnapshot;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPageClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (199232 => 199233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/PageClient.h        2016-04-08 17:21:32 UTC (rev 199232)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h        2016-04-08 17:22:19 UTC (rev 199233)
</span><span class="lines">@@ -285,8 +285,8 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint&amp; newScrollPosition, uint64_t transactionID) = 0;
</span><span class="cx">     virtual void couldNotRestorePageState() = 0;
</span><del>-    virtual void restorePageState(const WebCore::FloatRect&amp; exposedContentRect, const WebCore::IntPoint&amp; scrollOrigin, double scale) = 0;
-    virtual void restorePageCenterAndScale(const WebCore::FloatPoint&amp;, double) = 0;
</del><ins>+    virtual void restorePageState(const WebCore::FloatPoint&amp; scrollPosition, const WebCore::FloatPoint&amp; scrollOrigin, const WebCore::FloatSize&amp; obscuredInsetOnSave, double scale) = 0;
+    virtual void restorePageCenterAndScale(const WebCore::FloatPoint&amp; center, double scale) = 0;
</ins><span class="cx"> 
</span><span class="cx">     virtual void startAssistingNode(const AssistedNodeInformation&amp;, bool userIsInteracting, bool blurPreviousNode, API::Object* userData) = 0;
</span><span class="cx">     virtual void stopAssistingNode() = 0;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (199232 => 199233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2016-04-08 17:21:32 UTC (rev 199232)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2016-04-08 17:22:19 UTC (rev 199233)
</span><span class="lines">@@ -452,7 +452,7 @@
</span><span class="cx">     const WebCore::FloatRect&amp; exposedContentRect() const { return m_lastVisibleContentRectUpdate.exposedContentRect(); }
</span><span class="cx">     const WebCore::FloatRect&amp; unobscuredContentRect() const { return m_lastVisibleContentRectUpdate.unobscuredContentRect(); }
</span><span class="cx"> 
</span><del>-    void updateVisibleContentRects(const WebCore::FloatRect&amp; exposedRect, const WebCore::FloatRect&amp; unobscuredRect, const WebCore::FloatRect&amp; unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect&amp; customFixedPositionRect, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit, double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate);
</del><ins>+    void updateVisibleContentRects(const WebCore::FloatRect&amp; exposedRect, const WebCore::FloatRect&amp; unobscuredRect, const WebCore::FloatRect&amp; unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect&amp; customFixedPositionRect, const WebCore::FloatSize&amp; obscuredInset, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit, double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate);
</ins><span class="cx">     void resendLastVisibleContentRects();
</span><span class="cx"> 
</span><span class="cx">     enum class UnobscuredRectConstraint { ConstrainedToDocumentRect, Unconstrained };
</span><span class="lines">@@ -1410,7 +1410,7 @@
</span><span class="cx"> 
</span><span class="cx">     void dynamicViewportUpdateChangedTarget(double newTargetScale, const WebCore::FloatPoint&amp; newScrollPosition, uint64_t dynamicViewportSizeUpdateID);
</span><span class="cx">     void couldNotRestorePageState();
</span><del>-    void restorePageState(const WebCore::FloatRect&amp; exposedContentRect, const WebCore::IntPoint&amp; scrollOrigin, double scale);
</del><ins>+    void restorePageState(const WebCore::FloatPoint&amp; scrollPosition, const WebCore::FloatPoint&amp; scrollOrigin, const WebCore::FloatSize&amp; obscuredInsetOnSave, double scale);
</ins><span class="cx">     void restorePageCenterAndScale(const WebCore::FloatPoint&amp;, double scale);
</span><span class="cx"> 
</span><span class="cx">     void didGetTapHighlightGeometries(uint64_t requestID, const WebCore::Color&amp; color, const Vector&lt;WebCore::FloatQuad&gt;&amp; geometries, const WebCore::IntSize&amp; topLeftRadius, const WebCore::IntSize&amp; topRightRadius, const WebCore::IntSize&amp; bottomLeftRadius, const WebCore::IntSize&amp; bottomRightRadius);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (199232 => 199233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2016-04-08 17:21:32 UTC (rev 199232)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2016-04-08 17:22:19 UTC (rev 199233)
</span><span class="lines">@@ -358,7 +358,7 @@
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     DynamicViewportUpdateChangedTarget(double newTargetScale, WebCore::FloatPoint newScrollPosition, uint64_t dynamicViewportSizeUpdateID)
</span><span class="cx">     CouldNotRestorePageState()
</span><del>-    RestorePageState(WebCore::FloatRect exposedContentRect, WebCore::IntPoint scrollOrigin, double scale)
</del><ins>+    RestorePageState(WebCore::FloatPoint scrollPosition, WebCore::FloatPoint scrollOrigin, WebCore::FloatSize obscuredInsetOnSave, double scale)
</ins><span class="cx">     RestorePageCenterAndScale(WebCore::FloatPoint unobscuredCenter, double scale)
</span><span class="cx">     DidGetTapHighlightGeometries(uint64_t requestID, WebCore::Color color, Vector&lt;WebCore::FloatQuad&gt; geometries, WebCore::IntSize topLeftRadius, WebCore::IntSize topRightRadius, WebCore::IntSize bottomLeftRadius, WebCore::IntSize bottomRightRadius)
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h (199232 => 199233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2016-04-08 17:21:32 UTC (rev 199232)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2016-04-08 17:22:19 UTC (rev 199233)
</span><span class="lines">@@ -119,7 +119,7 @@
</span><span class="cx"> 
</span><span class="cx">     void dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint&amp; newScrollPosition, uint64_t transactionID) override;
</span><span class="cx">     void couldNotRestorePageState() override;
</span><del>-    void restorePageState(const WebCore::FloatRect&amp;, const WebCore::IntPoint&amp;, double) override;
</del><ins>+    void restorePageState(const WebCore::FloatPoint&amp;, const WebCore::FloatPoint&amp;, const WebCore::FloatSize&amp;, double) override;
</ins><span class="cx">     void restorePageCenterAndScale(const WebCore::FloatPoint&amp;, double) override;
</span><span class="cx"> 
</span><span class="cx">     void startAssistingNode(const AssistedNodeInformation&amp;, bool userIsInteracting, bool blurPreviousNode, API::Object* userData) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm (199232 => 199233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2016-04-08 17:21:32 UTC (rev 199232)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2016-04-08 17:22:19 UTC (rev 199233)
</span><span class="lines">@@ -511,9 +511,9 @@
</span><span class="cx">     [m_webView _couldNotRestorePageState];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PageClientImpl::restorePageState(const WebCore::FloatRect&amp; exposedContentRect, const WebCore::IntPoint&amp; scrollOrigin, double scale)
</del><ins>+void PageClientImpl::restorePageState(const WebCore::FloatPoint&amp; scrollPosition, const WebCore::FloatPoint&amp; scrollOrigin, const WebCore::FloatSize&amp; obscuredInsetOnSave, double scale)
</ins><span class="cx"> {
</span><del>-    [m_webView _restorePageStateToExposedRect:exposedContentRect scrollOrigin:scrollOrigin scale:scale];
</del><ins>+    [m_webView _restorePageScrollPosition:scrollPosition scrollOrigin:scrollOrigin previousObscuredInset:obscuredInsetOnSave scale:scale];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::restorePageCenterAndScale(const WebCore::FloatPoint&amp; center, double scale)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentView.h (199232 => 199233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentView.h        2016-04-08 17:21:32 UTC (rev 199232)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentView.h        2016-04-08 17:22:19 UTC (rev 199233)
</span><span class="lines">@@ -68,6 +68,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)didUpdateVisibleRect:(CGRect)visibleRect unobscuredRect:(CGRect)unobscuredRect
</span><span class="cx">     unobscuredRectInScrollViewCoordinates:(CGRect)unobscuredRectInScrollViewCoordinates
</span><ins>+    obscuredInset:(CGSize)topInset
</ins><span class="cx">     scale:(CGFloat)scale minimumScale:(CGFloat)minimumScale
</span><span class="cx">     inStableState:(BOOL)isStableState isChangingObscuredInsetsInteractively:(BOOL)isChangingObscuredInsetsInteractively;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm (199232 => 199233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm        2016-04-08 17:21:32 UTC (rev 199232)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm        2016-04-08 17:22:19 UTC (rev 199233)
</span><span class="lines">@@ -356,7 +356,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)didUpdateVisibleRect:(CGRect)visibleRect unobscuredRect:(CGRect)unobscuredRect unobscuredRectInScrollViewCoordinates:(CGRect)unobscuredRectInScrollViewCoordinates
</span><del>-    scale:(CGFloat)zoomScale minimumScale:(CGFloat)minimumScale inStableState:(BOOL)isStableState isChangingObscuredInsetsInteractively:(BOOL)isChangingObscuredInsetsInteractively
</del><ins>+    obscuredInset:(CGSize)obscuredInset scale:(CGFloat)zoomScale minimumScale:(CGFloat)minimumScale inStableState:(BOOL)isStableState isChangingObscuredInsetsInteractively:(BOOL)isChangingObscuredInsetsInteractively
</ins><span class="cx"> {
</span><span class="cx">     double timestamp = monotonicallyIncreasingTime();
</span><span class="cx">     HistoricalVelocityData::VelocityData velocityData;
</span><span class="lines">@@ -366,7 +366,7 @@
</span><span class="cx">         _historicalKinematicData.clear();
</span><span class="cx"> 
</span><span class="cx">     FloatRect fixedPositionRectForLayout = _page-&gt;computeCustomFixedPositionRect(unobscuredRect, zoomScale, WebPageProxy::UnobscuredRectConstraint::ConstrainedToDocumentRect);
</span><del>-    _page-&gt;updateVisibleContentRects(visibleRect, unobscuredRect, unobscuredRectInScrollViewCoordinates, fixedPositionRectForLayout,
</del><ins>+    _page-&gt;updateVisibleContentRects(visibleRect, unobscuredRect, unobscuredRectInScrollViewCoordinates, fixedPositionRectForLayout, WebCore::FloatSize(obscuredInset),
</ins><span class="cx">         zoomScale, isStableState, isChangingObscuredInsetsInteractively, _webView._allowsViewportShrinkToFit, timestamp, velocityData.horizontalVelocity, velocityData.verticalVelocity, velocityData.scaleChangeRate);
</span><span class="cx"> 
</span><span class="cx">     RemoteScrollingCoordinatorProxy* scrollingCoordinator = _page-&gt;scrollingCoordinatorProxy();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (199232 => 199233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2016-04-08 17:21:32 UTC (rev 199232)
+++ trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2016-04-08 17:22:19 UTC (rev 199233)
</span><span class="lines">@@ -182,12 +182,12 @@
</span><span class="cx">     callback-&gt;performCallbackWithReturnValue(beforeText, markedText, selectedText, afterText, location, length);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::updateVisibleContentRects(const WebCore::FloatRect&amp; exposedRect, const WebCore::FloatRect&amp; unobscuredRect, const WebCore::FloatRect&amp; unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect&amp; customFixedPositionRect, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit, double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate)
</del><ins>+void WebPageProxy::updateVisibleContentRects(const WebCore::FloatRect&amp; exposedRect, const WebCore::FloatRect&amp; unobscuredRect, const WebCore::FloatRect&amp; unobscuredRectInScrollViewCoordinates, const WebCore::FloatRect&amp; customFixedPositionRect, const WebCore::FloatSize&amp; obscuredInset, double scale, bool inStableState, bool isChangingObscuredInsetsInteractively, bool allowShrinkToFit, double timestamp, double horizontalVelocity, double verticalVelocity, double scaleChangeRate)
</ins><span class="cx"> {
</span><span class="cx">     if (!isValid())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    VisibleContentRectUpdateInfo visibleContentRectUpdateInfo(exposedRect, unobscuredRect, unobscuredRectInScrollViewCoordinates, customFixedPositionRect, scale, inStableState, isChangingObscuredInsetsInteractively, allowShrinkToFit, timestamp, horizontalVelocity, verticalVelocity, scaleChangeRate, downcast&lt;RemoteLayerTreeDrawingAreaProxy&gt;(*drawingArea()).lastCommittedLayerTreeTransactionID());
</del><ins>+    VisibleContentRectUpdateInfo visibleContentRectUpdateInfo(exposedRect, unobscuredRect, unobscuredRectInScrollViewCoordinates, customFixedPositionRect, obscuredInset, scale, inStableState, isChangingObscuredInsetsInteractively, allowShrinkToFit, timestamp, horizontalVelocity, verticalVelocity, scaleChangeRate, downcast&lt;RemoteLayerTreeDrawingAreaProxy&gt;(*drawingArea()).lastCommittedLayerTreeTransactionID());
</ins><span class="cx"> 
</span><span class="cx">     if (visibleContentRectUpdateInfo == m_lastVisibleContentRectUpdate)
</span><span class="cx">         return;
</span><span class="lines">@@ -819,9 +819,9 @@
</span><span class="cx">     m_pageClient.couldNotRestorePageState();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::restorePageState(const WebCore::FloatRect&amp; exposedContentRect, const WebCore::IntPoint&amp; scrollOrigin, double scale)
</del><ins>+void WebPageProxy::restorePageState(const WebCore::FloatPoint&amp; scrollPosition, const WebCore::FloatPoint&amp; scrollOrigin, const WebCore::FloatSize&amp; obscuredInsetOnSave, double scale)
</ins><span class="cx"> {
</span><del>-    m_pageClient.restorePageState(exposedContentRect, scrollOrigin, scale);
</del><ins>+    m_pageClient.restorePageState(scrollPosition, scrollOrigin, obscuredInsetOnSave, scale);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPageProxy::restorePageCenterAndScale(const WebCore::FloatPoint&amp; center, double scale)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (199232 => 199233)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2016-04-08 17:21:32 UTC (rev 199232)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2016-04-08 17:22:19 UTC (rev 199233)
</span><span class="lines">@@ -299,7 +299,7 @@
</span><span class="cx"> 
</span><span class="cx">         m_drawingArea-&gt;setExposedContentRect(historyItem.exposedContentRect());
</span><span class="cx"> 
</span><del>-        send(Messages::WebPageProxy::RestorePageState(historyItem.exposedContentRect(), frameView.scrollOrigin(), boundedScale));
</del><ins>+        send(Messages::WebPageProxy::RestorePageState(historyItem.scrollPosition(), frameView.scrollOrigin(), historyItem.obscuredInset(), boundedScale));
</ins><span class="cx">     } else {
</span><span class="cx">         IntSize oldContentSize = historyItem.contentSize();
</span><span class="cx">         IntSize newContentSize = frameView.contentsSize();
</span><span class="lines">@@ -2964,6 +2964,7 @@
</span><span class="cx">         viewportConfigurationChanged();
</span><span class="cx"> 
</span><span class="cx">     frameView.setUnobscuredContentSize(visibleContentRectUpdateInfo.unobscuredContentRect().size());
</span><ins>+    frameView.platformSetObscuredInset(visibleContentRectUpdateInfo.obscuredInset());
</ins><span class="cx"> 
</span><span class="cx">     double horizontalVelocity = visibleContentRectUpdateInfo.horizontalVelocity();
</span><span class="cx">     double verticalVelocity = visibleContentRectUpdateInfo.verticalVelocity();
</span></span></pre>
</div>
</div>

</body>
</html>