Chromium Code Reviews| 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(); |