W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2012

Re: Support getElementById and other methods of ShadowRoot on DocumentFragment

From: Ryosuke Niwa <rniwa@webkit.org>
Date: Fri, 29 Jun 2012 11:18:05 -0700
Message-ID: <CABNRm62ZC+2rqp_sg7iw=PdsCtctQRRUTDJW=z+we5PGSKqkPA@mail.gmail.com>
To: Elliott Sprehn <esprehn@gmail.com>
Cc: www-dom <www-dom@w3.org>
Are you suggesting that getElementsBy* on ShadowRoot will return a static
node list? If so, that's inconsistent with the existing ones. If not, then
getElementsBy* return HTMLCollection, and I'm strongly opposed to adding
any new method that returns live node list or HTMLCollection. They impose
significant performance burdens and design constraints on all DOM mutations.
On Jun 29, 2012 11:05 AM, "Elliott Sprehn" <esprehn@gmail.com> wrote:

> DocumentFragment has querySelector and friends, but doesn't have
> getElementById or getElementByClass etc. Because of this the methods were
> explicitly added to ShadowRoot which seems kind of silly. There's also
> innerHTML on ShadowRoot but not on DocumentFragment.
>
>
> https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#shadow-root-object
>
> Could we get these methods added to DocumentFragment instead?
>
>  HTMLElement getElementById(in DOMString elementId);
>  NodeList getElementsByClassName(in DOMString tagName);
>  NodeList getElementsByTagName(in DOMString className);
>  NodeList getElementsByTagNameNS(DOMString namespace, DOMString localName);
>  attribute DOMString innerHTML;
>
> - Elliott
>
Received on Friday, 29 June 2012 18:18:33 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 29 June 2012 18:18:39 GMT