-
Notifications
You must be signed in to change notification settings - Fork 661
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
[css-images] Add a way to indicate that a CSS image should be decoded asynchronously #2095
Comments
Yeah, sounds reasonable to me. The first part of the image() function is already accepting some keywords, it's easy to cram more in there. |
If it makes sense for HTML, it also makes sense for CSS. For HTML content images, the assumption for default behavior is that they are important and should be decoded synchronously. For CSS styling images, the opposite assumption should be true, i.e. default to asynchronous decoding. |
But data-urls in CSS should be decoded synchronously by default. They are embedded in CSS for this reason. |
Related to #1088, which is about defining what blocks the load event and what doesn't. (At the moment, per spec, CSS images can be decoded async because the spec says nothing about what blocks the load event; I believe Edge doesn't block the load event on images in CSS.) |
I think FF does mostly async image decoding by default? @tnikkel may be able to correct me though. |
Similarly to how we're adding a way for authors to specify that content images should be able to be decoded asynchronously by the UA (whatwg/html#1920), we should add a way for authors to say that CSS images can be decoded async.
Async decoding here implies that there may be frames rendered after the time that the "load" event for an Image with the same URL as the CSS image in which the image does not appear.
This would probably be some kind of new argument to the
image()
function.The text was updated successfully, but these errors were encountered: