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

Unified Diff: Source/core/html/HTMLMetaElement-in.cpp

Issue 268453003: Update viewport trigger for GPU rasterization (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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/html/HTMLMetaElement.h ('k') | Source/web/WebViewImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLMetaElement-in.cpp
diff --git a/Source/core/html/HTMLMetaElement-in.cpp b/Source/core/html/HTMLMetaElement-in.cpp
index 5a90d3077206ff5dab2e79539e4b5c071339d818..d70f6563e25acad67fcb53c414f93ee58ef43fc9 100644
--- a/Source/core/html/HTMLMetaElement-in.cpp
+++ b/Source/core/html/HTMLMetaElement-in.cpp
@@ -192,7 +192,7 @@ Length HTMLMetaElement::parseViewportValueAsLength(const String& keyString, cons
return Length(clampLengthValue(value), Fixed);
}
-float HTMLMetaElement::parseViewportValueAsZoom(const String& keyString, const String& valueString)
+float HTMLMetaElement::parseViewportValueAsZoom(const String& keyString, const String& valueString, bool& computedValueMatchesParsedValue)
{
// 1) Non-negative number values are translated to <number> values.
// 2) Negative number values are translated to auto.
@@ -200,6 +200,7 @@ float HTMLMetaElement::parseViewportValueAsZoom(const String& keyString, const S
// 4) device-width and device-height are translated to 10.0.
// 5) no and unknown values are translated to 0.0
+ computedValueMatchesParsedValue = false;
unsigned length = valueString.length();
DEFINE_ARRAY_FOR_MATCHING(characters, valueString, 13);
SWITCH(characters, length) {
@@ -228,22 +229,29 @@ float HTMLMetaElement::parseViewportValueAsZoom(const String& keyString, const S
if (!value && document().settings() && document().settings()->viewportMetaZeroValuesQuirk())
return ViewportDescription::ValueAuto;
- return clampScaleValue(value);
+ float clampedValue = clampScaleValue(value);
+ if (clampedValue == value)
+ computedValueMatchesParsedValue = true;
+
+ return clampedValue;
}
-bool HTMLMetaElement::parseViewportValueAsUserZoom(const String& keyString, const String& valueString)
+bool HTMLMetaElement::parseViewportValueAsUserZoom(const String& keyString, const String& valueString, bool& computedValueMatchesParsedValue)
{
// yes and no are used as keywords.
// Numbers >= 1, numbers <= -1, device-width and device-height are mapped to yes.
// Numbers in the range <-1, 1>, and unknown values, are mapped to no.
+ computedValueMatchesParsedValue = false;
unsigned length = valueString.length();
DEFINE_ARRAY_FOR_MATCHING(characters, valueString, 13);
SWITCH(characters, length) {
CASE("yes") {
+ computedValueMatchesParsedValue = true;
return true;
}
CASE("no") {
+ computedValueMatchesParsedValue = true;
return false;
}
CASE("device-width") {
@@ -313,19 +321,19 @@ void HTMLMetaElement::processViewportKeyValuePair(const String& keyString, const
return;
}
CASE("initial-scale") {
- description->zoom = parseViewportValueAsZoom(keyString, valueString);
+ description->zoom = parseViewportValueAsZoom(keyString, valueString, description->zoomIsExplicit);
return;
}
CASE("minimum-scale") {
- description->minZoom = parseViewportValueAsZoom(keyString, valueString);
+ description->minZoom = parseViewportValueAsZoom(keyString, valueString, description->minZoomIsExplicit);
return;
}
CASE("maximum-scale") {
- description->maxZoom = parseViewportValueAsZoom(keyString, valueString);
+ description->maxZoom = parseViewportValueAsZoom(keyString, valueString, description->maxZoomIsExplicit);
return;
}
CASE("user-scalable") {
- description->userZoom = parseViewportValueAsUserZoom(keyString, valueString);
+ description->userZoom = parseViewportValueAsUserZoom(keyString, valueString, description->userZoomIsExplicit);
return;
}
CASE("target-densitydpi") {
@@ -334,7 +342,7 @@ void HTMLMetaElement::processViewportKeyValuePair(const String& keyString, const
return;
}
CASE("minimal-ui") {
- description->minimalUI = true;
+ // Ignore vendor-specific argument.
return;
}
}
« no previous file with comments | « Source/core/html/HTMLMetaElement.h ('k') | Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698