LibWeb: Use correct error for invalid rule in nested insertRule

When we try to insert a disallowed (non-nested) statement into a
CSSGroupingRule we should throw a `HierarchyRequestError` as it being
disallowed is a "constraint specified by CSS". Previously we would rely
on `Parser::is_valid_in_the_current_context` and throw a Syntax error.

There are more constraints to be implemented.
This commit is contained in:
Callum Law
2025-06-21 21:57:57 +12:00
committed by Sam Atkins
parent ef7ba02842
commit 80ea865b19
Notes: github-actions[bot] 2025-06-23 11:53:52 +00:00
4 changed files with 139 additions and 9 deletions

View File

@@ -0,0 +1,12 @@
Harness status: OK
Found 7 tests
7 Pass
Pass index before first
Pass index after final
Pass index not specified
Pass index exceeds length
Pass CSS parsing error
Pass constraint violation
Pass disallowed namespace rule