- Notifications
You must be signed in to change notification settings - Fork 759
Open
Labels
css-animations-1Current WorkCurrent Workcss-nesting-1Current WorkCurrent Workcssom-1Current WorkCurrent Work
Description
https://w3c.github.io/csswg-drafts/css-nesting/#cssom-style
I think this would be nicer as
partial interface CSSStyleRule { attribute ObservableArray<CSSRule> cssRules; };This:
- Ensures that
cssRuleshas all the niceArraymethods, e.g.map(),filter(), etc. - Removes the confusing
item()method. - Allows manipulating the CSS rules using normal array methods, e.g.
rule.cssRules.pop(),rule.cssRules.splice(4, 1), etc. - Allows completing replacing the rules list, e.g.
rule.cssRules = [newRule1, newRule2].
You could optionally keep insertRule() and deleteRule(), but they would probably be less necessary. (Although I guess there's no other way to go from string -> CSSRule?)
/cc @tabatkins as someone interested in array-like design on the web platform.
Metadata
Metadata
Assignees
Labels
css-animations-1Current WorkCurrent Workcss-nesting-1Current WorkCurrent Workcssom-1Current WorkCurrent Work