Skip to content

Commit 15f1fdb

Browse files
committed
Skip parsing of the next ruleset upon finding an invalid selector instead aborting the parsing process. This seems to match the browsers' behavior
1 parent 8792d00 commit 15f1fdb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Sabberworm/CSS/RuleSet/DeclarationBlock.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ public static function parse(ParserState $oParserState) {
3333
$oResult->setSelector($oParserState->consumeUntil('{', false, true, $aComments));
3434
} catch (UnexpectedTokenException $e) {
3535
if($oParserState->getSettings()->bLenientParsing) {
36-
return NULL;
36+
$oParserState->consumeUntil('}', false, true);
37+
return false;
3738
} else {
3839
throw $e;
3940
}

0 commit comments

Comments
 (0)