Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Unified Diff: Source/WebKit/chromium/src/WebViewImpl.cpp

Issue 14643011: Reset page scale factor to 1.0 on navigation to a new page. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Revise, add test. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/WebKit/chromium/src/WebViewImpl.cpp
diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp
index 73aaf97d0864969a9a4c5ef4abe069e83211c8b6..921eac1b880c1082e37e1f73b585d6d39beeea3b 100644
--- a/Source/WebKit/chromium/src/WebViewImpl.cpp
+++ b/Source/WebKit/chromium/src/WebViewImpl.cpp
@@ -2999,16 +2999,10 @@ void WebViewImpl::setPageScaleFactorLimits(float minPageScale, float maxPageScal
m_pageDefinedMinimumPageScaleFactor = minPageScale;
m_pageDefinedMaximumPageScaleFactor = maxPageScale;
- if (settings()->viewportEnabled()) {
- // If we're in viewport tag mode, we need to layout to obtain the latest
- // contents size and compute the final limits.
- FrameView* view = mainFrameImpl()->frameView();
- if (view)
- view->setNeedsLayout();
- } else {
- // Otherwise just compute the limits immediately.
- computePageScaleFactorLimits();
- }
+ // Obtain the latest contents size and compute the final limits.
+ FrameView* view = mainFrameImpl()->frameView();
+ if (view)
+ view->setNeedsLayout();
}
void WebViewImpl::setIgnoreViewportTagMaximumScale(bool flag)
@@ -3663,24 +3657,22 @@ void WebViewImpl::layoutUpdated(WebFrameImpl* webframe)
}
}
- if (settings()->viewportEnabled()) {
- if (!isPageScaleFactorSet()) {
- // If the viewport tag failed to be processed earlier, we need
- // to recompute it now.
- ViewportArguments viewportArguments = mainFrameImpl()->frame()->document()->viewportArguments();
- m_page->chrome()->client()->dispatchViewportPropertiesDidChange(viewportArguments);
- }
+ if (settings()->viewportEnabled() && !isPageScaleFactorSet()) {
+ // If the viewport tag failed to be processed earlier, we need
+ // to recompute it now.
+ ViewportArguments viewportArguments = mainFrameImpl()->frame()->document()->viewportArguments();
+ m_page->chrome()->client()->dispatchViewportPropertiesDidChange(viewportArguments);
+ }
- // Contents size is an input to the page scale limits, so a good time to
- // recalculate is after layout has occurred.
- computePageScaleFactorLimits();
+ // Contents size is an input to the page scale limits, so a good time to
jamesr 2013/05/03 17:55:58 do you really need to do all this work on every la
wjmaclean 2013/05/03 18:26:17 I think so ... will upload new patch shortly.
aelias_OOO_until_Jul13 2013/05/03 21:00:50 We shouldn't avoid calling this based on pageScale
+ // recalculate is after layout has occurred.
+ computePageScaleFactorLimits();
- // Relayout immediately to avoid violating the rule that needsLayout()
- // isn't set at the end of a layout.
- FrameView* view = mainFrameImpl()->frameView();
- if (view && view->needsLayout())
- view->layout();
- }
+ // Relayout immediately to avoid violating the rule that needsLayout()
+ // isn't set at the end of a layout.
+ FrameView* view = mainFrameImpl()->frameView();
+ if (view && view->needsLayout())
+ view->layout();
m_client->didUpdateLayout();
« no previous file with comments | « LayoutTests/fast/loader/resources/page-scale-resets-on-new-navigation-child.html ('k') | Source/core/testing/Internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698