[csswg-drafts] [cssom] Remarks on addRule method specification (#9930)

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

== [cssom] Remarks on addRule method specification ==
In https://www.w3.org/TR/cssom-1/#dom-cssstylesheet-addrule (and it's the same in the ED) there are two problems:

1. _(editorial)_ The arguments are called `style` and `index` in the IDL fragment, while the prose has `block` and `optionalIndex`.
2. _(substantive)_ The default value for the second argument is `"undefined"`, but it probably should be just `undefined`. (Although I'm not sure. The linked parsing rules are quite intricate. And Firefox does insert a rule with `insertRule("undefined { undefined }"`, even though the [CSS Validation Service](https://jigsaw.w3.org/css-validator/) says `undefined { undefined }` is invalid.)

Anyway, why does it always return -1, not the result of `insertRule`? And why is it deprecated? It's useful for creating empty style rules to be populated programmatically, saves the ` {}`.

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 9 February 2024 11:18:34 UTC