Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Shadow]: Should insertion point nodes have styles? (bugzilla: 17591) #250

Closed
hayatoito opened this issue Jul 6, 2015 · 1 comment
Closed

Comments

@hayatoito
Copy link
Contributor

Title: [Shadow]: Should insertion point nodes have styles? (bugzilla: 17591)

Migrated from: https://www.w3.org/Bugs/Public/show_bug.cgi?id=17591


comment: 0
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=17591#c0
Takashi Sakamoto wrote on 2012-06-25 05:56:55 +0000.

According to the shadow dom spec: http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#styles, insertion point nodes have styles:

  • the styles of the insertion point node are inherited by those child nodes of the shadow host that are assigned to this insertion point
  • the styles of the shadow insertion point node are inherited by the child nodes of the shadow root of the shadow DOM subtree, distributed to this shadow insertion point

I think, this behavior looks natural for web developers.

However, the spec also says:
"To enable composition of shadow host's children and the shadow DOM subtree, a notion of insertion points is added to the abstraction. An insertion point is a defined location in the shadow DOM subtree, to which the shadow host's children are transposed when rendering."
in http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#shadow-dom-subtrees

So no insertion point nodes appear in a composed tree. If insertion point nodes have styles and the styles are inherited by distributed nodes, styles of nodes, which are not in a composed tree, will affect rendering result. I think, it looks a little odd.

The following is an example:

This is an example.

And a shadow root is attached to the div and the shadow root's innerHTML is:

!!!! !!!!

What color is the text: "This is an example."?


comment: 1
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=17591#c1
Dimitri Glazkov wrote on 2012-06-25 16:16:08 +0000.

(In reply to comment #0)

According to the shadow dom spec:
http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#styles,
insertion point nodes have styles:

  • the styles of the insertion point node are inherited by those child nodes of
    the shadow host that are assigned to this insertion point
  • the styles of the shadow insertion point node are inherited by the child
    nodes of the shadow root of the shadow DOM subtree, distributed to this shadow
    insertion point

I think there's a bug in spec here. What we need to convey is that the styles of the parent of the insertion point are inherited.

I think, this behavior looks natural for web developers.

However, the spec also says:
"To enable composition of shadow host's children and the shadow DOM subtree, a
notion of insertion points is added to the abstraction. An insertion point is a
defined location in the shadow DOM subtree, to which the shadow host's children
are transposed when rendering."
in
http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#shadow-dom-subtrees

So no insertion point nodes appear in a composed tree. If insertion point nodes
have styles and the styles are inherited by distributed nodes, styles of nodes,
which are not in a composed tree, will affect rendering result. I think, it
looks a little odd.

Right.

The following is an example:

This is an example.

And a shadow root is attached to the div and the shadow root's innerHTML is:

!!!! !!!!

What color is the text: "This is an example."?

The color should be whatever the color of

in the shadow DOM subtree is. style="color:red" is not used.

However, we could consider that a element does have styles, but has the initial style of display:contents and thus is not rendered. If the developer chooses to surface the element, they could give it a different "display" value. This seems more flexible and less magical. However, we need to have "display:contents" spec'd in CSS first.

Bug 16294 is related to this.


comment: 2
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=17591#c2
Takashi Sakamoto wrote on 2012-06-26 10:54:10 +0000.

Thank you for answering.

(In reply to comment #1)

(In reply to comment #0)

According to the shadow dom spec:
http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#styles,
insertion point nodes have styles:

  • the styles of the insertion point node are inherited by those child nodes of
    the shadow host that are assigned to this insertion point
  • the styles of the shadow insertion point node are inherited by the child
    nodes of the shadow root of the shadow DOM subtree, distributed to this shadow
    insertion point

I think there's a bug in spec here. What we need to convey is that the styles
of the parent of the insertion point are inherited.

I see.

I think, this behavior looks natural for web developers.

However, the spec also says:
"To enable composition of shadow host's children and the shadow DOM subtree, a
notion of insertion points is added to the abstraction. An insertion point is a
defined location in the shadow DOM subtree, to which the shadow host's children
are transposed when rendering."
in
http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#shadow-dom-subtrees

So no insertion point nodes appear in a composed tree. If insertion point nodes
have styles and the styles are inherited by distributed nodes, styles of nodes,
which are not in a composed tree, will affect rendering result. I think, it
looks a little odd.

Right.

The following is an example:

This is an example.

And a shadow root is attached to the div and the shadow root's innerHTML is:

!!!! !!!!

What color is the text: "This is an example."?

The color should be whatever the color of

in the shadow DOM subtree is.
style="color:red" is not used.

I see. The color of

, the parent of the insertion point node, is applied.

However, we could consider that a element does have styles, but has
the initial style of display:contents and thus is not rendered. If the
developer chooses to surface the element, they could give it a
different "display" value. This seems more flexible and less magical. However,
we need to have "display:contents" spec'd in CSS first.

Bug 16294 is related to this.

I will look at the bug.

Best regards,
Takashi Sakamoto

@hayatoito
Copy link
Contributor Author

Let me close this bug since the current spec explicitly says that the insertion points must not create any CSS box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant