This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
We broke this (intermittently) and got noticed: https://bugzilla.mozilla.org/show_bug.cgi?id=869796 https://bugzilla.mozilla.org/show_bug.cgi?id=868834
*sad panda*
Okay, so what interface should we introduce here? http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-1780488922 is the original solution. I called it AttrList as it's clearly not a Map in the JavaScript sense. I removed the methods that did not seem needed, but maybe they are? interface AttrList { getter Attr (DOMString name); getter Attr item(unsigned long index); unsigned long length; } I guess because of the named getter adding ArrayClass would be problematic.
http://mxr.mozilla.org/mozilla-central/source/dom/webidl/MozNamedAttrMap.webidl note the ? after Attr in particular.
If the interface needs to stay, why bother changing the name?
You want to keep the name NamedNodeMap from DOM Level 3 Core?
I don't feel strongly about it, just curious. In order to determine which bits of the API need to stay I just sent this review for more use counters in Blink: https://codereview.chromium.org/211363003
Mainly since if we are keeping this API around and it is being exposed to the web, we might as well try to keep it somewhat sane.
Unfortunately it currently doesn't seem possibly to count access to the interface object itself (e.g. using x instanceof NamedNodeMap) so I can't tell if changing it is safe. It seems fairly likely to be safe, though. Anyway, the use counters have landed now, data will show up here: NamedNodeMapGetNamedItem: http://www.chromestatus.com/metrics/feature/timeline/popularity/306 NamedNodeMapSetNamedItem: http://www.chromestatus.com/metrics/feature/timeline/popularity/307 NamedNodeMapRemoveNamedItem: http://www.chromestatus.com/metrics/feature/timeline/popularity/308 NamedNodeMapItem: http://www.chromestatus.com/metrics/feature/timeline/popularity/309 NamedNodeMapGetNamedItemNS: http://www.chromestatus.com/metrics/feature/timeline/popularity/310 NamedNodeMapSetNamedItemNS: http://www.chromestatus.com/metrics/feature/timeline/popularity/311 NamedNodeMapRemoveNamedItemNS: http://www.chromestatus.com/metrics/feature/timeline/popularity/312
Philip, that seems encouraging. I added get/remove as well as their NS counterparts since we are stuck with namespaced attributes I think. I did not add the methods that deal with Attr objects since those would require a link between Attr objects and elements and that would be sad as you pointed out. https://github.com/whatwg/dom/commit/8af48267390b971a2ac02c7005ba42c08264b7e1 New issues in new bugs I guess.