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

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


I'm surprised to hear you say this. The complexity of the DOM and CSS
styling that moden web applications demand is mind numbing.
Having to create possibly hundreds of unique CSS selectors applied to
possibly thousands of DOM nodes, hoping that no properties conflict, and
that no bizarre corner cases arise as nodes move in and out of the document.

Inspecting that DOM is a nightmare.

Just looking at Twitter, a Tweet UI element is very complicated.
It seems like they embed parts of the UI into data attributes (like
data-expanded-footer).
That to me looks like a prime candidate for placement in a ShadowRoot.
The nested structure of it also suggests that they would benefit from node
distribution through composition.

That's why ShadowDOM is so important. It has the ability to scope
complexity into things that normal web developers can understand, compose,
and reuse.


> , and we had been using shadow DOM to implement textarea, input, and other
> elements years before we introduced node redistributions.
>

Things like <input> and <textarea> are trivial compared to a youtube video
player, or a threaded email list with reply buttons and formatting toolbars.
These are the real candidates for ShadowDOM: the UI controls that are
complicated.


>
> 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:47:21 UTC