-
Notifications
You must be signed in to change notification settings - Fork 378
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
Ignore title attributes on <link rel=stylesheet> in shadow trees #535
Comments
I spent some time learning about this and agree with @hayatoito and @rune-opera that we should ignore title attributes for stylesheet links inside a shadow tree. The reasoning is basically the same as was decided (before my time, in #391) for style elements. The title attribute has a global affect on the document, both in terms of adding to the list of named stylesheets and in terms of changing some defaults and preventing some other stylesheets from applying. It would be better to avoid this global affect from components that are supposed to be encapsulated. I put together https://ns-jmzlbrrfkc.now.sh/ as a demo page for anyone else who would like help understanding how the title attribute works in combination with alternate. In Firefox you can switch between style sheets using the menu, View, Page Style. I hope we can get consensus on this quickly (@smaug----, @travisleithead, @rniwa). It might be a bit tricky to spec rigorously until we first straighten out whatwg/html#848, but if everyone is agreed we can record consensus here or maybe just with a non-rigorous line in the shadow DOM spec. |
Yeah, ignoring |
yes, ignoring sounds good. |
I suppose when HTML says to "Create a CSS style sheet" (for both |
Yeah, that is probably the easiest. And we should test that StyleSheet.prototype.title returns null. |
Sounds good to me because StyleSheet.prototype.title is a read only attribute. |
In #530, we have not discussed anything about how
title=
attribute should be treated in<link rel="stylesheet">
. Yeah, that's our mistake. :)I would like to have a consensus on the behavior here before proceeding this code review further.
My proposal is that we ignore
title=
attribute completely, as we did that for<style>
elements in #391.Note that the difference between
<style>
and<link>
here is that<link>
can specify alternative stylesheet byrel=alternate
. See https://developer.mozilla.org/en-US/docs/Web/CSS/Alternative_style_sheets for general information about alternative style sheets.The proposal is effectively making:
behave as:
See https://codereview.chromium.org/2177163002#msg52 for the rationale. I agree with @rune-opera 's rational there.
The text was updated successfully, but these errors were encountered: