[csswg-drafts] [all] Can we start ignoring CSSRule.type? (#4142)

tabatkins has just created a new issue for https://github.com/w3c/csswg-drafts:

== [all] Can we start ignoring CSSRule.type? ==
The `CSSRule` interface has a `.type` attribute, using the old and busted "make it an int, then define some consts associating the int with names" pattern. This is terrible for many reasons, and we've abandoned it in new APIs.

In similar situations, SVG has switched to just having all new things use a single "unknown" value, and specifying the value properly as some string-valued attribute.

Can we do the same thing?

* deprecate `CSSRule.type`, defining *one* new value that all new rules will use. (And CSSOM defines that, unless otherwise specified, all rules use that value, so individual specs don't have to worry about it.)
* add a new attribute to `CSSRule`, provisionally named `ruleName`, which exposes the name of the rule as a string. Whether it's reflected as "@foo" or "foo" is unimportant, we can decide either way. (I slightly favor "@foo", as that's how most of us seem to refer to the rule in practice.)
* close down the [CSSOM Constants](https://wiki.csswg.org/spec/cssom-constants) page on the wiki ^_^

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4142 using your GitHub account

Received on Monday, 22 July 2019 23:33:04 UTC