Index: Source/core/css/CSSGrammar.y.in |
diff --git a/Source/core/css/CSSGrammar.y.in b/Source/core/css/CSSGrammar.y.in |
index e651d858f071a7c26d9fc6dd2b02a5cbfbe3d86a..8d1e9568c7272527449a65cce7a8ddc606098bbe 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 28 |
+%expect 29 |
%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 |
@@ -1125,6 +1126,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; |
@@ -1385,7 +1399,7 @@ pseudo: |
| ':' ':' CUEFUNCTION selector_recovery ')' { |
YYERROR; |
} |
- | ':' ':' DISTRIBUTEDFUNCTION maybe_space selector maybe_space ')' { |
+ | ':' ':' DISTRIBUTEDFUNCTION maybe_space relative_selector maybe_space ')' { |
if (!$5) |
$$ = 0; |
else { |