Re: [whatwg] Proposal: Adding methods like getElementById and getElementsByTagName to DocumentFragments

On Fri, Jun 28, 2013 at 9:19 PM, Zirak A <> wrote:
> Currently, a DocumentFragment only inherits from Node, and thus loses methods like getElementById. However, the Selector API ( defines querySelector and querySelectorAll on document fragments.
> My proposal is to add getElementById (which makes sense, as the document fragment is a root node), getElementsByTagName (and its namespace-sensitive version), getElementsByClassName and getElementsByName - in short, all of the general selection methods available on the Document.

Per this is the wrong forum for DOM.

Having said that, our current plan is to rely on the Selectors API (2)
and slowly move away from getElement* friends over time, as their
return values are less than optimal. getElementById is an exception to
this, but the hope is that .querySelector("#test") will be fast
enough. If it turns out to be a problem, we should re-evaluate at that
point. Concrete suggestions for new traversal APIs should be discussed
on or the DOM bug database until we decide the more
appropriate forum is here, it'd be unfair to the existing community

If you think I should reply to any of the remainder of this thread
please let me know, but I hope this general answer is sufficient.


Received on Thursday, 5 September 2013 10:03:12 UTC