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 { |