<!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>[184290] 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/184290">184290</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2015-05-13 11:11:38 -0700 (Wed, 13 May 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>View scale changes are temporarily lost after restoring a page from the page cache
https://bugs.webkit.org/show_bug.cgi?id=144934

Reviewed by Brady Eidson.

* history/CachedPage.cpp:
(WebCore::CachedPage::CachedPage):
(WebCore::CachedPage::restore):
(WebCore::CachedPage::clear):
* history/CachedPage.h:
(WebCore::CachedPage::markForDeviceOrPageScaleChanged): Renamed.
* history/PageCache.cpp:
(WebCore::PageCache::markPagesForDeviceOrPageScaleChanged): Renamed.
* history/PageCache.h:
Rename PageCache/CachedPage methods to make it more clear that they
will eventually result in calling deviceOrPageScaleFactorChanged().
Also, use modern initialization for CachedPage members.

* loader/HistoryController.cpp:
(WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
(WebCore::HistoryController::restoreScrollPositionAndViewState):
Store the pageScaleFactor on HistoryItem with the view scale factored out,
because the view scale can change while the page is in the page cache, and
WebCore needs a way - without consulting with WebKit2 - to apply the changed
view scale to the cached page scale.

* page/Page.cpp:
(WebCore::Page::setViewScaleFactor):
(WebCore::Page::setDeviceScaleFactor):
* page/Page.h:
(WebCore::Page::viewScaleFactor):
Keep track of the viewScaleFactor, and mark all pages in the page cache
as needing to call deviceOrPageScaleFactorChanged and do a full style recalc
when they come back from the page cache.

For now, we expect all callers of setPageScaleFactor (including WebKit2 and
HistoryController) to multiply the viewScale in manually, to avoid the
significant amount of change in WebCore that would be required to keep them
totally separately.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::WebPage::scalePage):
(WebKit::WebPage::scalePageInViewCoordinates):
(WebKit::WebPage::pageScaleFactor):
(WebKit::WebPage::viewScaleFactor):
(WebKit::WebPage::scaleView):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::viewScaleFactor): Deleted.
Get rid of m_viewScaleFactor, instead using Page::viewScaleFactor.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehistoryCachedPagecpp">trunk/Source/WebCore/history/CachedPage.cpp</a></li>
<li><a href="#trunkSourceWebCorehistoryCachedPageh">trunk/Source/WebCore/history/CachedPage.h</a></li>
<li><a href="#trunkSourceWebCorehistoryPageCachecpp">trunk/Source/WebCore/history/PageCache.cpp</a></li>
<li><a href="#trunkSourceWebCorehistoryPageCacheh">trunk/Source/WebCore/history/PageCache.h</a></li>
<li><a href="#trunkSourceWebCoreloaderHistoryControllercpp">trunk/Source/WebCore/loader/HistoryController.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePagecpp">trunk/Source/WebCore/page/Page.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageh">trunk/Source/WebCore/page/Page.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</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>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (184289 => 184290)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-05-13 17:58:59 UTC (rev 184289)
+++ trunk/Source/WebCore/ChangeLog        2015-05-13 18:11:38 UTC (rev 184290)
</span><span class="lines">@@ -1,3 +1,45 @@
</span><ins>+2015-05-13  Timothy Horton  &lt;timothy_horton@apple.com&gt;
+
+        View scale changes are temporarily lost after restoring a page from the page cache
+        https://bugs.webkit.org/show_bug.cgi?id=144934
+
+        Reviewed by Brady Eidson.
+
+        * history/CachedPage.cpp:
+        (WebCore::CachedPage::CachedPage):
+        (WebCore::CachedPage::restore):
+        (WebCore::CachedPage::clear):
+        * history/CachedPage.h:
+        (WebCore::CachedPage::markForDeviceOrPageScaleChanged): Renamed.
+        * history/PageCache.cpp:
+        (WebCore::PageCache::markPagesForDeviceOrPageScaleChanged): Renamed.
+        * history/PageCache.h:
+        Rename PageCache/CachedPage methods to make it more clear that they
+        will eventually result in calling deviceOrPageScaleFactorChanged().
+        Also, use modern initialization for CachedPage members.
+
+        * loader/HistoryController.cpp:
+        (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
+        (WebCore::HistoryController::restoreScrollPositionAndViewState):
+        Store the pageScaleFactor on HistoryItem with the view scale factored out,
+        because the view scale can change while the page is in the page cache, and
+        WebCore needs a way - without consulting with WebKit2 - to apply the changed
+        view scale to the cached page scale.
+
+        * page/Page.cpp:
+        (WebCore::Page::setViewScaleFactor):
+        (WebCore::Page::setDeviceScaleFactor):
+        * page/Page.h:
+        (WebCore::Page::viewScaleFactor):
+        Keep track of the viewScaleFactor, and mark all pages in the page cache
+        as needing to call deviceOrPageScaleFactorChanged and do a full style recalc
+        when they come back from the page cache.
+
+        For now, we expect all callers of setPageScaleFactor (including WebKit2 and
+        HistoryController) to multiply the viewScale in manually, to avoid the
+        significant amount of change in WebCore that would be required to keep them
+        totally separately.
+
</ins><span class="cx"> 2015-05-12  Zan Dobersek  &lt;zdobersek@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reduce TransformationMatrix copies in MatrixTransformOperation, Matrix3DTransformOperation
</span></span></pre></div>
<a id="trunkSourceWebCorehistoryCachedPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/history/CachedPage.cpp (184289 => 184290)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/history/CachedPage.cpp        2015-05-13 17:58:59 UTC (rev 184289)
+++ trunk/Source/WebCore/history/CachedPage.cpp        2015-05-13 18:11:38 UTC (rev 184290)
</span><span class="lines">@@ -52,12 +52,6 @@
</span><span class="cx"> CachedPage::CachedPage(Page&amp; page)
</span><span class="cx">     : m_expirationTime(monotonicallyIncreasingTime() + page.settings().backForwardCacheExpirationInterval())
</span><span class="cx">     , m_cachedMainFrame(std::make_unique&lt;CachedFrame&gt;(page.mainFrame()))
</span><del>-    , m_needStyleRecalcForVisitedLinks(false)
-    , m_needsFullStyleRecalc(false)
-#if ENABLE(VIDEO_TRACK)
-    , m_needsCaptionPreferencesChanged(false)
-#endif
-    , m_needsDeviceScaleChanged(false)
</del><span class="cx"> {
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx">     cachedPageCounter.increment();
</span><span class="lines">@@ -111,7 +105,7 @@
</span><span class="cx">             frame-&gt;document()-&gt;visitedLinkState().invalidateStyleForAllLinks();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (m_needsDeviceScaleChanged)
</del><ins>+    if (m_needsDeviceOrPageScaleChanged)
</ins><span class="cx">         page.mainFrame().deviceOrPageScaleFactorChanged();
</span><span class="cx"> 
</span><span class="cx">     if (m_needsFullStyleRecalc)
</span><span class="lines">@@ -135,7 +129,7 @@
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx">     m_needsCaptionPreferencesChanged = false;
</span><span class="cx"> #endif
</span><del>-    m_needsDeviceScaleChanged = false;
</del><ins>+    m_needsDeviceOrPageScaleChanged = false;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool CachedPage::hasExpired() const
</span></span></pre></div>
<a id="trunkSourceWebCorehistoryCachedPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/history/CachedPage.h (184289 => 184290)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/history/CachedPage.h        2015-05-13 17:58:59 UTC (rev 184289)
+++ trunk/Source/WebCore/history/CachedPage.h        2015-05-13 18:11:38 UTC (rev 184290)
</span><span class="lines">@@ -55,17 +55,17 @@
</span><span class="cx">     void markForCaptionPreferencesChanged() { m_needsCaptionPreferencesChanged = true; }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    void markForDeviceScaleChanged() { m_needsDeviceScaleChanged = true; }
</del><ins>+    void markForDeviceOrPageScaleChanged() { m_needsDeviceOrPageScaleChanged = true; }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     double m_expirationTime;
</span><span class="cx">     std::unique_ptr&lt;CachedFrame&gt; m_cachedMainFrame;
</span><del>-    bool m_needStyleRecalcForVisitedLinks;
-    bool m_needsFullStyleRecalc;
</del><ins>+    bool m_needStyleRecalcForVisitedLinks { false };
+    bool m_needsFullStyleRecalc { false };
</ins><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><del>-    bool m_needsCaptionPreferencesChanged;
</del><ins>+    bool m_needsCaptionPreferencesChanged { false };
</ins><span class="cx"> #endif
</span><del>-    bool m_needsDeviceScaleChanged;
</del><ins>+    bool m_needsDeviceOrPageScaleChanged { false };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehistoryPageCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/history/PageCache.cpp (184289 => 184290)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/history/PageCache.cpp        2015-05-13 17:58:59 UTC (rev 184289)
+++ trunk/Source/WebCore/history/PageCache.cpp        2015-05-13 18:11:38 UTC (rev 184290)
</span><span class="lines">@@ -390,12 +390,12 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PageCache::markPagesForDeviceScaleChanged(Page&amp; page)
</del><ins>+void PageCache::markPagesForDeviceOrPageScaleChanged(Page&amp; page)
</ins><span class="cx"> {
</span><span class="cx">     for (auto&amp; item : m_items) {
</span><span class="cx">         CachedPage&amp; cachedPage = *item-&gt;m_cachedPage;
</span><span class="cx">         if (&amp;page.mainFrame() == &amp;cachedPage.cachedMainFrame()-&gt;view()-&gt;frame())
</span><del>-            cachedPage.markForDeviceScaleChanged();
</del><ins>+            cachedPage.markForDeviceOrPageScaleChanged();
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehistoryPageCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/history/PageCache.h (184289 => 184290)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/history/PageCache.h        2015-05-13 17:58:59 UTC (rev 184289)
+++ trunk/Source/WebCore/history/PageCache.h        2015-05-13 18:11:38 UTC (rev 184290)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx">     WEBCORE_EXPORT void markPagesForVisitedLinkStyleRecalc();
</span><span class="cx">     // Will mark all cached pages associated with the given page as needing style recalc.
</span><span class="cx">     void markPagesForFullStyleRecalc(Page&amp;);
</span><del>-    void markPagesForDeviceScaleChanged(Page&amp;);
</del><ins>+    void markPagesForDeviceOrPageScaleChanged(Page&amp;);
</ins><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx">     void markPagesForCaptionPreferencesChanged();
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderHistoryControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/HistoryController.cpp (184289 => 184290)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/HistoryController.cpp        2015-05-13 17:58:59 UTC (rev 184289)
+++ trunk/Source/WebCore/loader/HistoryController.cpp        2015-05-13 18:11:38 UTC (rev 184290)
</span><span class="lines">@@ -86,7 +86,7 @@
</span><span class="cx"> 
</span><span class="cx">     Page* page = m_frame.page();
</span><span class="cx">     if (page &amp;&amp; m_frame.isMainFrame())
</span><del>-        item-&gt;setPageScaleFactor(page-&gt;pageScaleFactor());
</del><ins>+        item-&gt;setPageScaleFactor(page-&gt;pageScaleFactor() / page-&gt;viewScaleFactor());
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: It would be great to work out a way to put this code in WebCore instead of calling through to the client.
</span><span class="cx">     m_frame.loader().client().saveViewStateToItem(item);
</span><span class="lines">@@ -151,7 +151,7 @@
</span><span class="cx">     if (view &amp;&amp; !view-&gt;wasScrolledByUser()) {
</span><span class="cx">         Page* page = m_frame.page();
</span><span class="cx">         if (page &amp;&amp; m_frame.isMainFrame() &amp;&amp; m_currentItem-&gt;pageScaleFactor())
</span><del>-            page-&gt;setPageScaleFactor(m_currentItem-&gt;pageScaleFactor(), m_currentItem-&gt;scrollPoint());
</del><ins>+            page-&gt;setPageScaleFactor(m_currentItem-&gt;pageScaleFactor() * page-&gt;viewScaleFactor(), m_currentItem-&gt;scrollPoint());
</ins><span class="cx">         else
</span><span class="cx">             view-&gt;setScrollPosition(m_currentItem-&gt;scrollPoint());
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.cpp (184289 => 184290)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.cpp        2015-05-13 17:58:59 UTC (rev 184289)
+++ trunk/Source/WebCore/page/Page.cpp        2015-05-13 18:11:38 UTC (rev 184290)
</span><span class="lines">@@ -832,6 +832,16 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void Page::setViewScaleFactor(float scale)
+{
+    if (m_viewScaleFactor == scale)
+        return;
+
+    m_viewScaleFactor = scale;
+    PageCache::singleton().markPagesForDeviceOrPageScaleChanged(*this);
+    PageCache::singleton().markPagesForFullStyleRecalc(*this);
+}
+
</ins><span class="cx"> void Page::setDeviceScaleFactor(float scaleFactor)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(scaleFactor &gt; 0);
</span><span class="lines">@@ -845,7 +855,7 @@
</span><span class="cx">     setNeedsRecalcStyleInAllFrames();
</span><span class="cx"> 
</span><span class="cx">     mainFrame().deviceOrPageScaleFactorChanged();
</span><del>-    PageCache::singleton().markPagesForDeviceScaleChanged(*this);
</del><ins>+    PageCache::singleton().markPagesForDeviceOrPageScaleChanged(*this);
</ins><span class="cx"> 
</span><span class="cx">     PageCache::singleton().markPagesForFullStyleRecalc(*this);
</span><span class="cx">     GraphicsContext::updateDocumentMarkerResources();
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.h (184289 => 184290)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.h        2015-05-13 17:58:59 UTC (rev 184289)
+++ trunk/Source/WebCore/page/Page.h        2015-05-13 18:11:38 UTC (rev 184290)
</span><span class="lines">@@ -260,6 +260,11 @@
</span><span class="cx">     WEBCORE_EXPORT void setPageScaleFactor(float scale, const IntPoint&amp; origin, bool inStableState = true);
</span><span class="cx">     float pageScaleFactor() const { return m_pageScaleFactor; }
</span><span class="cx"> 
</span><ins>+    // The view scale factor is multiplied into the page scale factor by all
+    // callers of setPageScaleFactor.
+    WEBCORE_EXPORT void setViewScaleFactor(float);
+    float viewScaleFactor() const { return m_viewScaleFactor; }
+
</ins><span class="cx">     WEBCORE_EXPORT void setZoomedOutPageScaleFactor(float);
</span><span class="cx">     float zoomedOutPageScaleFactor() const { return m_zoomedOutPageScaleFactor; }
</span><span class="cx"> 
</span><span class="lines">@@ -520,6 +525,7 @@
</span><span class="cx">     float m_pageScaleFactor;
</span><span class="cx">     float m_zoomedOutPageScaleFactor;
</span><span class="cx">     float m_deviceScaleFactor;
</span><ins>+    float m_viewScaleFactor { 1 };
</ins><span class="cx"> 
</span><span class="cx">     float m_topContentInset;
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (184289 => 184290)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-05-13 17:58:59 UTC (rev 184289)
+++ trunk/Source/WebKit2/ChangeLog        2015-05-13 18:11:38 UTC (rev 184290)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2015-05-13  Timothy Horton  &lt;timothy_horton@apple.com&gt;
+
+        View scale changes are temporarily lost after restoring a page from the page cache
+        https://bugs.webkit.org/show_bug.cgi?id=144934
+
+        Reviewed by Brady Eidson.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::WebPage):
+        (WebKit::WebPage::scalePage):
+        (WebKit::WebPage::scalePageInViewCoordinates):
+        (WebKit::WebPage::pageScaleFactor):
+        (WebKit::WebPage::viewScaleFactor):
+        (WebKit::WebPage::scaleView):
+        * WebProcess/WebPage/WebPage.h:
+        (WebKit::WebPage::viewScaleFactor): Deleted.
+        Get rid of m_viewScaleFactor, instead using Page::viewScaleFactor.
+
</ins><span class="cx"> 2015-05-13  Sungmann Cho  &lt;sungmann.cho@navercorp.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Minor cleanups to PluginProxy.cpp.
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (184289 => 184290)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2015-05-13 17:58:59 UTC (rev 184289)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2015-05-13 18:11:38 UTC (rev 184290)
</span><span class="lines">@@ -338,7 +338,6 @@
</span><span class="cx">     , m_processSuppressionEnabled(true)
</span><span class="cx">     , m_userActivity(&quot;Process suppression disabled for page.&quot;)
</span><span class="cx">     , m_pendingNavigationID(0)
</span><del>-    , m_viewScaleFactor(parameters.viewScaleFactor)
</del><span class="cx"> #if ENABLE(WEBGL)
</span><span class="cx">     , m_systemWebGLPolicy(WebGLAllowCreation)
</span><span class="cx"> #endif
</span><span class="lines">@@ -506,8 +505,8 @@
</span><span class="cx"> #endif
</span><span class="cx">     m_page-&gt;settings().setAppleMailPaginationQuirkEnabled(parameters.appleMailPaginationQuirkEnabled);
</span><span class="cx"> 
</span><del>-    if (m_viewScaleFactor != 1)
-        scalePage(1, IntPoint());
</del><ins>+    if (parameters.viewScaleFactor != 1)
+        scaleView(parameters.viewScaleFactor);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPage::reinitializeWebPage(const WebPageCreationParameters&amp; parameters)
</span><span class="lines">@@ -1374,7 +1373,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WebPage::scalePage(double scale, const IntPoint&amp; origin)
</span><span class="cx"> {
</span><del>-    double totalScale = scale * m_viewScaleFactor;
</del><ins>+    double totalScale = scale * viewScaleFactor();
</ins><span class="cx">     bool willChangeScaleFactor = totalScale != totalScaleFactor();
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="lines">@@ -1407,7 +1406,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WebPage::scalePageInViewCoordinates(double scale, IntPoint centerInViewCoordinates)
</span><span class="cx"> {
</span><del>-    double totalScale = scale * m_viewScaleFactor;
</del><ins>+    double totalScale = scale * viewScaleFactor();
</ins><span class="cx">     if (totalScale == totalScaleFactor())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -1428,26 +1427,32 @@
</span><span class="cx"> 
</span><span class="cx"> double WebPage::pageScaleFactor() const
</span><span class="cx"> {
</span><del>-    return totalScaleFactor() / m_viewScaleFactor;
</del><ins>+    return totalScaleFactor() / viewScaleFactor();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+double WebPage::viewScaleFactor() const
+{
+    return m_page-&gt;viewScaleFactor();
+}
+
</ins><span class="cx"> void WebPage::scaleView(double scale)
</span><span class="cx"> {
</span><ins>+    if (viewScaleFactor() == scale)
+        return;
+
</ins><span class="cx">     float pageScale = pageScaleFactor();
</span><span class="cx"> 
</span><del>-    double scaleRatio = scale / m_viewScaleFactor;
-
</del><span class="cx">     IntPoint scrollPositionAtNewScale;
</span><span class="cx">     if (FrameView* mainFrameView = m_page-&gt;mainFrame().view()) {
</span><ins>+        double scaleRatio = scale / viewScaleFactor();
</ins><span class="cx">         scrollPositionAtNewScale = mainFrameView-&gt;scrollPosition();
</span><span class="cx">         scrollPositionAtNewScale.scale(scaleRatio, scaleRatio);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    m_viewScaleFactor = scale;
</del><ins>+    m_page-&gt;setViewScaleFactor(scale);
</ins><span class="cx">     scalePage(pageScale, scrollPositionAtNewScale);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> void WebPage::scaleViewAndUpdateGeometryFenced(double scale, IntSize viewSize, uint64_t callbackID)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (184289 => 184290)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2015-05-13 17:58:59 UTC (rev 184289)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2015-05-13 18:11:38 UTC (rev 184290)
</span><span class="lines">@@ -359,7 +359,7 @@
</span><span class="cx">     void scalePageInViewCoordinates(double scale, WebCore::IntPoint centerInViewCoordinates);
</span><span class="cx">     double pageScaleFactor() const;
</span><span class="cx">     double totalScaleFactor() const;
</span><del>-    double viewScaleFactor() const { return m_viewScaleFactor; }
</del><ins>+    double viewScaleFactor() const;
</ins><span class="cx">     void scaleView(double scale);
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     void scaleViewAndUpdateGeometryFenced(double scale, WebCore::IntSize viewSize, uint64_t callbackID);
</span><span class="lines">@@ -1359,8 +1359,6 @@
</span><span class="cx"> 
</span><span class="cx">     uint64_t m_pendingNavigationID;
</span><span class="cx"> 
</span><del>-    double m_viewScaleFactor { 1 };
-
</del><span class="cx"> #if ENABLE(WEBGL)
</span><span class="cx">     WebCore::WebGLLoadPolicy m_systemWebGLPolicy;
</span><span class="cx"> #endif
</span></span></pre>
</div>
</div>

</body>
</html>