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

Side by Side Diff: sky/engine/core/css/parser/CSSGrammar.y

Issue 836383004: Remove all attribute selectors that are not Set or Exact. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: ojan comment. Created 5 years, 11 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
« no previous file with comments | « sky/engine/core/css/SelectorChecker.cpp ('k') | sky/engine/core/css/parser/CSSTokenizer-in.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 %expect 0 141 %expect 0
142 142
143 %nonassoc LOWEST_PREC 143 %nonassoc LOWEST_PREC
144 144
145 %left UNIMPORTANT_TOK 145 %left UNIMPORTANT_TOK
146 146
147 %token WHITESPACE SGML_CD 147 %token WHITESPACE SGML_CD
148 %token TOKEN_EOF 0 148 %token TOKEN_EOF 0
149 149
150 %token INCLUDES
151 %token DASHMATCH
152 %token BEGINSWITH
153 %token ENDSWITH
154 %token CONTAINS
155
156 %token <string> STRING 150 %token <string> STRING
157 %right <string> IDENT 151 %right <string> IDENT
158 %token <string> NTH 152 %token <string> NTH
159 153
160 %nonassoc <string> HEX 154 %nonassoc <string> HEX
161 %nonassoc <string> IDSEL 155 %nonassoc <string> IDSEL
162 %nonassoc ':' 156 %nonassoc ':'
163 %nonassoc '.' 157 %nonassoc '.'
164 %nonassoc '[' 158 %nonassoc '['
165 %nonassoc <string> '*' 159 %nonassoc <string> '*'
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 %type <selector> class 258 %type <selector> class
265 %type <selector> attrib 259 %type <selector> attrib
266 %type <selector> pseudo 260 %type <selector> pseudo
267 261
268 %type <boolean> declaration_list 262 %type <boolean> declaration_list
269 %type <boolean> decl_list 263 %type <boolean> decl_list
270 %type <boolean> declaration 264 %type <boolean> declaration
271 265
272 %type <boolean> prio 266 %type <boolean> prio
273 267
274 %type <integer> match
275 %type <integer> unary_operator 268 %type <integer> unary_operator
276 %type <integer> maybe_unary_operator 269 %type <integer> maybe_unary_operator
277 %type <character> operator 270 %type <character> operator
278 271
279 %type <valueList> expr 272 %type <valueList> expr
280 %type <value> term 273 %type <value> term
281 %type <value> unary_term 274 %type <value> unary_term
282 %type <value> function 275 %type <value> function
283 %type <value> calc_func_term 276 %type <value> calc_func_term
284 %type <character> calc_func_operator 277 %type <character> calc_func_operator
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 attr_match_type 814 attr_match_type
822 | /* empty */ { $$ = CSSSelector::CaseSensitive; } 815 | /* empty */ { $$ = CSSSelector::CaseSensitive; }
823 ; 816 ;
824 817
825 attrib: 818 attrib:
826 '[' maybe_space attr_name closing_square_bracket { 819 '[' maybe_space attr_name closing_square_bracket {
827 $$ = parser->createFloatingSelector(); 820 $$ = parser->createFloatingSelector();
828 $$->setAttribute(QualifiedName($3), CSSSelector::CaseSensitive); 821 $$->setAttribute(QualifiedName($3), CSSSelector::CaseSensitive);
829 $$->setMatch(CSSSelector::Set); 822 $$->setMatch(CSSSelector::Set);
830 } 823 }
831 | '[' maybe_space attr_name match maybe_space ident_or_string maybe_space ma ybe_attr_match_type closing_square_bracket { 824 | '[' maybe_space attr_name '=' maybe_space ident_or_string maybe_space mayb e_attr_match_type closing_square_bracket {
832 $$ = parser->createFloatingSelector(); 825 $$ = parser->createFloatingSelector();
833 $$->setAttribute(QualifiedName($3), $8); 826 $$->setAttribute(QualifiedName($3), $8);
834 $$->setMatch((CSSSelector::Match)$4); 827 $$->setMatch(CSSSelector::Exact);
835 $$->setValue($6); 828 $$->setValue($6);
836 } 829 }
837 | '[' selector_recovery closing_square_bracket { 830 | '[' selector_recovery closing_square_bracket {
838 YYERROR; 831 YYERROR;
839 } 832 }
840 ; 833 ;
841 834
842 match:
843 '=' {
844 $$ = CSSSelector::Exact;
845 }
846 | INCLUDES {
847 $$ = CSSSelector::List;
848 }
849 | DASHMATCH {
850 $$ = CSSSelector::Hyphen;
851 }
852 | BEGINSWITH {
853 $$ = CSSSelector::Begin;
854 }
855 | ENDSWITH {
856 $$ = CSSSelector::End;
857 }
858 | CONTAINS {
859 $$ = CSSSelector::Contain;
860 }
861 ;
862
863 ident_or_string: 835 ident_or_string:
864 IDENT 836 IDENT
865 | STRING 837 | STRING
866 ; 838 ;
867 839
868 pseudo: 840 pseudo:
869 ':' error_location IDENT { 841 ':' error_location IDENT {
870 if ($3.isFunction()) 842 if ($3.isFunction())
871 YYERROR; 843 YYERROR;
872 $$ = parser->createFloatingSelector(); 844 $$ = parser->createFloatingSelector();
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
1311 ; 1283 ;
1312 1284
1313 rule_error_recovery: 1285 rule_error_recovery:
1314 /* empty */ 1286 /* empty */
1315 | rule_error_recovery error 1287 | rule_error_recovery error
1316 | rule_error_recovery invalid_square_brackets_block 1288 | rule_error_recovery invalid_square_brackets_block
1317 | rule_error_recovery invalid_parentheses_block 1289 | rule_error_recovery invalid_parentheses_block
1318 ; 1290 ;
1319 1291
1320 %% 1292 %%
OLDNEW
« no previous file with comments | « sky/engine/core/css/SelectorChecker.cpp ('k') | sky/engine/core/css/parser/CSSTokenizer-in.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698