-
Notifications
You must be signed in to change notification settings - Fork 35
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
“Effective size” error handling #127
Comments
We can't wait for layout, that's incompatible with the goal of enabling early load of images. We want to be able to load images in the pre-scanner even. That said, I'm not sure I like the 300px default. If the sizes attribute is absent we could let the effective size be "error" and drop candidates with missing density descriptors on the floor. It's an authoring error to do |
If/when there's a way to explicitly mark up an image as something you want loaded later (lazy loading), it would be nice to be able to mark it up in a layout-agnostic way. But yeah, error-handling that would also apply to images that hadn't been marked as lazy-loaded probably isn't the way to do it. Falling back to |
Thinking about it some more, we could change the default to 100% instead of 300px. That seems like a useful default. |
Change the fallback value of sizes from 300px to 100%. Fixes #127
Right now if we can’t determine an ‘effective size’ we return 300px.
(Presumably, if #86 sees implementation, there will be an effective box size of 300 × 150 — the default size for replaced elements).
Could we instead wait for layout, figure out what the rendered size of a source with infinite pixel dimensions would be, and use that as an effective size?
This seems like it would produce the expected results in cases where authors use media queries which the browser can't parse, improving backwards compatibility for e.g. the new media query syntax.
It also complicates implementation and might hide authoring errors.
One additional benefit: authors could leave off the
sizes
attribute intentionally in cases where they don’t care about preloading, e.g. forpostpone
d images.The text was updated successfully, but these errors were encountered: