W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2015

Re: [Shadow] Q: Removable shadows (and an idea for lightweight shadows)?

From: Justin Fagnani <justinfagnani@google.com>
Date: Thu, 26 Mar 2015 11:18:32 -0700
Message-ID: <CAEKsHmCQMt2X872DByR+6UrPk405x6sTp5SUmWwuhxtZqbF+0g@mail.gmail.com>
To: Travis Leithead <travis.leithead@microsoft.com>
Cc: "Dimitri Glazkov (dglazkov@google.com)" <dglazkov@google.com>, Arron Eicholz <arronei@microsoft.com>, "Anne van Kesteren (annevk@annevk.nl)" <annevk@annevk.nl>, Ryosuke Niwa <rniwa@apple.com>, WebApps WG <public-webapps@w3.org>
On Thu, Mar 26, 2015 at 10:53 AM, Travis Leithead <
travis.leithead@microsoft.com> wrote:

>  Hi folks,
> Today’s ShadowDOM model is designed around only adding shadow roots to
> element in the ‘light side’. I assume this is intentional, but was hoping
> someone could describe why this design was chosen? Or said another way, if
> there was an imperative API to _*remove*_ a shadow DOM, would that
> symmetry be bad?
> In full transparency, I’m thinking about potential solutions for a
> simplified shadow dom, and it occurs to me that it can’t get much simpler
> than the following:
> ·        Elements only [ever] have one “shadow side” which is essentially
> a secondary child node list. Whenever anything’s in this list the Element
> renders that content instead of its “light” children. (Or maybe there’s a
> switch to tell the element which side to render: light or dark?)
> ·        Elements expose this “shadow node list” via APIs that are very
> similar to existing node list management, e.g., appendShadowChild(),
> insertShadowBefore(), removeShadowChild(), replaceShadowChild(),
> shadowChildren[], shadowChildNodes[].
This part seems like a big step back to me. Shadow roots being actual nodes
means that existing code and knowledge work against them. The API surface
that you'd have to duplicate with shadow*() methods would be quite large.

 ·        No special Event swizzling, no security boundary, no alternate
> script engine, no intermediate shadow root object,  etc. This minimalist
> approach only provides node ‘hiding’ and potentially an alternate rendering
> path.
> ·        Another feature could then provide the stronger “component”
> boundary, specifically the javascript global scope isolation. This
> delineation may more closely match the division we are seeing between the
> “React-like” scenarios and more robust component-kitchen-style custom
> element deployments.
Received on Thursday, 26 March 2015 18:19:20 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:14:44 UTC