Settings::defaultDeviceScaleFactor is redundant with Page::deviceScaleFactor
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Jun 2012 21:21:31 +0000 (21:21 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Jun 2012 21:21:31 +0000 (21:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=88375

Reviewed by James Robinson.

.:

This symbol no longer exists.

* Source/autotools/symbols.filter:

Source/WebCore:

This patch removes Settings::defaultDeviceScaleFactor because it is
redundant with Page::deviceScaleFactor now that we no longer support
target-densitydpi.  Page::deviceScaleFactor is the canonical place to
store the device scale factor.

* WebCore.exp.in:
* page/Settings.cpp:
(WebCore::Settings::Settings):
(WebCore):
* page/Settings.h:
(Settings):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::setDeviceScaleFactor):

Source/WebKit/chromium:

* public/WebSettings.h:
(WebKit::WebSettings::setDefaultDeviceScaleFactor):
(WebSettings):
* src/ChromeClientImpl.cpp:
(WebKit::ChromeClientImpl::dispatchViewportPropertiesDidChange):
* src/WebSettingsImpl.cpp:
(WebKit):
* src/WebSettingsImpl.h:
(WebSettingsImpl):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
* tests/WebFrameTest.cpp:
(WebKit::TEST_F):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@119752 268f45cc-cd09-0410-ab3c-d52691b4dbfc

16 files changed:
ChangeLog
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.h
Source/WebCore/testing/InternalSettings.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebSettings.h
Source/WebKit/chromium/src/ChromeClientImpl.cpp
Source/WebKit/chromium/src/WebSettingsImpl.cpp
Source/WebKit/chromium/src/WebSettingsImpl.h
Source/WebKit/chromium/src/WebViewImpl.cpp
Source/WebKit/chromium/tests/WebFrameTest.cpp
Source/WebKit2/win/WebKit2.def
Source/WebKit2/win/WebKit2CFLite.def
Source/autotools/symbols.filter

index 4b4518f..b7a83f5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2012-06-07  Adam Barth  <abarth@webkit.org>
+
+        Settings::defaultDeviceScaleFactor is redundant with Page::deviceScaleFactor
+        https://bugs.webkit.org/show_bug.cgi?id=88375
+
+        Reviewed by James Robinson.
+
+        This symbol no longer exists.
+
+        * Source/autotools/symbols.filter:
+
 2012-06-06  David Kilzer  <ddkilzer@apple.com>
 
         Teach git about localizable *.strings files
index 6ea82f5..f4e8250 100644 (file)
@@ -1,3 +1,24 @@
+2012-06-07  Adam Barth  <abarth@webkit.org>
+
+        Settings::defaultDeviceScaleFactor is redundant with Page::deviceScaleFactor
+        https://bugs.webkit.org/show_bug.cgi?id=88375
+
+        Reviewed by James Robinson.
+
+        This patch removes Settings::defaultDeviceScaleFactor because it is
+        redundant with Page::deviceScaleFactor now that we no longer support
+        target-densitydpi.  Page::deviceScaleFactor is the canonical place to
+        store the device scale factor.
+
+        * WebCore.exp.in:
+        * page/Settings.cpp:
+        (WebCore::Settings::Settings):
+        (WebCore):
+        * page/Settings.h:
+        (Settings):
+        * testing/InternalSettings.cpp:
+        (WebCore::InternalSettings::setDeviceScaleFactor):
+
 2012-06-07  Alec Flett  <alecflett@chromium.org>
 
         IndexedDB: Error codes, phase one
index 910f8aa..856f40b 100644 (file)
@@ -1033,7 +1033,6 @@ __ZN7WebCore8Settings27setJavaEnabledForLocalFilesEb
 __ZN7WebCore8Settings27setLoadsImagesAutomaticallyEb
 __ZN7WebCore8Settings27setLocalStorageDatabasePathERKN3WTF6StringE
 __ZN7WebCore8Settings27setSpatialNavigationEnabledEb
-__ZN7WebCore8Settings27setDefaultDeviceScaleFactorEi
 __ZN7WebCore8Settings28setForceFTPDirectoryListingsEb
 __ZN7WebCore8Settings29setAccelerated2dCanvasEnabledEb
 __ZN7WebCore8Settings29setAuthorAndUserStylesEnabledEb
index 5fe9c98..96c02ad 100644 (file)
@@ -129,7 +129,6 @@ Settings::Settings(Page* page)
     , m_minimumLogicalFontSize(0)
     , m_defaultFontSize(0)
     , m_defaultFixedFontSize(0)
-    , m_defaultDeviceScaleFactor(1)
     , m_validationMessageTimerMagnification(50)
     , m_minimumAccelerated2dCanvasSize(257 * 256)
     , m_layoutFallbackWidth(980)
@@ -404,11 +403,6 @@ void Settings::setDefaultFixedFontSize(int defaultFontSize)
     m_page->setNeedsRecalcStyleInAllFrames();
 }
 
