Chromium Code Reviews| Index: Source/WebKit/chromium/src/ChromeClientImpl.cpp |
| diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.cpp b/Source/WebKit/chromium/src/ChromeClientImpl.cpp |
| index ac241ebddb00a69167584e4cac26d5dc2856faf9..f6c5060857a634b62383ab6412fcb37d2f8ba246 100644 |
| --- a/Source/WebKit/chromium/src/ChromeClientImpl.cpp |
| +++ b/Source/WebKit/chromium/src/ChromeClientImpl.cpp |
| @@ -656,15 +656,34 @@ void ChromeClientImpl::dispatchViewportPropertiesDidChange(const ViewportArgumen |
| computed.maximumScale = max(computed.maximumScale, m_webView->maxPageScaleFactor); |
| computed.userScalable = true; |
| } |
| - if (arguments.zoom == ViewportArguments::ValueAuto && !m_webView->settingsImpl()->initializeAtMinimumPageScale()) |
| - computed.initialScale = 1.0f; |
| - |
| + float initialScale = computed.initialScale; |
| + if (arguments.zoom == ViewportArguments::ValueAuto && !m_webView->settingsImpl()->initializeAtMinimumPageScale()) { |
| + if (arguments.width == ViewportArguments::ValueAuto |
| + || (m_webView->settingsImpl()->useWideViewport() |
| + && arguments.width != ViewportArguments::ValueAuto && arguments.width != ViewportArguments::ValueDeviceWidth)) |
| + computed.initialScale = 1.0f; |
| + } |
| if (m_webView->settingsImpl()->supportDeprecatedTargetDensityDPI()) { |
| + bool applyTargetDensityDpiToLayoutSize = true; |
|
abarth-chromium
2013/04/15 23:33:57
Dpi -> DPI
mnaganov (inactive)
2013/04/16 14:41:26
Done.
|
| + if (!m_webView->settingsImpl()->useWideViewport()) { |
| + if (arguments.zoom == ViewportArguments::ValueAuto) |
| + computed.layoutSize.setWidth(viewportSize.width()); |
| + else |
| + computed.layoutSize.setWidth(viewportSize.width() / initialScale); |
| + } else { |
| + if (arguments.width == ViewportArguments::ValueAuto && arguments.zoom != 1.0f) { |
| + computed.layoutSize.setWidth(m_webView->page()->settings()->layoutFallbackWidth()); |
| + applyTargetDensityDpiToLayoutSize = false; |
| + } |
| + if (arguments.width != ViewportArguments::ValueAuto && arguments.width != ViewportArguments::ValueDeviceWidth) |
| + applyTargetDensityDpiToLayoutSize = false; |
| + } |
|
abarth-chromium
2013/04/15 23:33:57
Why does this need to be so complicated? Can we s
mnaganov (inactive)
2013/04/16 14:41:26
I compared the resulting scales and widths of old
|
| float targetDensityDPIFactor = calculateTargetDensityDPIFactor(arguments, deviceScaleFactor); |
| computed.initialScale *= targetDensityDPIFactor; |
| computed.minimumScale *= targetDensityDPIFactor; |
| computed.maximumScale *= targetDensityDPIFactor; |
| - computed.layoutSize.scale(1.0f / targetDensityDPIFactor); |
| + if (applyTargetDensityDpiToLayoutSize) |
| + computed.layoutSize.scale(1.0f / targetDensityDPIFactor); |
| } |
| m_webView->setInitialPageScaleFactor(computed.initialScale); |