[dom] HTMLCollection.namedItem() vs supported property names (#104)

At the beginning, in supported property names  definition I see this:
"2.1. If element has an ID which is neither the empty string nor is in result, append element’s ID to result." << why this " empty string" exist here? We operate on ID (as concept, not attribute ID) so it's possible that ID will ever be empty string?

Second is about how this two definitions handle attribute name (for element in not HTML namespce), this is intentional? I see that Firefox and Chrome have different behaviour. In the middle I also try check IE11 but this browser has other problem (when we create element inside script it produces different results) so focus only Firefox and Chrome.

Firefox - works the same for HTMLCollection.namedItem() and [], treat all elements in the same way, without paying attention to the HTML namespace for element with name attribute.

Chrome - works the same for HTMLCollection.namedItem() and [], treat all elements in the same way, paying attention to the HTML namespace for element with name attribute.

And spec:
https://dom.spec.whatwg.org/#dom-htmlcollection-nameditem
HTMLCollection.namedItem()  - without paying attention to the HTML namespace for element with name attribute

https://dom.spec.whatwg.org/#dom-htmlcollection-item
Supported property names - paying attention to the HTML namespace for element with name attribute

It concerns only name attribute (content attribute), id attribute (content attribute) works correct in Firefox and Chrome (as we have in DOM).

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/104

Received on Thursday, 5 November 2015 00:11:37 UTC