<!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>[169603] 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/169603">169603</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2014-06-04 16:41:15 -0700 (Wed, 04 Jun 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[iOS][WK2] Restore the visual scroll position instead of the dom scroll position when restoring states from the history
https://bugs.webkit.org/show_bug.cgi?id=133490

Patch by Benjamin Poulain &lt;bpoulain@apple.com&gt; on 2014-06-04
Reviewed by Tim Horton.


Source/WebCore: 
Expose the WebKit1 parameter &quot;ScaleIsInitial&quot;. It is used for a similar concept in WebKit2 (userHasChangedPageScaleFactor).

Add &quot;exposedContentPosition&quot;, which is the scroll position of the exposed rect.

* history/HistoryItem.h:
(WebCore::HistoryItem::exposedContentPosition):
(WebCore::HistoryItem::setExposedContentPosition):
(WebCore::HistoryItem::setScaleIsInitial):
* loader/HistoryController.cpp:
(WebCore::HistoryController::saveScrollPositionAndViewStateToItem):

Source/WebKit2: 
Instead of restoring the scroll position, restore the visual position. This makes pages appear at the same position
on screen ignoring changes in the obscured top inset.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
* WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
(WebKit::WebFrameLoaderClient::saveViewStateToItem):
(WebKit::WebFrameLoaderClient::restoreViewState):
Save and restore userHasChangedPageScaleFactor to handle rescaling correctly.
Limit the scale into valid viewport limits in case the viewport meta tag has changed or the device has rotated.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::userHasChangedPageScaleFactor):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::restorePageState):
(WebKit::WebPage::updateVisibleContentRects):
In updateVisibleContentRects, we keep track or the current difference between the exposed rect and the unobscured rect.
When restoring the page position, we use the current top inset and the saved exposed rect to restore the visual
scroll position.

