Implement <img decode="sync|async">

NEW
Unassigned

Status

()

Core
ImageLib
P3
normal
12 days ago
9 days ago

People

(Reporter: dholbert, Unassigned)

Tracking

({dev-doc-needed})

Trunk
dev-doc-needed
Points:
---

Firefox Tracking Flags

(firefox57 wontfix, firefox58 affected)

Details

See https://github.com/whatwg/html/issues/1920#issuecomment-343319890

Not specced yet, but likely will be soon. We should consider implementing <img decode="sync"> to force sync decoding (when or before we paint).  See the backscroll on that github issue for more.
A bit more rough backround here:
For an <img> with decode=sync, the expectation would be: when the <img> load event fires (say, for a dynamically-created <img> element), the author can immediately insert the <img> into the document and expect that we will be able to paint it on the next frame (which might mean we have to decode it synchronously during that paint, and that might cause a bit of jank or checkerboarding if it's slow to decode -- and that's OK, because that's what the author is asking for).

I forget exactly how our image-decoding currently works, but I don't think we make that guarantee right now.

On the other hand: decode="async" would be a hint that we do *not* need to decode as aggressively. That might be a no-op (matching our default behavior) right now --- I'm not sure.
Keywords: dev-doc-needed
status-firefox57: --- → wontfix
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.