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

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

Issue 15657003: Make a '::distributed' pseudo element the first-ever client who can accept a relative selector. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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: Source/core/css/CSSGrammar.y.in
diff --git a/Source/core/css/CSSGrammar.y.in b/Source/core/css/CSSGrammar.y.in
index 3d4437624601d414a2b97cfb93a7a376f95468ad..8b3e0236f6fe2455783c7ed0411b1b2be87535ce 100644
--- a/Source/core/css/CSSGrammar.y.in
+++ b/Source/core/css/CSSGrammar.y.in
@@ -87,7 +87,7 @@ static inline bool isCSSTokenAString(int yytype)
%}
-%expect 32
+%expect 33
%nonassoc LOWEST_PREC
@@ -276,6 +276,7 @@ static inline bool isCSSTokenAString(int yytype)
%type <selector> specifier_list
%type <selector> simple_selector
%type <selector> selector
+%type <selector> relative_selector
%type <selectorList> selector_list
%type <selectorList> simple_selector_list
%type <selectorList> region_selector
@@ -1127,6 +1128,19 @@ selector_list:
}
;
+relative_selector:
+ combinator selector {
+ $$ = $2;
+ CSSParserSelector* end = $$;
+ while (end->tagHistory())
+ end = end->tagHistory();
+ end->setRelation($1);
+ }
+ | selector {
+ $$ = $1;
+ }
+ ;
+
selector_with_trailing_whitespace:
selector WHITESPACE {
$$ = $1;
@@ -1396,7 +1410,7 @@ pseudo:
| ':' ':' CUEFUNCTION selector_recovery ')' {
YYERROR;
}
- | ':' ':' DISTRIBUTEDFUNCTION maybe_space selector maybe_space ')' {
+ | ':' ':' DISTRIBUTEDFUNCTION maybe_space relative_selector maybe_space ')' {
if (!$5)
$$ = 0;
else {

Powered by Google App Engine
This is Rietveld 408576698