W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2015

Re: Shadow DOM and SVG use elements

From: Elliott Sprehn <esprehn@chromium.org>
Date: Fri, 23 Oct 2015 13:05:33 -0700
Message-ID: <CAO9Q3iJSqexG0mcOboNTzRDzVn4r5e9ZQ8dereQvP9q+jBdTLg@mail.gmail.com>
To: Travis Leithead <travis.leithead@microsoft.com>
Cc: "rniwa@apple.com" <rniwa@apple.com>, "public-webapps@w3.org" <public-webapps@w3.org>
On Fri, Oct 23, 2015 at 12:42 PM, Travis Leithead <
travis.leithead@microsoft.com> wrote:

> Well, since SVG 'use' is mostly about replicating the composed tree
> anyway, it seems that is should probably render the composed tree--e.g.,
> this seems natural, because use would "replicate" the host element, which
> would then render it's shadow DOM.


The current implementation of <use> in Blink (and WebKit IIRC) is to
literally cloneNode the referenced content into a ShadowRoot off the <use>
element. Cloning the composed tree would change the way selectors in the
cloned tree matched by changing the shape and order of the tree. It also
means potentially cloning cousin elements of the used element which is
somewhat surprising. I'd be inclined to say all shadow roots inside the
used element are ignored, and all slots are inert.


> The interactivity behaviors associated with the shadow dom is an
> interesting question though.. today you are expected to attach event
> handlers to the ElementInstance (
> http://www.w3.org/TR/SVG/struct.html#InterfaceSVGElementInstance) which
> is the DOM representation of the "replicated" tree--I'm not sure what this
> would look like for Elements with an attached shadow.
>

The instance tree was removed in SVG2 I think, we certainly removed it from
Blink.

- E
Received on Friday, 23 October 2015 20:06:42 UTC

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