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

Side by Side Diff: Source/core/css/CSSGrammar.y

Issue 330043003: Add support for case-insensitive attribute value selectors (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: legacyCaseSensitive->legacyCaseInsensitive; Extend tests. Created 6 years, 5 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 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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 %type <boolean> declaration_list 341 %type <boolean> declaration_list
342 %type <boolean> decl_list 342 %type <boolean> decl_list
343 %type <boolean> declaration 343 %type <boolean> declaration
344 %type <boolean> declarations_and_margins 344 %type <boolean> declarations_and_margins
345 345
346 %type <boolean> prio 346 %type <boolean> prio
347 347
348 %type <integer> match 348 %type <integer> match
349 %type <integer> unary_operator 349 %type <integer> unary_operator
350 %type <integer> maybe_unary_operator 350 %type <integer> maybe_unary_operator
351 %type <integer> attr_flags
352 %type <integer> maybe_attr_flags
351 %type <character> operator 353 %type <character> operator
352 354
353 %type <valueList> expr 355 %type <valueList> expr
354 %type <value> term 356 %type <value> term
355 %type <value> unary_term 357 %type <value> unary_term
356 %type <value> function 358 %type <value> function
357 %type <value> calc_func_term 359 %type <value> calc_func_term
358 %type <character> calc_func_operator 360 %type <character> calc_func_operator
359 %type <valueList> calc_func_expr 361 %type <valueList> calc_func_expr
360 %type <valueList> calc_func_paren_expr 362 %type <valueList> calc_func_paren_expr
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after
1235 ; 1237 ;
1236 1238
1237 attr_name: 1239 attr_name:
1238 IDENT maybe_space { 1240 IDENT maybe_space {
1239 if (parser->m_context.isHTMLDocument()) 1241 if (parser->m_context.isHTMLDocument())
1240 parser->tokenToLowerCase($1); 1242 parser->tokenToLowerCase($1);
1241 $$ = $1; 1243 $$ = $1;
1242 } 1244 }
1243 ; 1245 ;
1244 1246
1247 attr_flags:
1248 IDENT maybe_space {
1249 unsigned flags;
1250 if (!parser->parseAttributeFlags(flags, $1))
1251 YYERROR;
1252 $$ = flags;
1253 }
1254 ;
1255
1256 maybe_attr_flags:
1257 attr_flags
1258 | /* empty */ { $$ = CSSSelector::NoAttributeFlags; }
1259 ;
1260
1245 attrib: 1261 attrib:
1246 '[' maybe_space attr_name closing_square_bracket { 1262 '[' maybe_space attr_name closing_square_bracket {
1247 $$ = parser->createFloatingSelector(); 1263 $$ = parser->createFloatingSelector();
1248 $$->setAttribute(QualifiedName(nullAtom, $3, nullAtom)); 1264 $$->setAttribute(QualifiedName(nullAtom, $3, nullAtom), CSSSelector::NoA ttributeFlags);
1249 $$->setMatch(CSSSelector::Set); 1265 $$->setMatch(CSSSelector::Set);
1250 } 1266 }
1251 | '[' maybe_space attr_name match maybe_space ident_or_string maybe_space cl osing_square_bracket { 1267 | '[' maybe_space attr_name match maybe_space ident_or_string maybe_space ma ybe_attr_flags closing_square_bracket {
1252 $$ = parser->createFloatingSelector(); 1268 $$ = parser->createFloatingSelector();
1253 $$->setAttribute(QualifiedName(nullAtom, $3, nullAtom)); 1269 $$->setAttribute(QualifiedName(nullAtom, $3, nullAtom), $8);
1254 $$->setMatch((CSSSelector::Match)$4); 1270 $$->setMatch((CSSSelector::Match)$4);
1255 $$->setValue($6); 1271 $$->setValue($6);
1256 } 1272 }
1257 | '[' maybe_space namespace_selector attr_name closing_square_bracket { 1273 | '[' maybe_space namespace_selector attr_name closing_square_bracket {
1258 $$ = parser->createFloatingSelector(); 1274 $$ = parser->createFloatingSelector();
1259 $$->setAttribute(parser->determineNameInNamespace($3, $4)); 1275 $$->setAttribute(parser->determineNameInNamespace($3, $4), CSSSelector:: NoAttributeFlags);
1260 $$->setMatch(CSSSelector::Set); 1276 $$->setMatch(CSSSelector::Set);
1261 } 1277 }
1262 | '[' maybe_space namespace_selector attr_name match maybe_space ident_or_st ring maybe_space closing_square_bracket { 1278 | '[' maybe_space namespace_selector attr_name match maybe_space ident_or_st ring maybe_space maybe_attr_flags closing_square_bracket {
1263 $$ = parser->createFloatingSelector(); 1279 $$ = parser->createFloatingSelector();
1264 $$->setAttribute(parser->determineNameInNamespace($3, $4)); 1280 $$->setAttribute(parser->determineNameInNamespace($3, $4), $9);
1265 $$->setMatch((CSSSelector::Match)$5); 1281 $$->setMatch((CSSSelector::Match)$5);
1266 $$->setValue($7); 1282 $$->setValue($7);
1267 } 1283 }
1268 | '[' selector_recovery closing_square_bracket { 1284 | '[' selector_recovery closing_square_bracket {
1269 YYERROR; 1285 YYERROR;
1270 } 1286 }
1271 ; 1287 ;
1272 1288
1273 match: 1289 match:
1274 '=' { 1290 '=' {
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
1823 ; 1839 ;
1824 1840
1825 rule_error_recovery: 1841 rule_error_recovery:
1826 /* empty */ 1842 /* empty */
1827 | rule_error_recovery error 1843 | rule_error_recovery error
1828 | rule_error_recovery invalid_square_brackets_block 1844 | rule_error_recovery invalid_square_brackets_block
1829 | rule_error_recovery invalid_parentheses_block 1845 | rule_error_recovery invalid_parentheses_block
1830 ; 1846 ;
1831 1847
1832 %% 1848 %%
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698