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

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

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

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

ghost opened this issue Feb 22, 2016 · 12 comments

Comments

@ghost
Copy link

@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
Copy link
Contributor

@rniwa 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
Copy link
Author

@ghost 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
Copy link
Author

@ghost 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
Copy link
Member

@hayatoito 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
Copy link
Author

@ghost ghost commented Feb 29, 2016

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

@annevk
Copy link
Member

@annevk 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
Copy link
Member

@annevk annevk commented Feb 29, 2016

Or maybe this is still defined in HTML? Hmm.

@ghost
Copy link
Author

@ghost 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
Copy link
Member

@annevk annevk commented Feb 29, 2016

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

@rniwa
Copy link
Contributor

@rniwa 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
Copy link
Member

@hayatoito 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
Copy link
Member

@zcorpan zcorpan commented Mar 1, 2016

@annevk annevk changed the title Ignore title attributes on style elements in shadow trees 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.