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

Unified Diff: Source/core/css/parser/CSSParserToken.cpp

Issue 1319343004: Add property parser code path based on CSSParserTokenRange (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 5 years, 3 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/parser/CSSParserToken.h ('k') | Source/core/css/parser/CSSParserValues.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/core/css/parser/CSSParserToken.h ('k') | Source/core/css/parser/CSSParserValues.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698