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] Add supportsText to StyleSheet and handle HTML <link media="supports()"> #9361

Closed
zcorpan opened this issue Sep 14, 2023 · 1 comment
Labels
cssom-1 Current Work HTML Requires coordination with HTML people

Comments

@zcorpan
Copy link
Member

zcorpan commented Sep 14, 2023

In whatwg/html#7658 by @mirisuzanne the media attribute for <link rel=stylesheet> is changed to take an import condition (rather than a media query list), but I think that requires changes to CSSOM to work:

For <link rel=stylesheet media=...> the media attribute is used in the CSSOM "create a CSS stylesheet" steps and a MediaList object gets created from the attribute's value, where that vaule is parsed as a media query list.

Meanwhile, for @import, the CSSImportRule interface has a supportsText attribute for the <supports-condition> part.

I think CSSOM needs to change to allow creating stylesheets with supports conditions, and changing the HTML media attribute needs to update both the MediaList's mediaText and the StyleSheet's supportsText. I'll file an issue for CSSOM.

(Maybe also CSSStyleSheetInit (options for constructable stylesheets) should support supports, but that's not blocking this PR.)

@zcorpan
Copy link
Member Author

zcorpan commented Sep 19, 2023

I guess this is a dup of #9087.

@zcorpan zcorpan closed this as completed Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cssom-1 Current Work HTML Requires coordination with HTML people
Projects
None yet
Development

No branches or pull requests

1 participant