From 682a216c41d55a0c8d76297f2411277b6c699e39 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sun, 1 Dec 2019 12:14:46 +0000 Subject: Add end-block-content parse event In order to cope with a situation where a block ends with a selector which has no ruleset, add an end-block-content event and in handling it, pop any intermediate states off the language stack so that we're in block mode by the time the event is completed. This fixes an assert situation caused by a ruleset such as: @media screen { dodgy } .outer { top: 10px; } Which has been encountered in the wild (likely a typo). Signed-off-by: Daniel Silverstone --- src/parse/parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/parse/parse.c') diff --git a/src/parse/parse.c b/src/parse/parse.c index cbd8b56..d7cb357 100644 --- a/src/parse/parse.c +++ b/src/parse/parse.c @@ -1388,7 +1388,7 @@ css_error parseBlockContent(css_parser *parser) #endif if (parser->event != NULL) { parser->event( - CSS_PARSER_BLOCK_CONTENT, + CSS_PARSER_END_BLOCK_CONTENT, parser->tokens, parser->event_pw); } -- cgit v1.2.3