Make thumbnail image decoding async
authorGilles Dubuc <gilles@wikimedia.org>
Thu, 20 Dec 2018 10:02:39 +0000 (11:02 +0100)
committerGilles Dubuc <gilles@wikimedia.org>
Thu, 20 Dec 2018 12:20:54 +0000 (13:20 +0100)
commit4a79eefc78e6c9c782bf946b8be01803734f0635
tree9fcd3b6635d6b14db761db1386fefcecc1151077
parentf2d4db9d03a984d998db9044e63e548597511eb6
Make thumbnail image decoding async

This is a browser hint indicating that decoding of the image can be done
asynchronously (instead of synchronously during the image's onload event).
Marking decoding as async enables the browser to display any other
non-image content that might be waiting to be rendered, without waiting
for the image to be decoding. This should allow text to appear sooner in
some situations, where the browser would have otherwise waited to
bundle its rendering with an image. The final result (non-image + image
content being displayed) will happen at the same time as before.

Given how text-heavy wiki context usually is, it makes sense to allow
users to see the text sooner in some situations, so they can start reading.

https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/decoding
https://html.spec.whatwg.org/multipage/images.html#decoding-images

Bug: T212124
Change-Id: I3d738eba016bad486194f032a47ac6312f61c34e
includes/media/MediaTransformOutput.php
tests/parser/parserTests.txt