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

Unified Diff: third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp

Issue 2653733005: Added parseShorthand method from the parser to CSSPropertyAPI.h. (Closed)
Patch Set: rebase Created 3 years, 10 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
Index: third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
index f7cd5a62aa4a02c17d56a0adf334bbd5c3ed85b9..8a622e7237ae3378e67b0346ea93ab2891ad7bb6 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -2054,8 +2054,8 @@ const CSSValue* CSSPropertyParser::parseSingleValue(
return consumeIdent(m_range);
}
- // Gets the parsing function for our current property from the property API.
- // If it has been implemented, we call this function, otherwise we manually
+ // Gets the parsing method for our current property from the property API.
+ // If it has been implemented, we call this method, otherwise we manually
// parse this value in the switch statement below. As we implement APIs for
// other properties, those properties will be taken out of the switch
// statement.
@@ -3524,6 +3524,16 @@ bool CSSPropertyParser::parseShorthand(CSSPropertyID unresolvedProperty,
bool important) {
CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty);
+ // Gets the parsing method for our current property from the property API.
+ // If it has been implemented, we call this method, otherwise we manually
+ // parse this value in the switch statement below. As we implement APIs for
+ // other properties, those properties will be taken out of the switch
+ // statement.
+ const CSSPropertyDescriptor& cssPropertyDesc =
+ CSSPropertyDescriptor::get(property);
+ if (cssPropertyDesc.parseShorthand)
+ return cssPropertyDesc.parseShorthand(important, m_range, m_context);
+
switch (property) {
case CSSPropertyWebkitMarginCollapse: {
CSSValueID id = m_range.consumeIncludingWhitespace().id();
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSProperties.json5 ('k') | third_party/WebKit/Source/core/css/properties/CSSPropertyAPI.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698