-
Notifications
You must be signed in to change notification settings - Fork 756
Description
See whatwg/html#7540 (comment) and following comments
I think if we want
supports()to apply to allmedia=""attributes, it should be part of MQ. But processing a media query list instead returns two booleans (supports result, MQ result), so that we can avoid fetching stylesheets where supports is false but do load them when supports is true (regardless of the MQ result).This would make
supports()consistently available (Linkheader, various HTML elements,@import,@media, constructable stylesheets options bag). Also makes the integration for HTML simpler, and less surgery needed in CSSOM. See w3c/csswg-drafts#9361Maybe the
supportsTextforCSSImportRulewouldn't be needed anymore if it's part of theMediaList.
@zcorpan what does that give you that renaming this to
<style-sheet-condition>or so and referencing that everywhere doesn't?With your proposal it feels rather weird to be able to do
@media supports(), and you'd need to track the "supports" result across the whole condition tree, which is a bit odd. So we'd need to convert the media query evaluation to track not only true/false/unknown as it does now, but something like always-true/always-false/true/false/unknown.To be clear, I think that's doable, but it's probably less straight-forward than the alternative?
I guess my main concern is consistency for web developers about where
supports()works, and how to expose it in the CSSOM. So maybe first we need to decide whether@media supports()should be a thing.