OLD | NEW |
1 %{ | 1 %{ |
2 | 2 |
3 /* | 3 /* |
4 * Copyright (C) 2002-2003 Lars Knoll (knoll@kde.org) | 4 * Copyright (C) 2002-2003 Lars Knoll (knoll@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 App
le Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 App
le Inc. All rights reserved. |
6 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 6 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
7 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 7 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
8 * Copyright (C) 2012 Intel Corporation. All rights reserved. | 8 * Copyright (C) 2012 Intel Corporation. All rights reserved. |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 case STRING: | 107 case STRING: |
108 case NTH: | 108 case NTH: |
109 case HEX: | 109 case HEX: |
110 case IDSEL: | 110 case IDSEL: |
111 case DIMEN: | 111 case DIMEN: |
112 case INVALIDDIMEN: | 112 case INVALIDDIMEN: |
113 case URI: | 113 case URI: |
114 case FUNCTION: | 114 case FUNCTION: |
115 case ANYFUNCTION: | 115 case ANYFUNCTION: |
116 case HOSTFUNCTION: | 116 case HOSTFUNCTION: |
| 117 case ANCESTORFUNCTION: |
117 case NOTFUNCTION: | 118 case NOTFUNCTION: |
118 case CALCFUNCTION: | 119 case CALCFUNCTION: |
119 case MINFUNCTION: | 120 case MINFUNCTION: |
120 case MAXFUNCTION: | 121 case MAXFUNCTION: |
121 case VARFUNCTION: | 122 case VARFUNCTION: |
122 case VAR_DEFINITION: | 123 case VAR_DEFINITION: |
123 case UNICODERANGE: | 124 case UNICODERANGE: |
124 return true; | 125 return true; |
125 default: | 126 default: |
126 return false; | 127 return false; |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 %token <string> ANYFUNCTION | 263 %token <string> ANYFUNCTION |
263 %token <string> CUEFUNCTION | 264 %token <string> CUEFUNCTION |
264 %token <string> NOTFUNCTION | 265 %token <string> NOTFUNCTION |
265 %token <string> DISTRIBUTEDFUNCTION | 266 %token <string> DISTRIBUTEDFUNCTION |
266 %token <string> CALCFUNCTION | 267 %token <string> CALCFUNCTION |
267 %token <string> MINFUNCTION | 268 %token <string> MINFUNCTION |
268 %token <string> MAXFUNCTION | 269 %token <string> MAXFUNCTION |
269 %token <string> VARFUNCTION | 270 %token <string> VARFUNCTION |
270 %token <string> VAR_DEFINITION | 271 %token <string> VAR_DEFINITION |
271 %token <string> HOSTFUNCTION | 272 %token <string> HOSTFUNCTION |
| 273 %token <string> ANCESTORFUNCTION |
272 | 274 |
273 %token <string> UNICODERANGE | 275 %token <string> UNICODERANGE |
274 | 276 |
275 %type <relation> combinator | 277 %type <relation> combinator |
276 | 278 |
277 %type <rule> ruleset | 279 %type <rule> ruleset |
278 %type <rule> media | 280 %type <rule> media |
279 %type <rule> import | 281 %type <rule> import |
280 %type <rule> namespace | 282 %type <rule> namespace |
281 %type <rule> page | 283 %type <rule> page |
(...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1535 $$->setMatch(CSSSelector::PseudoClass); | 1537 $$->setMatch(CSSSelector::PseudoClass); |
1536 parser->tokenToLowerCase($2); | 1538 parser->tokenToLowerCase($2); |
1537 $$->setValue($2.atomicSubstring(0, $2.length() - 1)); | 1539 $$->setValue($2.atomicSubstring(0, $2.length() - 1)); |
1538 CSSSelector::PseudoType type = $$->pseudoType(); | 1540 CSSSelector::PseudoType type = $$->pseudoType(); |
1539 if (type != CSSSelector::PseudoHost) | 1541 if (type != CSSSelector::PseudoHost) |
1540 YYERROR; | 1542 YYERROR; |
1541 } | 1543 } |
1542 | ':' HOSTFUNCTION selector_recovery closing_parenthesis { | 1544 | ':' HOSTFUNCTION selector_recovery closing_parenthesis { |
1543 YYERROR; | 1545 YYERROR; |
1544 } | 1546 } |
| 1547 | ':' ANCESTORFUNCTION maybe_space simple_selector_list maybe_space closing_
parenthesis { |
| 1548 $$ = parser->createFloatingSelector(); |
| 1549 $$->setMatch(CSSSelector::PseudoClass); |
| 1550 $$->adoptSelectorVector(*parser->sinkFloatingSelectorVector($4)); |
| 1551 parser->tokenToLowerCase($2); |
| 1552 $$->setValue($2); |
| 1553 CSSSelector::PseudoType type = $$->pseudoType(); |
| 1554 if (type != CSSSelector::PseudoAncestor) |
| 1555 YYERROR; |
| 1556 } |
| 1557 // used by :ancestor() |
| 1558 | ':' ANCESTORFUNCTION maybe_space closing_parenthesis { |
| 1559 $$ = parser->createFloatingSelector(); |
| 1560 $$->setMatch(CSSSelector::PseudoClass); |
| 1561 parser->tokenToLowerCase($2); |
| 1562 $$->setValue($2.atomicSubstring(0, $2.length() - 1)); |
| 1563 CSSSelector::PseudoType type = $$->pseudoType(); |
| 1564 if (type != CSSSelector::PseudoAncestor) |
| 1565 YYERROR; |
| 1566 } |
| 1567 | ':' ANCESTORFUNCTION selector_recovery closing_parenthesis { |
| 1568 YYERROR; |
| 1569 } |
1545 ; | 1570 ; |
1546 | 1571 |
1547 selector_recovery: | 1572 selector_recovery: |
1548 error error_location error_recovery; | 1573 error error_location error_recovery; |
1549 | 1574 |
1550 declaration_list: | 1575 declaration_list: |
1551 /* empty */ { $$ = false; } | 1576 /* empty */ { $$ = false; } |
1552 | declaration | 1577 | declaration |
1553 | decl_list declaration { | 1578 | decl_list declaration { |
1554 $$ = $1 || $2; | 1579 $$ = $1 || $2; |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1955 | 1980 |
1956 rule_error_recovery: | 1981 rule_error_recovery: |
1957 /* empty */ | 1982 /* empty */ |
1958 | rule_error_recovery error | 1983 | rule_error_recovery error |
1959 | rule_error_recovery invalid_square_brackets_block | 1984 | rule_error_recovery invalid_square_brackets_block |
1960 | rule_error_recovery invalid_parentheses_block | 1985 | rule_error_recovery invalid_parentheses_block |
1961 ; | 1986 ; |
1962 | 1987 |
1963 %% | 1988 %% |
1964 | 1989 |
OLD | NEW |