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

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

Issue 23710067: :-webkit-any pseudo with escaped '(' should not crash. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed workaround code for :not() Created 7 years, 3 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
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 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after
1375 } 1375 }
1376 ; 1376 ;
1377 1377
1378 ident_or_string: 1378 ident_or_string:
1379 IDENT 1379 IDENT
1380 | STRING 1380 | STRING
1381 ; 1381 ;
1382 1382
1383 pseudo_page: 1383 pseudo_page:
1384 ':' IDENT { 1384 ':' IDENT {
1385 if ($2.isFunction())
1386 YYERROR;
1385 $$ = parser->createFloatingSelector(); 1387 $$ = parser->createFloatingSelector();
1386 $$->setMatch(CSSSelector::PagePseudoClass); 1388 $$->setMatch(CSSSelector::PagePseudoClass);
1387 parser->tokenToLowerCase($2); 1389 parser->tokenToLowerCase($2);
1388 $$->setValue($2); 1390 $$->setValue($2);
1389 CSSSelector::PseudoType type = $$->pseudoType(); 1391 CSSSelector::PseudoType type = $$->pseudoType();
1390 if (type == CSSSelector::PseudoUnknown) 1392 if (type == CSSSelector::PseudoUnknown)
1391 YYERROR; 1393 YYERROR;
1392 } 1394 }
1393 1395
1394 pseudo: 1396 pseudo:
1395 ':' error_location IDENT { 1397 ':' error_location IDENT {
1398 if ($3.isFunction())
1399 YYERROR;
1396 $$ = parser->createFloatingSelector(); 1400 $$ = parser->createFloatingSelector();
1397 $$->setMatch(CSSSelector::PseudoClass); 1401 $$->setMatch(CSSSelector::PseudoClass);
1398 parser->tokenToLowerCase($3); 1402 parser->tokenToLowerCase($3);
1399 $$->setValue($3); 1403 $$->setValue($3);
1400 CSSSelector::PseudoType type = $$->pseudoType(); 1404 CSSSelector::PseudoType type = $$->pseudoType();
1401 if (type == CSSSelector::PseudoUnknown) { 1405 if (type == CSSSelector::PseudoUnknown) {
1402 parser->reportError($2, CSSParser::InvalidSelectorPseudoError); 1406 parser->reportError($2, CSSParser::InvalidSelectorPseudoError);
1403 YYERROR; 1407 YYERROR;
1404 } 1408 }
1405 } 1409 }
1406 | ':' ':' error_location IDENT { 1410 | ':' ':' error_location IDENT {
1411 if ($4.isFunction())
1412 YYERROR;
1407 $$ = parser->createFloatingSelector(); 1413 $$ = parser->createFloatingSelector();
1408 $$->setMatch(CSSSelector::PseudoElement); 1414 $$->setMatch(CSSSelector::PseudoElement);
1409 parser->tokenToLowerCase($4); 1415 parser->tokenToLowerCase($4);
1410 $$->setValue($4); 1416 $$->setValue($4);
1411 // FIXME: This call is needed to force selector to compute the pseudoTyp e early enough. 1417 // FIXME: This call is needed to force selector to compute the pseudoTyp e early enough.
1412 CSSSelector::PseudoType type = $$->pseudoType(); 1418 CSSSelector::PseudoType type = $$->pseudoType();
1413 if (type == CSSSelector::PseudoUnknown) { 1419 if (type == CSSSelector::PseudoUnknown) {
1414 parser->reportError($3, CSSParser::InvalidSelectorPseudoError); 1420 parser->reportError($3, CSSParser::InvalidSelectorPseudoError);
1415 YYERROR; 1421 YYERROR;
1416 } 1422 }
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
1922 1928
1923 rule_error_recovery: 1929 rule_error_recovery:
1924 /* empty */ 1930 /* empty */
1925 | rule_error_recovery error 1931 | rule_error_recovery error
1926 | rule_error_recovery invalid_square_brackets_block 1932 | rule_error_recovery invalid_square_brackets_block
1927 | rule_error_recovery invalid_parentheses_block 1933 | rule_error_recovery invalid_parentheses_block
1928 ; 1934 ;
1929 1935
1930 %% 1936 %%
1931 1937
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/pseudo-escaped-parenthesis-expected.txt ('k') | Source/core/css/CSSParserValues.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698