W3C home > Mailing lists > Public > www-style@w3.org > November 2014

Re: [css-scoping] should `::content` match both <content> and <shadow> insertion points?

From: Hayato Ito <hayato@google.com>
Date: Fri, 28 Nov 2014 04:52:16 +0000
Message-ID: <CAFpjS_1sCi5rZ=SJnr-08yVKqbjpqj-6k57nq-xYqV114xyXEg@mail.gmail.com>
To: Philip Walton <philip@philipwalton.com>, www-style list <www-style@w3.org>
This behavior should be considered correct.

The CSS Scoping module says:
> This specification does not define how to assign elements to a
distribution list, instead leaving that to the Shadow DOM spec. At the time
this spec is written, however, only content elements in a shadow tree can
have distribution lists.

However, in the current Shadow DOM spec, insertion points in general would
have a distribution list (defined as distributed nodes in the Shadow DOM
spec [1]).
Both content insertion points, <content>, and shadow insertion points,
<shadow>, are insertion points. Therefore, '::content' will affect
distributed nodes of shadow insertion points.

I agree that '::content' is confusing name. AFAIR, this naming was chosen
before I introduced the concept of distributed nodes strictly to the Shadow
DOM spec.

See also ISSUE5 in the
> ::content is a confusingly general name for something that is specific to
the projected content of a shadow tree.

[1] http://w3c.github.io/webcomponents/spec/shadow/#dfn-distributed-nodes

On Fri Nov 28 2014 at 3:11:34 AM Philip Walton <philip@philipwalton.com>

> I've been experimenting with various "inheritance" techniques using web
> components, and I encountered what I consider to be unexpected behavior in
> Chrome. Here's a jsbin example:
> http://jsbin.com/lonugosoxo/1/edit?html,output
> To summarize, I'm creating two shadow roots on an element. The younger
> shadow root contains a <shadow> insertion point and the older shadow root
> contains a <content> insertion point.
> In the younger shadow DOM I have a <style> defined as follows:
> :host::shadow ::content > * {
>   border: 1px solid;
>   margin: .5em;
>   padding: .5em;
> }
> Since there is only one <content> insertion point, and since the element
> in the main DOM only has one set of children, I'd expect this selector to
> only match the element's children in the main DOM, but as you can see from
> the example, it's also matching the <nav> element in the older shadow root
> (if you look at the example, I would have expected that only the links
> would have borders).
> If this behavior is considered correct, I'd argue it's confusing and maybe
> `::content` should have a different name, since insertion points can also
> be created with a <shadow> tag. If  this behavior is incorrect, well, I
> guess I'll report a bug.
Received on Friday, 28 November 2014 04:52:44 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:26 UTC