diff --git a/Libraries/LibWeb/CSS/Parser/RuleParsing.cpp b/Libraries/LibWeb/CSS/Parser/RuleParsing.cpp index d0be36eea6d..5f0a84da3d9 100644 --- a/Libraries/LibWeb/CSS/Parser/RuleParsing.cpp +++ b/Libraries/LibWeb/CSS/Parser/RuleParsing.cpp @@ -196,7 +196,7 @@ GC::Ptr Parser::convert_to_import_rule(AtRule const& rule) return {}; } - if (!rule.child_rules_and_lists_of_declarations.is_empty()) { + if (rule.is_block_rule) { dbgln_if(CSS_PARSER_DEBUG, "Failed to parse @import rule: Block is not allowed."); return {}; } @@ -470,7 +470,7 @@ GC::Ptr Parser::convert_to_namespace_rule(AtRule const& rule) return {}; } - if (!rule.child_rules_and_lists_of_declarations.is_empty()) { + if (rule.is_block_rule) { dbgln_if(CSS_PARSER_DEBUG, "Failed to parse @namespace rule: Block is not allowed."); return {}; } diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/css-namespaces/reference/ref-lime-5.xml b/Tests/LibWeb/Ref/expected/wpt-import/css/css-namespaces/reference/ref-lime-5.xml new file mode 100644 index 00000000000..9c45f9de7cb --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/css-namespaces/reference/ref-lime-5.xml @@ -0,0 +1,14 @@ + + + + + CSS Namespaces Test Suite reference + + +

This sentence should have a green background.

+

This sentence should have a green background.

+

This sentence should have a green background.

+

This sentence should have a green background.

+

This sentence should have a green background.

+ + diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/css-namespaces/syntax-013.xml b/Tests/LibWeb/Ref/input/wpt-import/css/css-namespaces/syntax-013.xml new file mode 100644 index 00000000000..5ec8d84b7c0 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/css-namespaces/syntax-013.xml @@ -0,0 +1,44 @@ + + + + + + + + + CSS Namespaces Test Suite: @namespace error handling + + + + + + + + + +

This sentence should have a green background.

+

This sentence should have a green background.

+

This sentence should have a green background.

+

This sentence should have a green background.

+

This sentence should have a green background.

+ +