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 12:33:06 -0700
Message-ID: <CABNRm63OyP18XAP2_pDbb+CUGAdkzznJZs33SyzWJfHit-ZQHQ@mail.gmail.com>
To: Elliott Sprehn <esprehn@gmail.com>
Cc: www-dom <www-dom@w3.org>
On Fri, Jun 29, 2012 at 12:28 PM, Elliott Sprehn <esprehn@gmail.com> wrote:

> On Fri, Jun 29, 2012 at 11:47 AM, Ryosuke Niwa <rniwa@webkit.org> wrote:
>
>> ...
>> Then I'm opposed to adding this on DocumentFragment. Like mutation
>> events, live node lists and HTMLCollection are two of the worst APIs. We've
>> got rid of mutation events in shadow DOM in the favor of mutation
>> observers. We should do the same so that we don't expose any live node
>> lists or HTMLCollection inside the shadow DOM. Over time, authors will
>> learn to use methods that return static node lists.
>>
>
> So then we should remove them from ShadowRoot too? I don't see a reason
> that ShadowRoot should be a special DocumentFragment.
>

Yes. I'm surprised that ShadowRoot has these methods exposed to the Web. We
can't expose querySelector on DocumentFragment because fragment doesn't
have the view but for shadow ROM, exposing querySelector instead of
getElementsBy* makes a lot of sense.

- Ryosuke
Received on Friday, 29 June 2012 19:33:53 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 29 June 2012 19:33:59 GMT