Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/Source/WebCore/page/Settings.cpp b/Source/WebCore/page/Settings.cpp
- index 20c5643..2c2b8bf 100644
- --- a/Source/WebCore/page/Settings.cpp
- +++ b/Source/WebCore/page/Settings.cpp
- @@ -130,6 +130,7 @@ Settings::Settings(Page* page)
- , m_defaultFontSize(0)
- , m_defaultFixedFontSize(0)
- , m_defaultDeviceScaleFactor(1)
- + , m_applyDefaultDeviceScaleFactorInCompositor(false)
- , m_validationMessageTimerMagnification(50)
- , m_minimumAccelerated2dCanvasSize(257 * 256)
- , m_layoutFallbackWidth(980)
- @@ -398,6 +399,11 @@ void Settings::setDefaultDeviceScaleFactor(int defaultDeviceScaleFactor)
- m_defaultDeviceScaleFactor = defaultDeviceScaleFactor;
- }
- +void Settings::setApplyDefaultDeviceScaleFactorInCompositor(bool applyDefaultDeviceScaleFactorInCompositor)
- +{
- + m_applyDefaultDeviceScaleFactorInCompositor = applyDefaultDeviceScaleFactorInCompositor;
- +}
- +
- void Settings::setLoadsImagesAutomatically(bool loadsImagesAutomatically)
- {
- m_loadsImagesAutomatically = loadsImagesAutomatically;
- diff --git a/Source/WebCore/page/Settings.h b/Source/WebCore/page/Settings.h
- index d5ca684..05cf323 100644
- --- a/Source/WebCore/page/Settings.h
- +++ b/Source/WebCore/page/Settings.h
- @@ -106,6 +106,9 @@ namespace WebCore {
- void setDefaultDeviceScaleFactor(int);
- int defaultDeviceScaleFactor() const { return m_defaultDeviceScaleFactor; }
- + void setApplyDefaultDeviceScaleFactorInCompositor(bool);
- + bool applyDefaultDeviceScaleFactorInCompositor() const { return m_applyDefaultDeviceScaleFactorInCompositor; }
- +
- // Unlike areImagesEnabled, this only suppresses the network load of
- // the image URL. A cached image will still be rendered if requested.
- void setLoadsImagesAutomatically(bool);
- @@ -592,6 +595,7 @@ namespace WebCore {
- int m_defaultFontSize;
- int m_defaultFixedFontSize;
- int m_defaultDeviceScaleFactor;
- + bool m_applyDefaultDeviceScaleFactorInCompositor;
- int m_validationMessageTimerMagnification;
- int m_minimumAccelerated2dCanvasSize;
- int m_layoutFallbackWidth;
- diff --git a/Source/WebKit/chromium/public/WebSettings.h b/Source/WebKit/chromium/public/WebSettings.h
- index aad1b9d..885e69a 100644
- --- a/Source/WebKit/chromium/public/WebSettings.h
- +++ b/Source/WebKit/chromium/public/WebSettings.h
- @@ -63,6 +63,7 @@ public:
- virtual void setMinimumFontSize(int) = 0;
- virtual void setMinimumLogicalFontSize(int) = 0;
- virtual void setDefaultDeviceScaleFactor(int) = 0;
- + virtual void setApplyDefaultDeviceScaleFactorInCompositor(bool) = 0;
- virtual void setDefaultTextEncodingName(const WebString&) = 0;
- virtual void setJavaScriptEnabled(bool) = 0;
- virtual void setWebSecurityEnabled(bool) = 0;
- diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.cpp b/Source/WebKit/chromium/src/WebSettingsImpl.cpp
- index 2a2462a..ef90cd7 100644
- --- a/Source/WebKit/chromium/src/WebSettingsImpl.cpp
- +++ b/Source/WebKit/chromium/src/WebSettingsImpl.cpp
- @@ -115,6 +115,11 @@ void WebSettingsImpl::setDefaultDeviceScaleFactor(int defaultDeviceScaleFactor)
- m_settings->setDefaultDeviceScaleFactor(defaultDeviceScaleFactor);
- }
- +void WebSettingsImpl::setApplyDefaultDeviceScaleFactorInCompositor(bool applyDefaultDeviceScaleFactorInCompositor)
- +{
- + m_settings->setApplyDefaultDeviceScaleFactorInCompositor(applyDefaultDeviceScaleFactorInCompositor);
- +}
- +
- void WebSettingsImpl::setDefaultTextEncodingName(const WebString& encoding)
- {
- m_settings->setDefaultTextEncodingName((String)encoding);
- diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.h b/Source/WebKit/chromium/src/WebSettingsImpl.h
- index e159214..e07fd6c 100644
- --- a/Source/WebKit/chromium/src/WebSettingsImpl.h
- +++ b/Source/WebKit/chromium/src/WebSettingsImpl.h
- @@ -55,6 +55,7 @@ public:
- virtual void setMinimumFontSize(int);
- virtual void setMinimumLogicalFontSize(int);
- virtual void setDefaultDeviceScaleFactor(int);
- + virtual void setApplyDefaultDeviceScaleFactorInCompositor(bool);
- virtual void setDefaultTextEncodingName(const WebString&);
- virtual void setJavaScriptEnabled(bool);
- virtual void setWebSecurityEnabled(bool);
- diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp
- index 88f86c2..baac307 100644
- --- a/Source/WebKit/chromium/src/WebViewImpl.cpp
- +++ b/Source/WebKit/chromium/src/WebViewImpl.cpp
- @@ -977,10 +977,10 @@ void WebViewImpl::computeScaleAndScrollForHitRect(const WebRect& hitRect, AutoZo
- // need to zoom in further when automatically determining zoom level
- // (after double tap, find in page, etc), though the user should still
- // be allowed to manually pinch zoom in further if they desire.
- - const float maxScale = deviceScaleFactor() / m_deviceScaleInCompositor;
- + const float maxScale = deviceScaleFactor();
- - const float defaultMargin = doubleTapZoomContentDefaultMargin * (deviceScaleFactor() / m_deviceScaleInCompositor);
- - const float minimumMargin = doubleTapZoomContentMinimumMargin * (deviceScaleFactor() / m_deviceScaleInCompositor);
- + const float defaultMargin = doubleTapZoomContentDefaultMargin * deviceScaleFactor();
- + const float minimumMargin = doubleTapZoomContentMinimumMargin * deviceScaleFactor();
- // We want the margins to have the same physical size, which means we
- // need to express them in post-scale size. To do that we'd need to know
- // the scale we're scaling to, but that depends on the margins. Instead
- @@ -3404,9 +3404,9 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active)
- m_nonCompositedContentHost = NonCompositedContentHost::create(WebViewImplContentPainter::create(this));
- m_nonCompositedContentHost->setShowDebugBorders(page()->settings()->showDebugBorders());
- - m_deviceScaleInCompositor = page()->settings()->defaultDeviceScaleFactor();
- - layerTreeViewSettings.deviceScaleFactor = m_deviceScaleInCompositor;
- - if (m_deviceScaleInCompositor != 1) {
- + if (page()->settings()->applyDefaultDeviceScaleFactorInCompositor() && page()->settings()->defaultDeviceScaleFactor() != 1) {
- + m_deviceScaleInCompositor = page()->settings()->defaultDeviceScaleFactor();
- + layerTreeViewSettings.deviceScaleFactor = m_deviceScaleInCompositor;
- setDeviceScaleFactor(m_deviceScaleInCompositor);
- // When applying a scale factor in the compositor, we disallow page
- // scaling as they are currently incompatible.
- diff --git a/Source/WebKit/chromium/tests/WebFrameTest.cpp b/Source/WebKit/chromium/tests/WebFrameTest.cpp
- index 3cf3835..74251f3 100644
- --- a/Source/WebKit/chromium/tests/WebFrameTest.cpp
- +++ b/Source/WebKit/chromium/tests/WebFrameTest.cpp
- @@ -229,10 +229,6 @@ TEST_F(WebFrameTest, DeviceScaleFactorUsesDefaultWithoutViewportTag)
- WebView* webView = static_cast<WebView*>(FrameTestHelpers::createWebViewAndLoad(m_baseURL + "no_viewport_tag.html", true, 0, &client));
- webView->settings()->setViewportEnabled(true);
- - // Setting the defaultDeviceScaleFactor after initialization of the WebView
- - // will avoid the compositor using the value. This gives the desired
- - // behaviour when fixed-layout mode is being used. In this case, the device
- - // scale factor will be used as part of the page scale.
- webView->settings()->setDefaultDeviceScaleFactor(2);
- webView->enableFixedLayoutMode(true);
- webView->resize(WebSize(viewportWidth, viewportHeight));
- @@ -254,14 +250,7 @@ TEST_F(WebFrameTest, DivAutoZoomParamsTest)
- {
- registerMockedHttpURLLoad("get_scale_for_auto_zoom_into_div_test.html");
- - int viewportWidth = 640;
- - int viewportHeight = 480;
- -
- - FixedLayoutTestWebViewClient client;
- - client.m_screenInfo.horizontalDPI = 160;
- - client.m_windowRect = WebRect(0, 0, viewportWidth, viewportHeight);
- -
- - WebViewImpl* webViewImpl = static_cast<WebViewImpl*>(FrameTestHelpers::createWebViewAndLoad(m_baseURL + "get_scale_for_auto_zoom_into_div_test.html", true, 0, &client));
- + WebViewImpl* webViewImpl = static_cast<WebViewImpl*>(FrameTestHelpers::createWebViewAndLoad(m_baseURL + "get_scale_for_auto_zoom_into_div_test.html", true));
- int pageWidth = 640;
- int pageHeight = 480;
- int divPosX = 200;
- @@ -273,9 +262,6 @@ TEST_F(WebFrameTest, DivAutoZoomParamsTest)
- float scale;
- WebPoint scroll;
- - // Enable fixed layout mode to make deviceScale a component of pageScale.
- - webViewImpl->enableFixedLayoutMode(true);
- -
- // Test for Doubletap scaling
- // Tests for zooming in and out without clamping.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement