Index: Source/core/css/MediaQueryExp.cpp |
diff --git a/Source/core/css/MediaQueryExp.cpp b/Source/core/css/MediaQueryExp.cpp |
index 253350d1da9e82a17d88230d3e71f61a8302ebcb..798fafe20d6a0bdb3cf385b78169e4c0c92c1e1f 100644 |
--- a/Source/core/css/MediaQueryExp.cpp |
+++ b/Source/core/css/MediaQueryExp.cpp |
@@ -67,9 +67,15 @@ static inline bool featureWithValidIdent(const String& mediaFeature, CSSValueID |
return false; |
} |
+static bool positiveLengthUnit(const int unit) |
+{ |
+ return ((unit >= CSSPrimitiveValue::CSS_EMS && unit <= CSSPrimitiveValue::CSS_PC) |
+ || unit == CSSPrimitiveValue::CSS_REMS || unit == CSSPrimitiveValue::CSS_CHS); |
alancutter (OOO until 2018)
2014/07/29 03:25:15
A switch would be more explicit and readable here.
|
+} |
+ |
static inline bool featureWithValidPositiveLength(const String& mediaFeature, const CSSParserValue* value) |
{ |
- if (!(((value->unit >= CSSPrimitiveValue::CSS_EMS && value->unit <= CSSPrimitiveValue::CSS_PC) || value->unit == CSSPrimitiveValue::CSS_REMS) || (value->unit == CSSPrimitiveValue::CSS_NUMBER && !(value->fValue))) || value->fValue < 0) |
+ if (!(positiveLengthUnit(value->unit) || (value->unit == CSSPrimitiveValue::CSS_NUMBER && !(value->fValue))) || value->fValue < 0) |
alancutter (OOO until 2018)
2014/07/29 03:25:15
It's within the style guide to make comparisons wi
|
return false; |