Primary eng (and PM) emails
Summary
Try and remove DOMStringList from the web platform, in favor of plain JS arrays of strings.
Motivation
DOMStringList was added to Speclandia in the fading days of the "DOM objects good, script objects bad!" regime, and picked up by a few specs, including Indexed DB. The sole motivation was as it says on the tin: return a list of strings from a DOM API. http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMStringList
Modern DOM API design would be to simply... wait for it... return a plain old JS array of strings. The interface was optimistically removed from the DOM living standard: https://dom.spec.whatwg.org/#dom-core
And use counters (see below) show a nontrivial usage. The obvious solution would be that we add contains to Array.prototype. Unfortunately, this turns out to not be web compatible: https://bugzilla.mozilla.org/show_bug.cgi?id=1075059 Instead, ES7 proposes Array.prototype.includes which is great but doesn't let us drop DOMStringList easily.
Here's the plan:
Also, while there's broad consensus among standards wonks that we should yoink DOMStringList, there's still some waffling over exactly how "return a JS array" would be specified for IDL readonly attributes: https://www.w3.org/Bugs/Public/show_bug.cgi?id=23682
Compatibility Risk
DOMStringList is supported by the whole gang: IE, Firefox, Safari and Chrome. We're not going to be able to remove this overnight. Standards discussion is here:
Alternative implementation suggestion for web developers
Usage information from UseCounter
https://www.chromestatus.com/metrics/feature/popularity#DOMStringListContains
https://www.chromestatus.com/metrics/feature/timeline/popularity/286... shows a usage around 0.01% of pages - and sadly trending *upwards*.
Entry on chromestatus.com, crbug.com, or MDN
Tracking bug: https://code.google.com/p/chromium/issues/detail?id=460726
Requesting approval to remove too?
Nope. This is going to take a while.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
The warnings are, of course, optimistic - if we can't drive usage down we'll do nasty things like have Indexed DB mint an ES6-style Array subclass with contains(), but we'd like to contain the nasty as much as possible.
On Sat, Jun 13, 2015 at 12:33 AM, 'Joshua Bell' via blink-dev <blin...@chromium.org> wrote:The warnings are, of course, optimistic - if we can't drive usage down we'll do nasty things like have Indexed DB mint an ES6-style Array subclass with contains(), but we'd like to contain the nasty as much as possible.Why is this so nasty?
looks good. The "bad" option of an ES6 subclass isn't that problematic (modulo Elliott's mutability question) should it come to that. Thanks for pushing this forward!