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

Side by Side 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: Introduce m_relationIsForShadowDistributed 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2002-2003 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2002-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 App le Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 App le Inc. All rights reserved.
4 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
6 * Copyright (C) 2012 Intel Corporation. All rights reserved. 6 * Copyright (C) 2012 Intel Corporation. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 case VAR_DEFINITION: 80 case VAR_DEFINITION:
81 case UNICODERANGE: 81 case UNICODERANGE:
82 return true; 82 return true;
83 default: 83 default:
84 return false; 84 return false;
85 } 85 }
86 } 86 }
87 87
88 %} 88 %}
89 89
90 %expect 28 90 %expect 29
91 91
92 %nonassoc LOWEST_PREC 92 %nonassoc LOWEST_PREC
93 93
94 %left UNIMPORTANT_TOK 94 %left UNIMPORTANT_TOK
95 95
96 %token WHITESPACE SGML_CD 96 %token WHITESPACE SGML_CD
97 %token TOKEN_EOF 0 97 %token TOKEN_EOF 0
98 98
99 %token INCLUDES 99 %token INCLUDES
100 %token DASHMATCH 100 %token DASHMATCH
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 %type <keyframeRuleList> keyframes_rule 269 %type <keyframeRuleList> keyframes_rule
270 %type <valueList> key_list 270 %type <valueList> key_list
271 %type <value> key 271 %type <value> key
272 272
273 %type <id> property 273 %type <id> property
274 274
275 %type <selector> specifier 275 %type <selector> specifier
276 %type <selector> specifier_list 276 %type <selector> specifier_list
277 %type <selector> simple_selector 277 %type <selector> simple_selector
278 %type <selector> selector 278 %type <selector> selector
279 %type <selector> relative_selector
279 %type <selectorList> selector_list 280 %type <selectorList> selector_list
280 %type <selectorList> simple_selector_list 281 %type <selectorList> simple_selector_list
281 %type <selectorList> region_selector 282 %type <selectorList> region_selector
282 %type <selector> selector_with_trailing_whitespace 283 %type <selector> selector_with_trailing_whitespace
283 %type <selector> class 284 %type <selector> class
284 %type <selector> attrib 285 %type <selector> attrib
285 %type <selector> pseudo 286 %type <selector> pseudo
286 %type <selector> pseudo_page 287 %type <selector> pseudo_page
287 %type <selector> page_selector 288 %type <selector> page_selector
288 289
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 | selector_list at_selector_end ',' maybe_space before_selector_group_item s elector %prec UNIMPORTANT_TOK { 1119 | selector_list at_selector_end ',' maybe_space before_selector_group_item s elector %prec UNIMPORTANT_TOK {
1119 if ($1 && $6) { 1120 if ($1 && $6) {
1120 $$ = $1; 1121 $$ = $1;
1121 $$->append(parser->sinkFloatingSelector($6)); 1122 $$->append(parser->sinkFloatingSelector($6));
1122 parser->updateLastSelectorLineAndPosition(); 1123 parser->updateLastSelectorLineAndPosition();
1123 } else 1124 } else
1124 $$ = 0; 1125 $$ = 0;
1125 } 1126 }
1126 ; 1127 ;
1127 1128
1129 relative_selector:
1130 combinator selector {
1131 $$ = $2;
1132 CSSParserSelector* end = $$;
1133 while (end->tagHistory())
1134 end = end->tagHistory();
1135 end->setRelation($1);
1136 }
1137 | selector {
1138 $$ = $1;
1139 }
1140 ;
1141
1128 selector_with_trailing_whitespace: 1142 selector_with_trailing_whitespace:
1129 selector WHITESPACE { 1143 selector WHITESPACE {
1130 $$ = $1; 1144 $$ = $1;
1131 } 1145 }
1132 ; 1146 ;
1133 1147
1134 selector: 1148 selector:
1135 simple_selector { 1149 simple_selector {
1136 $$ = $1; 1150 $$ = $1;
1137 } 1151 }
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
1378 $$->setValue($3); 1392 $$->setValue($3);
1379 CSSSelector::PseudoType type = $$->pseudoType(); 1393 CSSSelector::PseudoType type = $$->pseudoType();
1380 if (type != CSSSelector::PseudoCue) 1394 if (type != CSSSelector::PseudoCue)
1381 $$ = 0; 1395 $$ = 0;
1382 } else 1396 } else
1383 $$ = 0; 1397 $$ = 0;
1384 } 1398 }
1385 | ':' ':' CUEFUNCTION selector_recovery ')' { 1399 | ':' ':' CUEFUNCTION selector_recovery ')' {
1386 YYERROR; 1400 YYERROR;
1387 } 1401 }
1388 | ':' ':' DISTRIBUTEDFUNCTION maybe_space selector maybe_space ')' { 1402 | ':' ':' DISTRIBUTEDFUNCTION maybe_space relative_selector maybe_space ')' {
1389 if (!$5) 1403 if (!$5)
1390 $$ = 0; 1404 $$ = 0;
1391 else { 1405 else {
1392 $$ = parser->createFloatingSelector(); 1406 $$ = parser->createFloatingSelector();
1393 $$->setMatch(CSSSelector::PseudoElement); 1407 $$->setMatch(CSSSelector::PseudoElement);
1394 $$->setFunctionArgumentSelector($5); 1408 $$->setFunctionArgumentSelector($5);
1395 parser->tokenToLowerCase($3); 1409 parser->tokenToLowerCase($3);
1396 $$->setValue($3); 1410 $$->setValue($3);
1397 } 1411 }
1398 } 1412 }
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
1949 1963
1950 rule_error_recovery: 1964 rule_error_recovery:
1951 /* empty */ 1965 /* empty */
1952 | rule_error_recovery error 1966 | rule_error_recovery error
1953 | rule_error_recovery invalid_square_brackets_block 1967 | rule_error_recovery invalid_square_brackets_block
1954 | rule_error_recovery invalid_parentheses_block 1968 | rule_error_recovery invalid_parentheses_block
1955 ; 1969 ;
1956 1970
1957 %% 1971 %%
1958 1972
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698