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

Unified Diff: Source/core/css/MediaQueryExp.cpp

Issue 186603002: Length MQs invalidate non zero numbers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed build issue Created 6 years, 10 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/core.gypi ('k') | Source/core/css/MediaQuerySetTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/MediaQueryExp.cpp
diff --git a/Source/core/css/MediaQueryExp.cpp b/Source/core/css/MediaQueryExp.cpp
index 8671a2e30e3debaafb6b9fb598eb357fc583e7fa..6009840c23f68cab6a33b98a552094149a43581c 100644
--- a/Source/core/css/MediaQueryExp.cpp
+++ b/Source/core/css/MediaQueryExp.cpp
@@ -77,9 +77,9 @@ static inline bool featureWithValidIdent(const AtomicString& mediaFeature, CSSVa
return false;
}
-static inline bool featureWithValidPositiveLenghtOrNumber(const AtomicString& mediaFeature, const CSSParserValue* value)
+static inline bool featureWithValidPositiveLength(const AtomicString& 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 < 0)
+ 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)
return false;
return mediaFeature == MediaFeatureNames::heightMediaFeature
@@ -225,7 +225,7 @@ PassOwnPtrWillBeRawPtr<MediaQueryExp> MediaQueryExp::create(const AtomicString&
} else if (featureWithValidDensity(mediaFeature, value)) {
// Media features that must have non-negative <density>, ie. dppx, dpi or dpcm.
cssValue = CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveValue::UnitTypes) value->unit);
- } else if (featureWithValidPositiveLenghtOrNumber(mediaFeature, value)) {
+ } else if (featureWithValidPositiveLength(mediaFeature, value)) {
// Media features that must have non-negative <lenght> or number value.
cssValue = CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveValue::UnitTypes) value->unit);
} else if (featureWithPositiveInteger(mediaFeature, value)) {
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/css/MediaQuerySetTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698