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

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

Issue 82083002: Move viewport unit resolution to style recalc time (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: rebased.. Created 7 years 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
Index: Source/core/html/HTMLMetaElement-in.cpp
diff --git a/Source/core/html/HTMLMetaElement-in.cpp b/Source/core/html/HTMLMetaElement-in.cpp
index 18697f4b4420fde18c11de22f4ee156c04c45e7b..e456bea425dd05e6af8ced75937a4fede8b494d8 100644
--- a/Source/core/html/HTMLMetaElement-in.cpp
+++ b/Source/core/html/HTMLMetaElement-in.cpp
@@ -170,17 +170,18 @@ Length HTMLMetaElement::parseViewportValueAsLength(const String& keyString, cons
{
// 1) Non-negative number values are translated to px lengths.
// 2) Negative number values are translated to auto.
- // 3) device-width and device-height are used as keywords.
+ // FIXME: We shouldn't abuse Lengths like this
+ // 3) device-width and device-height are translated to -1% and -2%
esprehn 2013/12/04 06:02:28 Woah.
// 4) Other keywords and unknown values translate to 0.0.
unsigned length = valueString.length();
DEFINE_ARRAY_FOR_MATCHING(characters, valueString, 13);
SWITCH(characters, length) {
CASE("device-width") {
- return Length(100, ViewportPercentageWidth);
+ return Length(-1, Percent);
}
CASE("device-height") {
- return Length(100, ViewportPercentageHeight);
+ return Length(-2, Percent);
}
}

Powered by Google App Engine
This is Rietveld 408576698