LibWeb/CSS: Return 0 from CSSRule.type for non-spec types

We use the CSSRule::Type enum for identifying the type of a CSSRule, but
the spec requires that only some of these types are exposed via the
`type` attribute. For the rest, we're required to return 0, so let's do
so. :^)
This commit is contained in:
Sam Atkins 2024-10-30 14:33:46 +00:00 committed by Andreas Kling
commit 51fc87bc1b
Notes: github-actions[bot] 2024-10-30 17:46:59 +00:00
5 changed files with 50 additions and 3 deletions

View file

@ -9,7 +9,7 @@ interface CSSRule {
readonly attribute CSSStyleSheet? parentStyleSheet;
// the following attribute and constants are historical
readonly attribute unsigned short type;
[ImplementedAs=type_for_bindings] readonly attribute unsigned short type;
const unsigned short STYLE_RULE = 1;
const unsigned short CHARSET_RULE = 2;
const unsigned short IMPORT_RULE = 3;