This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
https://dom.spec.whatwg.org/#collections:-elements [[ Elements is an ES6-style subclass of Array with two additional methods. It's the new NodeList / HTMLCollection. ]] How can a class named "Elements" legitimately replace the NodeList interface, when, in additions to Elements, a NodeList can also contain Text nodes and Comments etc? There are comments throughout the spec about "historical artifacts" that "we cannot rid the web of" and yet this seems like another one in the making...
The Elements class is for those functions that actually return only elements, like querySelectorAll and .childElements, etc.
It's interesting to consider whether perhaps we should give it a different name so it can in the future also be used for cases where we want to represent more than elements. Or whether we should restrict it to elements as the name suggests now... (And add a distinct class for nodes.)
If we need to represent nodes the methods don't make sense. We'd just use a simple Array for those cases. I did clarify the statement a bit to make that more clear: https://github.com/whatwg/dom/commit/96ef454f2f3326cf95b878b783a16a2dee16d4d3 Thanks for your input!