<!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>[184481] branches/safari-601.1.32-branch/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/184481">184481</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2015-05-18 07:23:14 -0700 (Mon, 18 May 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/184290">r184290</a>. rdar://problem/19790341</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari601132branchSourceWebCoreChangeLog">branches/safari-601.1.32-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari601132branchSourceWebCorehistoryCachedPagecpp">branches/safari-601.1.32-branch/Source/WebCore/history/CachedPage.cpp</a></li>
<li><a href="#branchessafari601132branchSourceWebCorehistoryCachedPageh">branches/safari-601.1.32-branch/Source/WebCore/history/CachedPage.h</a></li>
<li><a href="#branchessafari601132branchSourceWebCorehistoryPageCachecpp">branches/safari-601.1.32-branch/Source/WebCore/history/PageCache.cpp</a></li>
<li><a href="#branchessafari601132branchSourceWebCorehistoryPageCacheh">branches/safari-601.1.32-branch/Source/WebCore/history/PageCache.h</a></li>
<li><a href="#branchessafari601132branchSourceWebCoreloaderHistoryControllercpp">branches/safari-601.1.32-branch/Source/WebCore/loader/HistoryController.cpp</a></li>
<li><a href="#branchessafari601132branchSourceWebCorepagePagecpp">branches/safari-601.1.32-branch/Source/WebCore/page/Page.cpp</a></li>
<li><a href="#branchessafari601132branchSourceWebCorepagePageh">branches/safari-601.1.32-branch/Source/WebCore/page/Page.h</a></li>
<li><a href="#branchessafari601132branchSourceWebKit2ChangeLog">branches/safari-601.1.32-branch/Source/WebKit2/ChangeLog</a></li>
<li><a href="#branchessafari601132branchSourceWebKit2WebProcessWebPageWebPagecpp">branches/safari-601.1.32-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#branchessafari601132branchSourceWebKit2WebProcessWebPageWebPageh">branches/safari-601.1.32-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari601132branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.32-branch/Source/WebCore/ChangeLog (184480 => 184481)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.32-branch/Source/WebCore/ChangeLog        2015-05-18 14:23:02 UTC (rev 184480)
+++ branches/safari-601.1.32-branch/Source/WebCore/ChangeLog        2015-05-18 14:23:14 UTC (rev 184481)
</span><span class="lines">@@ -1,5 +1,51 @@
</span><span class="cx"> 2015-05-18 Matthew Hanson <matthew_hanson@apple.com>
</span><span class="cx">
</span><ins>+ Merge r184290. rdar://problem/19790341
+
+ 2015-05-13 Timothy Horton <timothy_horton@apple.com>
+
+ 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.
+
+2015-05-18 Matthew Hanson <matthew_hanson@apple.com>
+
</ins><span class="cx"> Merge r184204. rdar://problem/20909871
</span><span class="cx">
</span><span class="cx"> 2015-05-12 Eric Carlson <eric.carlson@apple.com>
</span></span></pre></div>
<a id="branchessafari601132branchSourceWebCorehistoryCachedPagecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.32-branch/Source/WebCore/history/CachedPage.cpp (184480 => 184481)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.32-branch/Source/WebCore/history/CachedPage.cpp        2015-05-18 14:23:02 UTC (rev 184480)
+++ branches/safari-601.1.32-branch/Source/WebCore/history/CachedPage.cpp        2015-05-18 14:23:14 UTC (rev 184481)
</span><span class="lines">@@ -52,12 +52,6 @@
</span><span class="cx"> CachedPage::CachedPage(Page& page)
</span><span class="cx"> : m_expirationTime(monotonicallyIncreasingTime() + page.settings().backForwardCacheExpirationInterval())
</span><span class="cx"> , m_cachedMainFrame(std::make_unique<CachedFrame>(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->document()->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="branchessafari601132branchSourceWebCorehistoryCachedPageh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.32-branch/Source/WebCore/history/CachedPage.h (184480 => 184481)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.32-branch/Source/WebCore/history/CachedPage.h        2015-05-18 14:23:02 UTC (rev 184480)
+++ branches/safari-601.1.32-branch/Source/WebCore/history/CachedPage.h        2015-05-18 14:23:14 UTC (rev 184481)
</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<CachedFrame> 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="branchessafari601132branchSourceWebCorehistoryPageCachecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.32-branch/Source/WebCore/history/PageCache.cpp (184480 => 184481)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.32-branch/Source/WebCore/history/PageCache.cpp        2015-05-18 14:23:02 UTC (rev 184480)
+++ branches/safari-601.1.32-branch/Source/WebCore/history/PageCache.cpp        2015-05-18 14:23:14 UTC (rev 184481)
</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& page)
</del><ins>+void PageCache::markPagesForDeviceOrPageScaleChanged(Page& page)
</ins><span class="cx"> {
</span><span class="cx"> for (auto& item : m_items) {
</span><span class="cx"> CachedPage& cachedPage = *item->m_cachedPage;
</span><span class="cx"> if (&page.mainFrame() == &cachedPage.cachedMainFrame()->view()->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="branchessafari601132branchSourceWebCorehistoryPageCacheh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.32-branch/Source/WebCore/history/PageCache.h (184480 => 184481)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.32-branch/Source/WebCore/history/PageCache.h        2015-05-18 14:23:02 UTC (rev 184480)
+++ branches/safari-601.1.32-branch/Source/WebCore/history/PageCache.h        2015-05-18 14:23:14 UTC (rev 184481)
</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&);
</span><del>- void markPagesForDeviceScaleChanged(Page&);
</del><ins>+ void markPagesForDeviceOrPageScaleChanged(Page&);
</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="branchessafari601132branchSourceWebCoreloaderHistoryControllercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.32-branch/Source/WebCore/loader/HistoryController.cpp (184480 => 184481)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.32-branch/Source/WebCore/loader/HistoryController.cpp        2015-05-18 14:23:02 UTC (rev 184480)
+++ branches/safari-601.1.32-branch/Source/WebCore/loader/HistoryController.cpp        2015-05-18 14:23:14 UTC (rev 184481)
</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 && m_frame.isMainFrame())
</span><del>- item->setPageScaleFactor(page->pageScaleFactor());
</del><ins>+ item->setPageScaleFactor(page->pageScaleFactor() / page->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 && !view->wasScrolledByUser()) {
</span><span class="cx"> Page* page = m_frame.page();
</span><span class="cx"> if (page && m_frame.isMainFrame() && m_currentItem->pageScaleFactor())
</span><del>- page->setPageScaleFactor(m_currentItem->pageScaleFactor(), m_currentItem->scrollPoint());
</del><ins>+ page->setPageScaleFactor(m_currentItem->pageScaleFactor() * page->viewScaleFactor(), m_currentItem->scrollPoint());
</ins><span class="cx"> else
</span><span class="cx"> view->setScrollPosition(m_currentItem->scrollPoint());
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari601132branchSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.32-branch/Source/WebCore/page/Page.cpp (184480 => 184481)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.32-branch/Source/WebCore/page/Page.cpp        2015-05-18 14:23:02 UTC (rev 184480)
+++ branches/safari-601.1.32-branch/Source/WebCore/page/Page.cpp        2015-05-18 14:23:14 UTC (rev 184481)
</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 > 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="branchessafari601132branchSourceWebCorepagePageh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.32-branch/Source/WebCore/page/Page.h (184480 => 184481)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.32-branch/Source/WebCore/page/Page.h        2015-05-18 14:23:02 UTC (rev 184480)
+++ branches/safari-601.1.32-branch/Source/WebCore/page/Page.h        2015-05-18 14:23:14 UTC (rev 184481)
</span><span class="lines">@@ -260,6 +260,11 @@
</span><span class="cx"> WEBCORE_EXPORT void setPageScaleFactor(float scale, const IntPoint& 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="branchessafari601132branchSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.32-branch/Source/WebKit2/ChangeLog (184480 => 184481)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.32-branch/Source/WebKit2/ChangeLog        2015-05-18 14:23:02 UTC (rev 184480)
+++ branches/safari-601.1.32-branch/Source/WebKit2/ChangeLog        2015-05-18 14:23:14 UTC (rev 184481)
</span><span class="lines">@@ -1,5 +1,27 @@
</span><span class="cx"> 2015-05-18 Matthew Hanson <matthew_hanson@apple.com>
</span><span class="cx">
</span><ins>+ Merge r184290. rdar://problem/19790341
+
+ 2015-05-13 Timothy Horton <timothy_horton@apple.com>
+
+ 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.
+
+2015-05-18 Matthew Hanson <matthew_hanson@apple.com>
+
</ins><span class="cx"> Merge r184052. rdar://problem/20890647
</span><span class="cx">
</span><span class="cx"> 2015-05-10 Darin Adler <darin@apple.com>
</span></span></pre></div>
<a id="branchessafari601132branchSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.32-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (184480 => 184481)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.32-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2015-05-18 14:23:02 UTC (rev 184480)
+++ branches/safari-601.1.32-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2015-05-18 14:23:14 UTC (rev 184481)
</span><span class="lines">@@ -338,7 +338,6 @@
</span><span class="cx"> , m_processSuppressionEnabled(true)
</span><span class="cx"> , m_userActivity("Process suppression disabled for page.")
</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->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& parameters)
</span><span class="lines">@@ -1374,7 +1373,7 @@
</span><span class="cx">
</span><span class="cx"> void WebPage::scalePage(double scale, const IntPoint& 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->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->mainFrame().view()) {
</span><ins>+ double scaleRatio = scale / viewScaleFactor();
</ins><span class="cx"> scrollPositionAtNewScale = mainFrameView->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->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="branchessafari601132branchSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.32-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h (184480 => 184481)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.32-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h        2015-05-18 14:23:02 UTC (rev 184480)
+++ branches/safari-601.1.32-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h        2015-05-18 14:23:14 UTC (rev 184481)
</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>