| 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;
|
| }
|
| }
|
|
|