@@ -146,6 +146,12 @@ public static function getParserTestData()
146146 // unicode escape: \20 == (space)
147147 ['*[aval=" \'\20 \'"] ' , ['Attribute[Element[*][aval = \'\' \'\']] ' ]],
148148 ["*[aval= \"' \\20 \r\n ' \"] " , ['Attribute[Element[*][aval = \'\' \'\']] ' ]],
149+ [':scope > foo ' , ['CombinedSelector[Pseudo[Element[*]:scope] > Element[foo]] ' ]],
150+ [':scope > foo bar > div ' , ['CombinedSelector[CombinedSelector[CombinedSelector[Pseudo[Element[*]:scope] > Element[foo]] <followed> Element[bar]] > Element[div]] ' ]],
151+ [':scope > #foo #bar ' , ['CombinedSelector[CombinedSelector[Pseudo[Element[*]:scope] > Hash[Element[*]#foo]] <followed> Hash[Element[*]#bar]] ' ]],
152+ [':scope ' , ['Pseudo[Element[*]:scope] ' ]],
153+ ['foo bar, :scope > div ' , ['CombinedSelector[Element[foo] <followed> Element[bar]] ' , 'CombinedSelector[Pseudo[Element[*]:scope] > Element[div]] ' ]],
154+ ['foo bar,:scope > div ' , ['CombinedSelector[Element[foo] <followed> Element[bar]] ' , 'CombinedSelector[Pseudo[Element[*]:scope] > Element[div]] ' ]],
149155 ];
150156 }
151157
@@ -176,6 +182,7 @@ public static function getParserExceptionTestData()
176182 [':lang(fr ' , SyntaxErrorException::unexpectedToken ('an argument ' , new Token (Token::TYPE_FILE_END , '' , 8 ))->getMessage ()],
177183 [':contains("foo ' , SyntaxErrorException::unclosedString (10 )->getMessage ()],
178184 ['foo! ' , SyntaxErrorException::unexpectedToken ('selector ' , new Token (Token::TYPE_DELIMITER , '! ' , 3 ))->getMessage ()],
185+ [':scope > div :scope header ' , SyntaxErrorException::notAtTheStartOfASelector ('scope ' )->getMessage ()],
179186 ];
180187 }
181188
0 commit comments