CSSOM: ignore title attributes on style elements in shadow trees #391

Closed
ghost opened this Issue Feb 22, 2016 · 12 comments

Comments

Projects
None yet
4 participants
@ghost

ghost commented Feb 22, 2016

Style elements inside a shadow tree should not be able to set the preferred stylesheet set for the document. Also, style elements inside a shadow tree should still be applied if it has a title element not matching the preferred stylesheet set of the top document.

https://lists.w3.org/Archives/Public/public-webapps/2015OctDec/0223.html

@rniwa rniwa added the shadow-dom label Feb 22, 2016

@rniwa

This comment has been minimized.

Show comment
Hide comment
@rniwa

rniwa Feb 22, 2016

Contributor

What's the point of doing this change? I'd rather not diverge the behavior of various elements inside shadow DOM as much as possible.

Contributor

rniwa commented Feb 22, 2016

What's the point of doing this change? I'd rather not diverge the behavior of various elements inside shadow DOM as much as possible.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Feb 22, 2016

If you have:

<link rel="alternate stylesheet" title="mystyle" href="...">
<custom-component></custom-component>

and <custom-component> has a <style title="mystyle"> inside its shadow tree, it will set mystyle as the preferred set and enable the alternate stylesheet in the document tree.

From 7.1:

"At the same time, it is an encapsulation abstraction, so it has to avoid affecting the document tree."

Is there something in the spec already that would cover this case?

ghost commented Feb 22, 2016

If you have:

<link rel="alternate stylesheet" title="mystyle" href="...">
<custom-component></custom-component>

and <custom-component> has a <style title="mystyle"> inside its shadow tree, it will set mystyle as the preferred set and enable the alternate stylesheet in the document tree.

From 7.1:

"At the same time, it is an encapsulation abstraction, so it has to avoid affecting the document tree."

Is there something in the spec already that would cover this case?

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Feb 22, 2016

Setting the preferred stylesheet set is defined in https://drafts.csswg.org/cssom/#add-a-css-style-sheet which talks about "document CSS style sheets" which are the ones reflected in document.styleSheets, which shadow dom style elements are not part of. Perhaps that's enough evidence that shadow dom style title should not set the preferred set, at least?

ghost commented Feb 22, 2016

Setting the preferred stylesheet set is defined in https://drafts.csswg.org/cssom/#add-a-css-style-sheet which talks about "document CSS style sheets" which are the ones reflected in document.styleSheets, which shadow dom style elements are not part of. Perhaps that's enough evidence that shadow dom style title should not set the preferred set, at least?

@hayatoito

This comment has been minimized.

Show comment
Hide comment
@hayatoito

hayatoito Feb 24, 2016

Member

Yeah, although the spec should not mention it clearly, we should honor an encapsulation here.

This should be one of the instances which we should use the label html-dom so that we do not forget this issue in upstreaming Shadow DOM into HTML/DOM Standard.

Member

hayatoito commented Feb 24, 2016

Yeah, although the spec should not mention it clearly, we should honor an encapsulation here.

This should be one of the instances which we should use the label html-dom so that we do not forget this issue in upstreaming Shadow DOM into HTML/DOM Standard.

@hayatoito hayatoito added the html-dom label Feb 24, 2016

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Feb 29, 2016

FWIW, the Blink issue is https://crbug.com/588718 which is now fixed.

ghost commented Feb 29, 2016

FWIW, the Blink issue is https://crbug.com/588718 which is now fixed.

@annevk

This comment has been minimized.

Show comment
Hide comment
@annevk

annevk Feb 29, 2016

Member

This should really be fixed in the CSSOM specification I think once we have the terminology in place. Paging @zcorpan.

Member

annevk commented Feb 29, 2016

This should really be fixed in the CSSOM specification I think once we have the terminology in place. Paging @zcorpan.

@annevk

This comment has been minimized.

Show comment
Hide comment
@annevk

annevk Feb 29, 2016

Member

Or maybe this is still defined in HTML? Hmm.

Member

annevk commented Feb 29, 2016

Or maybe this is still defined in HTML? Hmm.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Feb 29, 2016

It's specified in the CSSOM spec, and as I wrote earlier, you can sort of deduce that this shouldn't apply to shadow dom stylesheets, but I don't think it was written with shadow dom in mind.

ghost commented Feb 29, 2016

It's specified in the CSSOM spec, and as I wrote earlier, you can sort of deduce that this shouldn't apply to shadow dom stylesheets, but I don't think it was written with shadow dom in mind.

@annevk

This comment has been minimized.

Show comment
Hide comment
@annevk

annevk Feb 29, 2016

Member

We should still update it to account for stylesheets within the Shadow DOM, no?

Member

annevk commented Feb 29, 2016

We should still update it to account for stylesheets within the Shadow DOM, no?

@rniwa

This comment has been minimized.

Show comment
Hide comment
@rniwa

rniwa Feb 29, 2016

Contributor

I think it would be still useful to clarify it in the shadow DOM spec.

Contributor

rniwa commented Feb 29, 2016

I think it would be still useful to clarify it in the shadow DOM spec.

@rniwa rniwa added the v1 label Feb 29, 2016

@hayatoito

This comment has been minimized.

Show comment
Hide comment
@hayatoito

hayatoito Mar 1, 2016

Member

Yeah, let me have another section for clarification, mentioning misc. such as script, iframe, title attributes of style and so on, as a tentative clarification before upstreaming.

Member

hayatoito commented Mar 1, 2016

Yeah, let me have another section for clarification, mentioning misc. such as script, iframe, title attributes of style and so on, as a tentative clarification before upstreaming.

@zcorpan

This comment has been minimized.

Show comment
Hide comment

@annevk annevk changed the title from Ignore title attributes on style elements in shadow trees to CSSOM: ignore title attributes on style elements in shadow trees Mar 28, 2016

@hayatoito hayatoito closed this in 08793be Apr 8, 2016

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