This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/edits.html Multipage: http://www.whatwg.org/C#img-determine-type Complete: http://www.whatwg.org/c#img-determine-type Referrer: http://www.whatwg.org/specs/web-apps/current-work/multipage/ Comment: <img> When to swap the image for the environment changes case "wait for the fetch algorithm to queue its last task" means we wait until the whole image has been downloaded, then swap. * Do we want to swap if the image is in a supported format but is broken? * Do we want to wait until the image has been decoded? (fully or partially?) * Do we want to swap before the image has been completely downloaded (like dynamically changing "src" swaps when dimensions are known)? Posted from: 90.230.218.37 by simonp@opera.com User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.86 Safari/537.36 OPR/22.0.1471.16 (Edition Next)
IMHO you never want to switch to a broken image if you have a working one. Lower or higher resolution that ideal, or wrong aspect ratio or whatever, is better than nothing. You could swap if you have an incrementally-loading JPEG and you've already decoded enough of it that you're at the resolution that is currently being rendered or better. However, I wouldn't swap if you just have half a sequentially encoded PNG, say. That would look ugly.
Maybe the spec should invoke "update the image data" with a special flag that avoids destroying the image and avoids firing error event, in the environment changes case, instead of having its own algorithm? Possibly also delay upgrading pending request to current request so that it doesn't regress image quality while the new image is loading.
Maybe for 'x' and 'w' you want to wait until you have at least the same quality as the old image (if progressive, otherwise wait until completely available), but for art direction you want to swap when you have dimensions. The spec could leave it up to the UA when to do the swap for the environment changes case.
Even for art cases, it's better to wait til you have enough data to not be more ugly. Ideally you'd even cross-fade between them, rather than jump cut.
https://github.com/ResponsiveImagesCG/picture-element/commit/c798686911c2bf9334899ac44e0e4a11fa000b19 Leaving open since this might need more tweaks still.
https://github.com/whatwg/html/issues/3709