ImageLib decodes GIF, JPEG and PNG images, and provides the decoded data to the Compositor for display. If Firefox or Seamonkey can display an image when loaded separately from the page, ImageLib is working, and the actual imaging bug exists elsewhere within Firefox or Seamonkey.

It currently looks like animated images can be made into layers without too much (any?) work, but we need to make sure this is the case. In particular, GetCurrentImage() needs to be called to update the Image on the ImageContainer whenever the frame is changed by RequestRefresh() (which is itself called by the refresh driver).

The code for turning nsDisplayImage into an active layer definitely exists (and works last time I checked). I don't believe it has ever been used by default for anything though, so bugs likely exist.
We're using the equivalent path in nsDisplayBackgroundImage now, and hit a few issues when enabling that.

The problem that the reftest framework is running in to is that it thinks there's a draw pending (isMozAfterPaintPending is true) but one never comes. I presume this is because we've converted the Thebes layer into an Image layer before the draw has a chance to be cleared.
Matt, is this something we've ever had to deal with before?

Created attachment 755719[details][diff][review]
Recycle image layers instead of creating them every time
The paint events were happening, the problem was that they didn't *stop* happening.
Every time we built layers, we created a new ImageLayer, which DLBI picks up and sends a MozAfterPaint.
Reftest takes a new snapshot, which builds layers, and triggers another MozAfterPaint. Repeat forever.