Re: [Shadow DOM] Simplifying level 1 of Shadow DOM

My proposal is to allow for multiple insertion points, and use
selectors to filter the insertion points.

However restrict the set of selectors such that only an elements
intrinsic state affects which insertion point it is inserted in. I.e.
only an elements name, attributes and possibly a few states like
:target and :visited affects which insertion point it is inserted
into.

That way when an element is inserted or modified, you don't have to
worry about having to check any descendants or any siblings to see if
the selectors that they match suddenly changed.

Only when the attributes on an element changes do you have to re-test
which insertion point it should be inserted into. And then you only
have to recheck the node itself, no siblings or other nodes. And you
only have to do so if the parent has a binding.

/ Jonas

On Wed, May 1, 2013 at 11:49 AM, Ryosuke Niwa <rniwa@apple.com> wrote:
> On Apr 30, 2013, at 12:07 PM, Daniel Freedman <dfreedm@google.com> wrote:
>
>> I'm concerned that if the spec shipped as you described, that it would not be useful enough to developers to bother using it at all.
>
> I'm concerned that we can never ship this feature due to the performance penalties it imposes.
>
>> Without useful redistributions, authors can't use composition of web components very well without scripting.
>> At that point, it's not much better than just leaving it all in the document tree.
>
> I don't think having to inspect the light DOM manually is terrible, and we had been using shadow DOM to implement textarea, input, and other elements years before we introduced node redistributions.
>
> On May 1, 2013, at 8:57 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
>
>> It's difficult to understand without working through examples
>> yourself, but removing these abilities does not make Shadow DOM
>> simpler, it just makes it much, much weaker.
>
> It does make shadow DOM significantly simpler at least in the areas we're concerned about.
>
> - R. Niwa
>
>

Received on Wednesday, 1 May 2013 19:38:12 UTC