mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-15 21:41:58 +00:00
LibWeb/CSS: Treat block at-rules with no block as invalid
This commit is contained in:
parent
48f56cad08
commit
b00e57139f
Notes:
github-actions[bot]
2025-06-25 07:03:50 +00:00
Author: https://github.com/tcl3
Commit: b00e57139f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5204
Reviewed-by: https://github.com/gmta ✅
6 changed files with 90 additions and 16 deletions
|
@ -561,6 +561,15 @@ Optional<MediaFeatureValue> Parser::parse_media_feature_value(MediaFeatureID med
|
|||
|
||||
GC::Ptr<CSSMediaRule> Parser::convert_to_media_rule(AtRule const& rule, Nested nested)
|
||||
{
|
||||
// https://drafts.csswg.org/css-conditional-3/#at-media
|
||||
// @media <media-query-list> {
|
||||
// <rule-list>
|
||||
// }
|
||||
if (!rule.is_block_rule) {
|
||||
dbgln_if(CSS_PARSER_DEBUG, "Failed to parse @media rule: Expected a block.");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto media_query_tokens = TokenStream { rule.prelude };
|
||||
auto media_query_list = parse_a_media_query_list(media_query_tokens);
|
||||
auto media_list = MediaList::create(realm(), move(media_query_list));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue