W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2013

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 28 Jun 2013 15:51:47 -0700
Message-ID: <CAAWBYDDi9s9+6v3RQfugDR=nRXrtV=7xZUBuFcMxUiU1+wN-cQ@mail.gmail.com>
To: Zirak A <zirak@mail.com>
Cc: WHATWG <whatwg@lists.whatwg.org>
On Fri, Jun 28, 2013 at 2:28 PM, Zirak A <zirak@mail.com> wrote:
> Because they may result in the same thing, but they have different semantic
> meanings. I want to get an element by its id, not run a CSS selector. I want
> to get elements by their tag names, not run a CSS selector.

There's no semantic difference between the methods.  querySelector is
simply a more powerful querying function than the old DOM methods,
capable of doing everything the old methods did and much more.

> Besides my personal aversion towards selectors being in the DOM API, there's
> also the simple fact that it makes sense for document fragments to have these
> methods.

That's far from obvious, given that I don't think it makes sense to
spread those obsolete methods around any further.

~TJ
Received on Friday, 28 June 2013 22:52:31 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:22 UTC