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

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

Issue 23754026: Properly check for a zero-valued floating-point viewport argument (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add test page 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 | « no previous file | Source/web/tests/WebFrameTest.cpp » ('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 48d56e41ad064ce4f22a113c22d8898b6c323997..0808c89c448b2f9f65ba3c1acabc172a87d4b4b8 100644
--- a/Source/core/dom/ViewportArguments.cpp
+++ b/Source/core/dom/ViewportArguments.cpp
@@ -235,7 +235,7 @@ static Length findSizeValue(const String& keyString, const String& valueString,
if (value < 0)
return Length(); // auto
- if (!static_cast<int>(value) && document->page() && document->page()->settings().viewportMetaZeroValuesQuirk()) {
+ if (!value && document->page() && document->page()->settings().viewportMetaZeroValuesQuirk()) {
if (keyString == "width")
return Length(100, ViewportPercentageWidth);
if (keyString == "height")
@@ -270,7 +270,7 @@ 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"))
+ if (!value && document->page() && document->page()->settings().viewportMetaZeroValuesQuirk() && (keyString == "minimum-scale" || keyString == "maximum-scale"))
return ViewportArguments::ValueAuto;
return clampScaleValue(value);
« no previous file with comments | « no previous file | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698