Re: [csswg-drafts] [mediaqueries] Queries for image support (#656)

I remembered about this discussion following a twitter thread asking how to test for WebP support. Tim Petrusky [reports that](https://mobile.twitter.com/TimPietrusky/status/1150099543654109184) having to use JPEG instead of WebP for background images increases download size by 50%.  Bumping the thread to get some more attention on it.

For image _format_ support, there are two ways we could handle it:

- inside the [`image()` or `image-set()`](https://drafts.csswg.org/css-images-4/#image-set-notation) functions (if we get commitments to actually implement such things!)
- as a conditional @-rule, such as a media query or a special `@supports` rule syntax

For "did this particular content image (or other element linking an external resource) fail to load/parse correctly", I think standardizing the Mozilla broken image pseudo-class is valid.  We could also add a second pseudo for the "waiting to load" state, which becomes more important with native lazy loading.

For overall image / external resource download settings, I still think this makes the most sense as a media query.  But at least some use cases could be handled by the other features above.


-- 
GitHub Notification of comment by AmeliaBR
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/656#issuecomment-511143033 using your GitHub account

Received on Saturday, 13 July 2019 18:14:22 UTC