[chromium] Allow the viewport meta tag to be disabled for testing purposes
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Mar 2012 14:16:12 +0000 (14:16 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Mar 2012 14:16:12 +0000 (14:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=81940

Patch by Terry Anderson <tdanderson@chromium.org> on 2012-03-26
Reviewed by Adam Barth.

* public/WebSettings.h:
* src/ChromeClientImpl.cpp:
(WebKit::ChromeClientImpl::dispatchViewportPropertiesDidChange):
* src/WebSettingsImpl.cpp:
(WebKit::WebSettingsImpl::WebSettingsImpl):
(WebKit::WebSettingsImpl::setViewportEnabled):
(WebKit):
* src/WebSettingsImpl.h:
(WebSettingsImpl):
(WebKit::WebSettingsImpl::viewportEnabled):

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

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

index 528986e..8247394 100644 (file)
@@ -1,3 +1,21 @@
+2012-03-26  Terry Anderson  <tdanderson@chromium.org>
+
+        [chromium] Allow the viewport meta tag to be disabled for testing purposes
+        https://bugs.webkit.org/show_bug.cgi?id=81940
+
+        Reviewed by Adam Barth.
+
+        * public/WebSettings.h:
+        * src/ChromeClientImpl.cpp:
+        (WebKit::ChromeClientImpl::dispatchViewportPropertiesDidChange):
+        * src/WebSettingsImpl.cpp:
+        (WebKit::WebSettingsImpl::WebSettingsImpl):
+        (WebKit::WebSettingsImpl::setViewportEnabled):
+        (WebKit):
+        * src/WebSettingsImpl.h:
+        (WebSettingsImpl):
+        (WebKit::WebSettingsImpl::viewportEnabled):
+
 2012-03-25  Nat Duca  <nduca@chromium.org>
 
         [chromium] Route willBeginFrame from compositor to WebWidget
index a619d55..d96fcd6 100644 (file)
@@ -145,6 +145,8 @@ public:
     virtual void setPerTilePaintingEnabled(bool) = 0;
     virtual void setPartialSwapEnabled(bool) = 0;
     virtual void setThreadedAnimationEnabled(bool) = 0;
+    virtual void setViewportEnabled(bool) = 0;
+    virtual bool viewportEnabled() const = 0;
 
 protected:
     ~WebSettings() { }
index 4d381ec..4a58208 100644 (file)
@@ -639,7 +639,7 @@ void ChromeClientImpl::setToolTip(const String& tooltipText, TextDirection dir)
 void ChromeClientImpl::dispatchViewportPropertiesDidChange(const ViewportArguments& arguments) const
 {
 #if ENABLE(VIEWPORT)
-    if (!m_webView->isFixedLayoutModeEnabled() || !m_webView->client() || !m_webView->page())
+    if (!m_webView->settings()->viewportEnabled() || !m_webView->isFixedLayoutModeEnabled() || !m_webView->client() || !m_webView->page())
         return;
 
     ViewportArguments args;
index 18f9ac3..8fc0e42 100644 (file)
@@ -50,6 +50,7 @@ WebSettingsImpl::WebSettingsImpl(Settings* settings)
     , m_compositeToTextureEnabled(false)
     , m_showFPSCounter(false)
     , m_showPlatformLayerTree(false)
+    , m_viewportEnabled(false)
 {
     ASSERT(settings);
 }
@@ -558,4 +559,9 @@ void WebSettingsImpl::setThreadedAnimationEnabled(bool enabled)
     m_settings->setThreadedAnimationEnabled(enabled);
 }
 
+void WebSettingsImpl::setViewportEnabled(bool enabled)
+{
+    m_viewportEnabled = enabled;
+}
+
 } // namespace WebKit
index 20b90dc..edd6a1e 100644 (file)
@@ -140,12 +140,15 @@ public:
     virtual void setPerTilePaintingEnabled(bool);
     virtual void setPartialSwapEnabled(bool);
     virtual void setThreadedAnimationEnabled(bool);
+    virtual void setViewportEnabled(bool);
+    virtual bool viewportEnabled() const { return m_viewportEnabled; }
 
 private:
     WebCore::Settings* m_settings;
     bool m_compositeToTextureEnabled;
     bool m_showFPSCounter;
     bool m_showPlatformLayerTree;
+    bool m_viewportEnabled;
 };
 
 } // namespace WebKit