| Index: Source/core/css/parser/CSSGrammar.y
|
| diff --git a/Source/core/css/parser/CSSGrammar.y b/Source/core/css/parser/CSSGrammar.y
|
| index ac22228587317fc2e55e75a39ecff29040f2c3b1..a04be665d7c945da7d47a2668ec6d21832165837 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)) {
|
| parser->reportError($3, InvalidSelectorPseudoCSSError);
|
| YYERROR;
|
| }
|
|
|