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

Unified Diff: Source/core/css/CSSGrammar.y

Issue 23528004: [CSS Grid Layout] Update named grid lines syntax to the last version of the specs (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@named
Patch Set: Patch for landing v2 Created 7 years, 1 month 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/CSSComputedStyleDeclaration.cpp ('k') | Source/core/css/CSSGridLineNamesValue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSGrammar.y
diff --git a/Source/core/css/CSSGrammar.y b/Source/core/css/CSSGrammar.y
index 0f5879bb8cef4aecb9c95f69681e5c291761c0fd..b05e77a36a0f27c54027492cdf40170ac82b69e8 100644
--- a/Source/core/css/CSSGrammar.y
+++ b/Source/core/css/CSSGrammar.y
@@ -137,6 +137,15 @@ inline static CSSParserValue makeOperatorValue(int value)
return v;
}
+inline static CSSParserValue makeIdentValue(CSSParserString string)
+{
+ CSSParserValue v;
+ v.id = cssValueKeywordID(string);
+ v.unit = CSSPrimitiveValue::CSS_IDENT;
+ v.string = string;
+ return v;
+}
+
%}
%expect 0
@@ -372,6 +381,9 @@ inline static CSSParserValue makeOperatorValue(int value)
%type <location> error_location
+%type <valueList> ident_list
+%type <value> track_names_list
+
%%
stylesheet:
@@ -1705,6 +1717,29 @@ prio:
| /* empty */ { $$ = false; }
;
+ident_list:
+ IDENT maybe_space {
+ $$ = parser->createFloatingValueList();
+ $$->addValue(makeIdentValue($1));
+ }
+ | ident_list IDENT maybe_space {
+ $$ = $1;
+ $$->addValue(makeIdentValue($2));
+ }
+ ;
+
+track_names_list:
+ '(' maybe_space closing_parenthesis {
+ $$.setFromValueList(parser->sinkFloatingValueList(parser->createFloatingValueList()));
+ }
+ | '(' maybe_space ident_list closing_parenthesis {
+ $$.setFromValueList(parser->sinkFloatingValueList($3));
+ }
+ | '(' maybe_space expr_recovery closing_parenthesis {
+ YYERROR;
+ }
+ ;
+
expr:
term {
$$ = parser->createFloatingValueList();
@@ -1740,11 +1775,7 @@ term:
unary_term maybe_space
| unary_operator unary_term maybe_space { $$ = $2; $$.fValue *= $1; }
| STRING maybe_space { $$.id = CSSValueInvalid; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_STRING; }
- | IDENT maybe_space {
- $$.id = cssValueKeywordID($1);
- $$.unit = CSSPrimitiveValue::CSS_IDENT;
- $$.string = $1;
- }
+ | IDENT maybe_space { $$ = makeIdentValue($1); }
/* We might need to actually parse the number from a dimension, but we can't just put something that uses $$.string into unary_term. */
| DIMEN maybe_space { $$.id = CSSValueInvalid; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_DIMENSION; }
| unary_operator DIMEN maybe_space { $$.id = CSSValueInvalid; $$.string = $2; $$.unit = CSSPrimitiveValue::CSS_DIMENSION; }
@@ -1767,6 +1798,7 @@ term:
| '%' maybe_space { /* Handle width: %; */
$$.id = CSSValueInvalid; $$.unit = 0;
}
+ | track_names_list maybe_space
;
unary_term:
« no previous file with comments | « Source/core/css/CSSComputedStyleDeclaration.cpp ('k') | Source/core/css/CSSGridLineNamesValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698