-void Settings::setDefaultDeviceScaleFactor(int defaultDeviceScaleFactor)
-{
-    m_defaultDeviceScaleFactor = defaultDeviceScaleFactor;
-}
-
 void Settings::setFontBoostingEnabled(bool fontBoostingEnabled)
 {
     if (m_fontBoostingEnabled == fontBoostingEnabled)
index 7f1eca7..d30f4c0 100644 (file)
@@ -103,9 +103,6 @@ namespace WebCore {
         void setDefaultFixedFontSize(int);
         int defaultFixedFontSize() const { return m_defaultFixedFontSize; }
 
-        void setDefaultDeviceScaleFactor(int);
-        int defaultDeviceScaleFactor() const { return m_defaultDeviceScaleFactor; }
-
         void setFontBoostingEnabled(bool);
         bool fontBoostingEnabled() const { return m_fontBoostingEnabled; }
 
@@ -626,7 +623,6 @@ namespace WebCore {
         int m_minimumLogicalFontSize;
         int m_defaultFontSize;
         int m_defaultFixedFontSize;
-        int m_defaultDeviceScaleFactor;
         int m_validationMessageTimerMagnification;
         int m_minimumAccelerated2dCanvasSize;
         int m_layoutFallbackWidth;
index e4d061e..eabebe0 100644 (file)
@@ -278,8 +278,6 @@ void InternalSettings::setDeviceSupportsMouse(bool enabled, ExceptionCode& ec)
 
 void InternalSettings::setDeviceScaleFactor(float scaleFactor, ExceptionCode& ec)
 {
-    InternalSettingsGuardForSettings();
-    settings()->setDefaultDeviceScaleFactor(scaleFactor);
     InternalSettingsGuardForPage();
     page()->setDeviceScaleFactor(scaleFactor);
 }
index 70560b7..107accc 100644 (file)
@@ -1,3 +1,24 @@
+2012-06-07  Adam Barth  <abarth@webkit.org>
+
+        Settings::defaultDeviceScaleFactor is redundant with Page::deviceScaleFactor
+        https://bugs.webkit.org/show_bug.cgi?id=88375
+
+        Reviewed by James Robinson.
+
+        * public/WebSettings.h:
+        (WebKit::WebSettings::setDefaultDeviceScaleFactor):
+        (WebSettings):
+        * src/ChromeClientImpl.cpp:
+        (WebKit::ChromeClientImpl::dispatchViewportPropertiesDidChange):
+        * src/WebSettingsImpl.cpp:
+        (WebKit):
+        * src/WebSettingsImpl.h:
+        (WebSettingsImpl):
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
+        * tests/WebFrameTest.cpp:
+        (WebKit::TEST_F):
+
 2012-06-07  Peter Beverloo  <peter@chromium.org>
 
         [Chromium] features.gypi should have the correct definitions for Android
index 01ac440..88d9a01 100644 (file)
@@ -64,7 +64,6 @@ public:
     virtual void setDefaultFixedFontSize(int) = 0;
     virtual void setMinimumFontSize(int) = 0;
     virtual void setMinimumLogicalFontSize(int) = 0;
-    virtual void setDefaultDeviceScaleFactor(int) = 0;
     virtual void setApplyDefaultDeviceScaleFactorInCompositor(bool) = 0;
     virtual void setFontBoostingEnabled(bool) = 0;
     virtual void setDefaultTextEncodingName(const WebString&) = 0;
@@ -161,6 +160,9 @@ public:
 
     virtual bool forceSoftwareCompositing() const = 0;
 
+    // DEPRECATED
+    virtual void setDefaultDeviceScaleFactor(int) { }
+
 protected:
     ~WebSettings() { }
 };
index 38a2c1a..e0324f8 100644 (file)
@@ -634,12 +634,10 @@ void ChromeClientImpl::dispatchViewportPropertiesDidChange(const ViewportArgumen
     if (!m_webView->settings()->viewportEnabled() || !m_webView->isFixedLayoutModeEnabled() || !m_webView->client() || !m_webView->page())
         return;
 
-    bool useDefaultDeviceScaleFactor = false;
     ViewportArguments args;
     if (arguments == args) {
         // Default viewport arguments passed in. This is a signal to reset the viewport.
         args.width = ViewportArguments::ValueDesktopWidth;
-        useDefaultDeviceScaleFactor = true;
     } else
         args = arguments;
 
@@ -664,10 +662,7 @@ void ChromeClientImpl::dispatchViewportPropertiesDidChange(const ViewportArgumen
     m_webView->setFixedLayoutSize(IntSize(layoutWidth, layoutHeight));
 
     bool needInitializePageScale = !m_webView->isPageScaleFactorSet();
-    if (useDefaultDeviceScaleFactor && settings->defaultDeviceScaleFactor())
-        m_webView->setDeviceScaleFactor(settings->defaultDeviceScaleFactor());
-    else
-        m_webView->setDeviceScaleFactor(computed.devicePixelRatio);
+    m_webView->setDeviceScaleFactor(computed.devicePixelRatio);
     m_webView->setPageScaleFactorLimits(computed.minimumScale, computed.maximumScale);
     if (needInitializePageScale)
         m_webView->setPageScaleFactorPreservingScrollOffset(computed.initialScale * computed.devicePixelRatio);
index c06ec20..9423689 100644 (file)
@@ -119,16 +119,6 @@ void WebSettingsImpl::setMinimumLogicalFontSize(int size)
     m_settings->setMinimumLogicalFontSize(size);
 }
 
-void WebSettingsImpl::setDefaultDeviceScaleFactor(int defaultDeviceScaleFactor)
-{
-    m_settings->setDefaultDeviceScaleFactor(defaultDeviceScaleFactor);
-}
-
-int WebSettingsImpl::defaultDeviceScaleFactor()
-{
-    return m_settings->defaultDeviceScaleFactor();
-}
-
 void WebSettingsImpl::setDeviceSupportsTouch(bool deviceSupportsTouch)
 {
     m_settings->setDeviceSupportsTouch(deviceSupportsTouch);
index 25221ed..ea7cf3f 100644 (file)
@@ -55,8 +55,6 @@ public:
     virtual void setDefaultFixedFontSize(int);
     virtual void setMinimumFontSize(int);
     virtual void setMinimumLogicalFontSize(int);
-    virtual void setDefaultDeviceScaleFactor(int);
-    virtual int defaultDeviceScaleFactor();
     virtual void setApplyDefaultDeviceScaleFactorInCompositor(bool);
     virtual void setFontBoostingEnabled(bool);
     virtual void setDefaultTextEncodingName(const WebString&);
index d10937f..f90b1f8 100644 (file)
@@ -3476,10 +3476,10 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active)
         m_nonCompositedContentHost = NonCompositedContentHost::create(WebViewImplContentPainter::create(this));
         m_nonCompositedContentHost->setShowDebugBorders(page()->settings()->showDebugBorders());
 
-        if (m_webSettings->applyDefaultDeviceScaleFactorInCompositor() && page()->settings()->defaultDeviceScaleFactor() != 1) {
-            ASSERT(page()->settings()->defaultDeviceScaleFactor());
+        if (m_webSettings->applyDefaultDeviceScaleFactorInCompositor() && page()->deviceScaleFactor() != 1) {
+            ASSERT(page()->deviceScaleFactor());
 
-            m_deviceScaleInCompositor = page()->settings()->defaultDeviceScaleFactor();
+            m_deviceScaleInCompositor = page()->deviceScaleFactor();
             layerTreeViewSettings.deviceScaleFactor = m_deviceScaleInCompositor;
             setDeviceScaleFactor(m_deviceScaleInCompositor);
         }
index 4aa905c..113b6ca 100644 (file)
@@ -225,13 +225,12 @@ TEST_F(WebFrameTest, DeviceScaleFactorUsesDefaultWithoutViewportTag)
     int viewportHeight = 480;
 
     FixedLayoutTestWebViewClient client;
-    client.m_screenInfo.horizontalDPI = 160;
+    client.m_screenInfo.horizontalDPI = 320;
     client.m_windowRect = WebRect(0, 0, viewportWidth, viewportHeight);
 
     WebView* webView = static_cast<WebView*>(FrameTestHelpers::createWebViewAndLoad(m_baseURL + "no_viewport_tag.html", true, 0, &client));
 
     webView->settings()->setViewportEnabled(true);
-    webView->settings()->setDefaultDeviceScaleFactor(2);
     webView->enableFixedLayoutMode(true);
     webView->resize(WebSize(viewportWidth, viewportHeight));
     webView->layout();
index 0baf64a..e901997 100644 (file)
@@ -207,7 +207,6 @@ EXPORTS
         ?scriptNameToCode@WebCore@@YA?AW4UScriptCode@@ABVString@WTF@@@Z
         ?scrollElementToRect@FrameView@WebCore@@QAEXPAVElement@2@ABVIntRect@2@@Z
         ?setCursiveFontFamily@Settings@WebCore@@QAEXABVAtomicString@WTF@@W4UScriptCode@@@Z
-        ?setDefaultDeviceScaleFactor@Settings@WebCore@@QAEXH@Z
         ?setDeviceScaleFactor@Page@WebCore@@QAEXM@Z
         ?setDOMException@WebCore@@YAXPAVExecState@JSC@@H@Z
         ?setFantasyFontFamily@Settings@WebCore@@QAEXABVAtomicString@WTF@@W4UScriptCode@@@Z
index 7574828..b5ee9ac 100644 (file)
@@ -200,7 +200,6 @@ EXPORTS
         ?scriptNameToCode@WebCore@@YA?AW4UScriptCode@@ABVString@WTF@@@Z
         ?scrollElementToRect@FrameView@WebCore@@QAEXPAVElement@2@ABVIntRect@2@@Z
         ?setCursiveFontFamily@Settings@WebCore@@QAEXABVAtomicString@WTF@@W4UScriptCode@@@Z
-        ?setDefaultDeviceScaleFactor@Settings@WebCore@@QAEXH@Z
         ?setDeviceScaleFactor@Page@WebCore@@QAEXM@Z
         ?setDOMException@WebCore@@YAXPAVExecState@JSC@@H@Z
         ?setFantasyFontFamily@Settings@WebCore@@QAEXABVAtomicString@WTF@@W4UScriptCode@@@Z
index c590280..909deef 100644 (file)
@@ -128,7 +128,6 @@ _ZN7WebCore8Settings21setStandardFontFamilyERKN3WTF12AtomicStringE11UScriptCode;
 _ZN7WebCore8Settings22setSansSerifFontFamilyERKN3WTF12AtomicStringE11UScriptCode;
 _ZN7WebCore8Settings23setPictographFontFamilyERKN3WTF12AtomicStringE11UScriptCode;
 _ZN7WebCore8Settings24setMockScrollbarsEnabledEb;
-_ZN7WebCore8Settings27setDefaultDeviceScaleFactorEi;
 _ZN7WebCore8Settings37setFixedElementsLayoutRelativeToFrameEb;
 _ZN7WebCore9FrameView17paintControlTintsEv;
 _ZN7WebCore9FrameView19scrollElementToRectEPNS_7ElementERKNS_7IntRectE;