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

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

Issue 18328028: Enable MQ evaluation off the main thread (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@threaded_mqe_rebase
Patch Set: Created 7 years, 5 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/css/MediaQueryExp.h ('k') | Source/core/html/parser/HTMLDocumentParser.h » ('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 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;
« no previous file with comments | « Source/core/css/MediaQueryExp.h ('k') | Source/core/html/parser/HTMLDocumentParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698