Index: Source/core/css/parser/CSSParserToken.cpp |
diff --git a/Source/core/css/parser/CSSParserToken.cpp b/Source/core/css/parser/CSSParserToken.cpp |
index e1ea4ec979816bdae879841790e2f52d6ae1723b..e383267dabb612cab17b747dc75707069aee4326 100644 |
--- a/Source/core/css/parser/CSSParserToken.cpp |
+++ b/Source/core/css/parser/CSSParserToken.cpp |
@@ -33,6 +33,7 @@ CSSParserToken::CSSParserToken(CSSParserTokenType type, CSSParserString value, B |
, m_blockType(blockType) |
{ |
initValueFromCSSParserString(value); |
+ m_id = -1; |
} |
CSSParserToken::CSSParserToken(CSSParserTokenType type, double numericValue, NumericValueType numericValueType, NumericSign sign) |
@@ -110,6 +111,24 @@ CSSPropertyID CSSParserToken::parseAsUnresolvedCSSPropertyID() const |
return unresolvedCSSPropertyID(value()); |
} |
+CSSValueID CSSParserToken::id() const |
+{ |
+ if (m_type != IdentToken) |
+ return CSSValueInvalid; |
+ if (m_id < 0) |
+ m_id = cssValueKeywordID(value()); |
+ return static_cast<CSSValueID>(m_id); |
+} |
+ |
+CSSValueID CSSParserToken::functionId() const |
+{ |
+ if (m_type != FunctionToken) |
+ return CSSValueInvalid; |
+ if (m_id < 0) |
+ m_id = cssValueKeywordID(value()); |
+ return static_cast<CSSValueID>(m_id); |
+} |
+ |
void CSSParserToken::serialize(StringBuilder& builder) const |
{ |
// This is currently only used for @supports CSSOM. To keep our implementation |