Chromium Code Reviews| Index: Source/core/css/parser/CSSGrammar.y |
| diff --git a/Source/core/css/parser/CSSGrammar.y b/Source/core/css/parser/CSSGrammar.y |
| index 792a54b734f08d5f07a25266b778d567a717aaad..6160bec1127e8e1b5fc8c57774a85c314c7b72e3 100644 |
| --- a/Source/core/css/parser/CSSGrammar.y |
| +++ b/Source/core/css/parser/CSSGrammar.y |
| @@ -1343,7 +1343,8 @@ pseudo: |
| parser->tokenToLowerCase($3); |
| $$->setValue($3); |
| CSSSelector::PseudoType type = $$->pseudoType(); |
| - if (type == CSSSelector::PseudoUnknown) { |
| + if (type == CSSSelector::PseudoUnknown || |
| + !parser->isSelectorAllowedInParsingMode(type)) { |
| parser->reportError($2, InvalidSelectorPseudoCSSError); |
| YYERROR; |
| } |
| @@ -1357,7 +1358,8 @@ pseudo: |
| $$->setValue($4); |
| // FIXME: This call is needed to force selector to compute the pseudoType early enough. |
| CSSSelector::PseudoType type = $$->pseudoType(); |
| - if (type == CSSSelector::PseudoUnknown) { |
| + if (type == CSSSelector::PseudoUnknown || |
| + !parser->isSelectorAllowedInParsingMode(type)) { |
|
Julien - ping for review
2015/02/04 01:56:33
Doh'!?
dsinclair
2015/02/04 04:41:32
? Are you saying this is incorrect, or you don't l
|
| parser->reportError($3, InvalidSelectorPseudoCSSError); |
| YYERROR; |
| } |