Index: Source/core/css/parser/CSSParserFastPaths.cpp |
diff --git a/Source/core/css/parser/CSSParserFastPaths.cpp b/Source/core/css/parser/CSSParserFastPaths.cpp |
index 83d290a3eaf83ff7eb2fbea7ac560ed83a94e22d..e22118082e69ab8bf006b3f40bf2d5c2d4fe7ded 100644 |
--- a/Source/core/css/parser/CSSParserFastPaths.cpp |
+++ b/Source/core/css/parser/CSSParserFastPaths.cpp |
@@ -428,18 +428,20 @@ static bool fastParseColorInternal(RGBA32& rgb, const CharacterType* characters, |
return false; |
} |
-PassRefPtrWillBeRawPtr<CSSValue> CSSParserFastPaths::parseColor(const String& string, bool quirksMode) |
+PassRefPtrWillBeRawPtr<CSSValue> CSSParserFastPaths::parseColor(const String& string, CSSParserMode parserMode) |
{ |
ASSERT(!string.isEmpty()); |
CSSParserString cssString; |
cssString.init(string); |
CSSValueID valueID = cssValueKeywordID(cssString); |
- if (valueID == CSSValueCurrentcolor || valueID == CSSValueGrey |
- || (valueID >= CSSValueAqua && valueID <= CSSValueWindowtext) || valueID == CSSValueMenu |
- || (quirksMode && valueID >= CSSValueWebkitFocusRingColor && valueID <= CSSValueWebkitText)) |
+ if (CSSPropertyParser::isColorKeyword(valueID)) { |
+ if (!isValueAllowedInMode(valueID, parserMode)) |
fs
2015/07/13 13:59:28
Could also just have picked HTMLStandardMode/HTMLQ
|
+ return nullptr; |
return cssValuePool().createIdentifierValue(valueID); |
+ } |
RGBA32 color; |
+ bool quirksMode = isQuirksModeBehavior(parserMode); |
// Fast path for hex colors and rgb()/rgba() colors |
bool parseResult; |
@@ -947,7 +949,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSParserFastPaths::maybeParseValue(CSSProperty |
if (RefPtrWillBeRawPtr<CSSValue> length = parseSimpleLengthValue(propertyID, string, parserMode)) |
return length.release(); |
if (isColorPropertyID(propertyID)) |
- return parseColor(string, isQuirksModeBehavior(parserMode)); |
+ return parseColor(string, parserMode); |
if (RefPtrWillBeRawPtr<CSSValue> keyword = parseKeywordValue(propertyID, string)) |
return keyword.release(); |
if (RefPtrWillBeRawPtr<CSSValue> transform = parseSimpleTransform(propertyID, string)) |