It is not very robust as it does not resolve races between the two processes, but that is not worse than what we is there now.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</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="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportiosWebFrameLoaderClientIOSmm">trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageh">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#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 (169602 => 169603)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-06-04 22:37:00 UTC (rev 169602)
+++ trunk/Source/WebCore/ChangeLog        2014-06-04 23:41:15 UTC (rev 169603)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2014-06-04  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
+
+        [iOS][WK2] Restore the visual scroll position instead of the dom scroll position when restoring states from the history
+        https://bugs.webkit.org/show_bug.cgi?id=133490
+
+        Reviewed by Tim Horton.
+
+        Expose the WebKit1 parameter &quot;ScaleIsInitial&quot;. It is used for a similar concept in WebKit2 (userHasChangedPageScaleFactor).
+
+        Add &quot;exposedContentPosition&quot;, which is the scroll position of the exposed rect.
+
+        * history/HistoryItem.h:
+        (WebCore::HistoryItem::exposedContentPosition):
+        (WebCore::HistoryItem::setExposedContentPosition):
+        (WebCore::HistoryItem::setScaleIsInitial):
+        * loader/HistoryController.cpp:
+        (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
+
</ins><span class="cx"> 2014-06-04  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Enable WebGL on Windows.
</span></span></pre></div>
<a id="trunkSourceWebCorehistoryHistoryItemh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/history/HistoryItem.h (169602 => 169603)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/history/HistoryItem.h        2014-06-04 22:37:00 UTC (rev 169602)
+++ trunk/Source/WebCore/history/HistoryItem.h        2014-06-04 23:41:15 UTC (rev 169603)
</span><span class="lines">@@ -180,8 +180,12 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><ins>+    IntPoint exposedContentPosition() const { return m_exposedContentPosition; }
+    void setExposedContentPosition(IntPoint exposedContentPosition) { m_exposedContentPosition = exposedContentPosition; }
+
</ins><span class="cx">     float scale() const { return m_scale; }
</span><span class="cx">     bool scaleIsInitial() const { return m_scaleIsInitial; }
</span><ins>+    void setScaleIsInitial(bool scaleIsInitial) { m_scaleIsInitial = scaleIsInitial; }
</ins><span class="cx">     void setScale(float newScale, bool isInitial)
</span><span class="cx">     {
</span><span class="cx">         m_scale = newScale;
</span><span class="lines">@@ -255,6 +259,7 @@
</span><span class="cx">     std::unique_ptr&lt;CachedPage&gt; m_cachedPage;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><ins>+    IntPoint m_exposedContentPosition;
</ins><span class="cx">     float m_scale;
</span><span class="cx">     bool m_scaleIsInitial;
</span><span class="cx">     ViewportArguments m_viewportArguments;
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderHistoryControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/HistoryController.cpp (169602 => 169603)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/HistoryController.cpp        2014-06-04 22:37:00 UTC (rev 169602)
+++ trunk/Source/WebCore/loader/HistoryController.cpp        2014-06-04 23:41:15 UTC (rev 169603)
</span><span class="lines">@@ -78,6 +78,9 @@
</span><span class="cx">         item-&gt;setScrollPoint(m_frame.view()-&gt;cachedScrollPosition());
</span><span class="cx">     else
</span><span class="cx">         item-&gt;setScrollPoint(m_frame.view()-&gt;scrollPosition());
</span><ins>+#if PLATFORM(IOS)
+    item-&gt;setExposedContentPosition(m_frame.view()-&gt;exposedContentRect().location());
+#endif
</ins><span class="cx"> 
</span><span class="cx">     Page* page = m_frame.page();
</span><span class="cx">     if (page &amp;&amp; m_frame.isMainFrame())
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (169602 => 169603)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-06-04 22:37:00 UTC (rev 169602)
+++ trunk/Source/WebKit2/ChangeLog        2014-06-04 23:41:15 UTC (rev 169603)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2014-06-04  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
+
+        [iOS][WK2] Restore the visual scroll position instead of the dom scroll position when restoring states from the history
+        https://bugs.webkit.org/show_bug.cgi?id=133490
+
+        Reviewed by Tim Horton.
+
+        Instead of restoring the scroll position, restore the visual position. This makes pages appear at the same position
+        on screen ignoring changes in the obscured top inset.
+
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
+        (WebKit::WebFrameLoaderClient::saveViewStateToItem):
+        (WebKit::WebFrameLoaderClient::restoreViewState):
+        Save and restore userHasChangedPageScaleFactor to handle rescaling correctly.
+        Limit the scale into valid viewport limits in case the viewport meta tag has changed or the device has rotated.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::WebPage):
+        * WebProcess/WebPage/WebPage.h:
+        (WebKit::WebPage::userHasChangedPageScaleFactor):
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::restorePageState):
+        (WebKit::WebPage::updateVisibleContentRects):
+        In updateVisibleContentRects, we keep track or the current difference between the exposed rect and the unobscured rect.
+        When restoring the page position, we use the current top inset and the saved exposed rect to restore the visual
+        scroll position.
+
+        It is not very robust as it does not resolve races between the two processes, but that is not worse than what we is there now.
+
</ins><span class="cx"> 2014-06-03  Timothy Horton  &lt;timothy_horton@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WebKit2 View Gestures (Zoom): Can show unpainted regions when zoom-pinching-out
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (169602 => 169603)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2014-06-04 22:37:00 UTC (rev 169602)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2014-06-04 23:41:15 UTC (rev 169603)
</span><span class="lines">@@ -1119,12 +1119,12 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> void WebFrameLoaderClient::saveViewStateToItem(HistoryItem*)
</span><span class="cx"> {
</span><span class="cx">     notImplemented();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if !PLATFORM(IOS)
</del><span class="cx"> void WebFrameLoaderClient::restoreViewState()
</span><span class="cx"> {
</span><span class="cx">     // Inform the UI process of the scale factor.
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportiosWebFrameLoaderClientIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm (169602 => 169603)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm        2014-06-04 22:37:00 UTC (rev 169602)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm        2014-06-04 23:41:15 UTC (rev 169603)
</span><span class="lines">@@ -79,18 +79,21 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+void WebFrameLoaderClient::saveViewStateToItem(HistoryItem* historyItem)
+{
+    if (m_frame-&gt;isMainFrame())
+        historyItem-&gt;setScaleIsInitial(m_frame-&gt;page()-&gt;userHasChangedPageScaleFactor());
+}
+
</ins><span class="cx"> void WebFrameLoaderClient::restoreViewState()
</span><span class="cx"> {
</span><span class="cx">     Frame&amp; frame = *m_frame-&gt;coreFrame();
</span><span class="cx">     HistoryItem* currentItem = frame.loader().history().currentItem();
</span><span class="cx">     if (FrameView* view = frame.view()) {
</span><del>-        Page* page = frame.page();
-        if (!view-&gt;wasScrolledByUser()) {
-            if (page &amp;&amp; m_frame-&gt;isMainFrame() &amp;&amp; currentItem-&gt;pageScaleFactor())
-                m_frame-&gt;page()-&gt;restorePageState(currentItem-&gt;pageScaleFactor(), currentItem-&gt;scrollPoint());
-            else
-                view-&gt;setScrollPosition(currentItem-&gt;scrollPoint());
-        }
</del><ins>+        if (m_frame-&gt;isMainFrame() &amp;&amp; currentItem-&gt;pageScaleFactor())
+            m_frame-&gt;page()-&gt;restorePageState(currentItem-&gt;pageScaleFactor(), currentItem-&gt;scaleIsInitial(), currentItem-&gt;exposedContentPosition());
+        else if (!view-&gt;wasScrolledByUser())
+            view-&gt;setScrollPosition(currentItem-&gt;scrollPoint());
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (169602 => 169603)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-06-04 22:37:00 UTC (rev 169602)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-06-04 23:41:15 UTC (rev 169603)
</span><span class="lines">@@ -293,6 +293,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     , m_lastVisibleContentRectUpdateID(0)
</span><ins>+    , m_obscuredTopInset(0)
</ins><span class="cx">     , m_hasReceivedVisibleContentRectsAfterDidCommitLoad(false)
</span><span class="cx">     , m_scaleWasSetByUIProcess(false)
</span><span class="cx">     , m_userHasChangedPageScaleFactor(false)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (169602 => 169603)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-06-04 22:37:00 UTC (rev 169602)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-06-04 23:41:15 UTC (rev 169603)
</span><span class="lines">@@ -453,11 +453,12 @@
</span><span class="cx">     WebCore::FloatSize availableScreenSize() const;
</span><span class="cx">     void viewportPropertiesDidChange(const WebCore::ViewportArguments&amp;);
</span><span class="cx">     void didReceiveMobileDocType(bool);
</span><del>-    void restorePageState(double scale, const WebCore::IntPoint&amp; origin);
</del><ins>+    void restorePageState(double scale, bool userHasChangedPageScaleFactor, const WebCore::IntPoint&amp; exposedOrigin);
</ins><span class="cx"> 
</span><span class="cx">     double minimumPageScaleFactor() const;
</span><span class="cx">     double maximumPageScaleFactor() const;
</span><span class="cx">     bool allowsUserScaling() const;
</span><ins>+    bool userHasChangedPageScaleFactor() const { return m_userHasChangedPageScaleFactor; }
</ins><span class="cx"> 
</span><span class="cx">     void handleTap(const WebCore::IntPoint&amp;);
</span><span class="cx">     void potentialTapAtPosition(uint64_t requestID, const WebCore::FloatPoint&amp;);
</span><span class="lines">@@ -1206,6 +1207,7 @@
</span><span class="cx"> 
</span><span class="cx">     WebCore::ViewportConfiguration m_viewportConfiguration;
</span><span class="cx">     uint64_t m_lastVisibleContentRectUpdateID;
</span><ins>+    float m_obscuredTopInset;
</ins><span class="cx">     bool m_hasReceivedVisibleContentRectsAfterDidCommitLoad;
</span><span class="cx">     bool m_scaleWasSetByUIProcess;
</span><span class="cx">     bool m_userHasChangedPageScaleFactor;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (169602 => 169603)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-06-04 22:37:00 UTC (rev 169602)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-06-04 23:41:15 UTC (rev 169603)
</span><span class="lines">@@ -151,13 +151,17 @@
</span><span class="cx">         resetViewportDefaultConfiguration(m_mainFrame.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPage::restorePageState(double scale, const IntPoint&amp; scrollPosition)
</del><ins>+void WebPage::restorePageState(double scale, bool userHasChangedPageScaleFactor, const IntPoint&amp; exposedOrigin)
</ins><span class="cx"> {
</span><del>-    scalePage(scale, scrollPosition);
</del><ins>+    // FIXME: ideally, we should sync this with the UIProcess. We should not try to change the position if the user is interacting
+    // with the page, and we should send the new scroll position as soon as possible to the UIProcess.
+
+    float boundedScale = std::min&lt;float&gt;(m_viewportConfiguration.maximumScale(), std::max&lt;float&gt;(m_viewportConfiguration.minimumScale(), scale));
+    float topInsetInPageCoordinates = m_obscuredTopInset / boundedScale;
+    IntPoint scrollPosition(exposedOrigin.x(), exposedOrigin.y() + topInsetInPageCoordinates);
+    scalePage(boundedScale, scrollPosition);
</ins><span class="cx">     m_page-&gt;mainFrame().view()-&gt;setScrollPosition(scrollPosition);
</span><del>-
-    // FIXME: we should get the value of userHasChangedPageScaleFactor from the history.
-    m_userHasChangedPageScaleFactor = true;
</del><ins>+    m_userHasChangedPageScaleFactor = userHasChangedPageScaleFactor;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> double WebPage::minimumPageScaleFactor() const
</span><span class="lines">@@ -2273,6 +2277,7 @@
</span><span class="cx"> {
</span><span class="cx">     m_hasReceivedVisibleContentRectsAfterDidCommitLoad = true;
</span><span class="cx">     m_lastVisibleContentRectUpdateID = visibleContentRectUpdateInfo.updateID();
</span><ins>+    m_obscuredTopInset = (visibleContentRectUpdateInfo.unobscuredRect().y() - visibleContentRectUpdateInfo.exposedRect().y()) * visibleContentRectUpdateInfo.scale();
</ins><span class="cx"> 
</span><span class="cx">     double scaleNoiseThreshold = 0.005;
</span><span class="cx">     double filteredScale = visibleContentRectUpdateInfo.scale();
</span></span></pre>
</div>
</div>

</body>
</html>