Primary eng (and PM) emails
Summary
Remove the CSSCharsetRule interface so that @charset rules are no longer represented in CSSOM. The @charset syntax itself is not affected.
Motivation
In May, I added a UseCounter for CSSCharsetRule.encoding by request from Simon Pieters, following a blink-dev thread one year prior:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/bWgRZOZKmbk/LZWpPb-ZHJUJ
Simon has summarized in the spec bug why he wants to remove it, and has flagged it in the spec:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=27422#c3
http://dev.w3.org/csswg/cssom/#the-csscharsetrule-interface
In Blink, CSSCharsetRule is in CSSStyleSheet.cssRules, but not in the "IE extension" CSSStyleSheet.rules. The existence of @charset shifts the indices by one, but this is not compensated for in the "IE extensions" addRule and deleteRule! Getting rid of CSSCharsetRule would eliminate the difference, making it easier to standardize these IE extensions if usage doesn't come down:
https://www.chromestatus.com/metrics/feature/timeline/popularity/219
https://www.chromestatus.com/metrics/feature/timeline/popularity/220
https://www.chromestatus.com/metrics/feature/timeline/popularity/221
Compatibility Risk
Content that accesses CSSStyleSheet.cssRules by a constant index instead of iteration could break. Since IE doesn't have CSSCharsetRule at all, this is already not reliable cross-browser.
Alternative implementation suggestion for web developers
Don't access cssRules by a constant index.
Don't look for CSSCharsetRule at cssRules[0], when it is created the encoding has already been sniffed and cannot be changed.
Don't switch to CSSCharsetRule.rules/addRule/removeRule to avoid the change in behavior, those are non-standard and not supported by Gecko.
Usage information from UseCounter
https://www.chromestatus.com/metrics/feature/timeline/popularity/426
That's 0%, it's reached 0.0001% only 4 days so far.
Entry on chromestatus.com, crbug.com, or MDN
https://developer.mozilla.org/es/docs/DOM/CssRule#CSSCharsetRule (no real info)
Requesting approval to remove too?
Yes. Deprecating CSSCharsetRule.encoding is pointless because it's virtually unused, and warning about any access to CSSCharsetRule will have false positives when people iterate all rules. We can always revert if it doesn't work out.To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.