Chromium Code Reviews| Index: Source/core/css/MediaQueryExp.cpp |
| diff --git a/Source/core/css/MediaQueryExp.cpp b/Source/core/css/MediaQueryExp.cpp |
| index 03a29f76a6a2939988d5210bff3fd15ae7d6411d..ccc674a29071b1d09042da4bff228c9dc03d2bc5 100644 |
| --- a/Source/core/css/MediaQueryExp.cpp |
| +++ b/Source/core/css/MediaQueryExp.cpp |
| @@ -39,7 +39,7 @@ |
| namespace WebCore { |
| -static inline bool featureWithCSSValueID(const AtomicString& mediaFeature, const CSSParserValue* value) |
| +static inline bool featureWithCSSValueID(const String& mediaFeature, const CSSParserValue* value) |
| { |
| if (!value->id) |
| return false; |
| @@ -50,7 +50,7 @@ static inline bool featureWithCSSValueID(const AtomicString& mediaFeature, const |
| || mediaFeature == MediaFeatureNames::scanMediaFeature; |
| } |
| -static inline bool featureWithValidIdent(const AtomicString& mediaFeature, CSSValueID ident) |
| +static inline bool featureWithValidIdent(const String& mediaFeature, CSSValueID ident) |
| { |
| if (mediaFeature == MediaFeatureNames::orientationMediaFeature) |
| return ident == CSSValuePortrait || ident == CSSValueLandscape; |
| @@ -78,7 +78,7 @@ static inline bool featureWithValidIdent(const AtomicString& mediaFeature, CSSVa |
| return false; |
| } |
| -static inline bool featureWithValidPositiveLenghtOrNumber(const AtomicString& mediaFeature, const CSSParserValue* value) |
| +static inline bool featureWithValidPositiveLenghtOrNumber(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 < 0) |
| return false; |
| @@ -97,7 +97,7 @@ static inline bool featureWithValidPositiveLenghtOrNumber(const AtomicString& me |
| || mediaFeature == MediaFeatureNames::minDeviceWidthMediaFeature; |
| } |
| -static inline bool featureWithValidDensity(const AtomicString& mediaFeature, const CSSParserValue* value) |
| +static inline bool featureWithValidDensity(const String& mediaFeature, const CSSParserValue* value) |
| { |
| if ((value->unit != CSSPrimitiveValue::CSS_DPPX && value->unit != CSSPrimitiveValue::CSS_DPI && value->unit != CSSPrimitiveValue::CSS_DPCM) || value->fValue <= 0) |
| return false; |
| @@ -107,7 +107,7 @@ static inline bool featureWithValidDensity(const AtomicString& mediaFeature, con |
| || mediaFeature == MediaFeatureNames::minResolutionMediaFeature; |
| } |
| -static inline bool featureWithPositiveInteger(const AtomicString& mediaFeature, const CSSParserValue* value) |
| +static inline bool featureWithPositiveInteger(const String& mediaFeature, const CSSParserValue* value) |
| { |
| if (!value->isInt || value->fValue < 0) |
| return false; |
| @@ -123,7 +123,7 @@ static inline bool featureWithPositiveInteger(const AtomicString& mediaFeature, |
| || mediaFeature == MediaFeatureNames::maxMonochromeMediaFeature; |
| } |
| -static inline bool featureWithPositiveNumber(const AtomicString& mediaFeature, const CSSParserValue* value) |
| +static inline bool featureWithPositiveNumber(const String& mediaFeature, const CSSParserValue* value) |
| { |
| if (value->unit != CSSPrimitiveValue::CSS_NUMBER || value->fValue < 0) |
| return false; |
| @@ -137,7 +137,7 @@ static inline bool featureWithPositiveNumber(const AtomicString& mediaFeature, c |
| || mediaFeature == MediaFeatureNames::minDevicePixelRatioMediaFeature; |
| } |
| -static inline bool featureWithZeroOrOne(const AtomicString& mediaFeature, const CSSParserValue* value) |
| +static inline bool featureWithZeroOrOne(const String& mediaFeature, const CSSParserValue* value) |
| { |
| if (!value->isInt || !(value->fValue == 1 || !value->fValue)) |
| return false; |
| @@ -146,7 +146,7 @@ static inline bool featureWithZeroOrOne(const AtomicString& mediaFeature, const |
| || mediaFeature == MediaFeatureNames::hoverMediaFeature; |
| } |
| -static inline bool featureWithAspectRatio(const AtomicString& mediaFeature) |
| +static inline bool featureWithAspectRatio(const String& mediaFeature) |
| { |
| return mediaFeature == MediaFeatureNames::aspectRatioMediaFeature |
| || mediaFeature == MediaFeatureNames::deviceAspectRatioMediaFeature |
| @@ -156,7 +156,7 @@ static inline bool featureWithAspectRatio(const AtomicString& mediaFeature) |
| || mediaFeature == MediaFeatureNames::maxDeviceAspectRatioMediaFeature; |
| } |
| -static inline bool featureWithoutValue(const AtomicString& mediaFeature) |
| +static inline bool featureWithoutValue(const String& mediaFeature) |
| { |
| // Media features that are prefixed by min/max cannot be used without a value. |
| return mediaFeature == MediaFeatureNames::monochromeMediaFeature |
| @@ -196,13 +196,13 @@ bool MediaQueryExp::isViewportDependent() const |
| || m_mediaFeature == MediaFeatureNames::maxAspectRatioMediaFeature; |
|
abarth-chromium
2013/07/08 15:12:31
not lgtm
We use AtomicStrings here for two reason
|
| } |
| -MediaQueryExp::MediaQueryExp(const AtomicString& mediaFeature, PassRefPtr<CSSValue> value) |
| +MediaQueryExp::MediaQueryExp(const String& mediaFeature, PassRefPtr<CSSValue> value) |
| : m_mediaFeature(mediaFeature) |
| , m_value(value) |
| { |
| } |
| -PassOwnPtr<MediaQueryExp> MediaQueryExp::create(const AtomicString& mediaFeature, CSSParserValueList* valueList) |
| +PassOwnPtr<MediaQueryExp> MediaQueryExp::create(const String& mediaFeature, CSSParserValueList* valueList) |
| { |
| RefPtr<CSSValue> cssValue; |
| bool isValid = false; |