Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(810)

Unified Diff: Source/core/dom/ViewportArguments.cpp

Issue 23691017: [Android WebView] Treat zero values in viewport arguments specially (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed rune's comments Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/page/Settings.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ViewportArguments.cpp
diff --git a/Source/core/dom/ViewportArguments.cpp b/Source/core/dom/ViewportArguments.cpp
index 0a2708dd1f07b1b02f760d61f5acb4d501683393..d32836aaa10cd6f8adc73dd426b9d0f7400236f3 100644
--- a/Source/core/dom/ViewportArguments.cpp
+++ b/Source/core/dom/ViewportArguments.cpp
@@ -29,6 +29,8 @@
#include "core/dom/ViewportArguments.h"
#include "core/dom/Document.h"
+#include "core/page/Page.h"
+#include "core/page/Settings.h"
#include "wtf/text/WTFString.h"
using namespace std;
@@ -297,6 +299,13 @@ static float findSizeValue(const String& keyString, const String& valueString, D
if (value < 0)
return ViewportArguments::ValueAuto;
+ if (!static_cast<int>(value) && document->page() && document->page()->settings().viewportMetaZeroValuesQuirk()) {
+ if (keyString == "width")
+ return ViewportArguments::ValueDeviceWidth;
+ if (keyString == "height")
+ return ViewportArguments::ValueDeviceHeight;
+ }
+
return value;
}
@@ -325,6 +334,9 @@ static float findScaleValue(const String& keyString, const String& valueString,
if (value > 10.0)
reportViewportWarning(document, MaximumScaleTooLargeError, String(), String());
+ if (!static_cast<int>(value) && document->page() && document->page()->settings().viewportMetaZeroValuesQuirk() && (keyString == "minimum-scale" || keyString == "maximum-scale"))
+ return ViewportArguments::ValueAuto;
+
return value;
}
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/page/Settings.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698