For the BMP decoder we don't shutdown the decoder until we've decoded all the data, and we don't know that until SourceDataComplete() is called. If the decode worker decodes all the data before SourceDataComplete(), we won't do an UNTIL_SIZE decode and the decoder is shutdown asynchronously.
This is a problem because the RasterImage doesn't notice some errors until the decoder is shutdown, which means that we'll sometimes fire onload when we otherwise would have fired onerror. I believe that this discrepancy is the cause of the reftest failures in bug 721917.
Patch coming up shortly.
Created attachment 604684 [details] [diff] [review]
This changes UNTIL_SIZE decodes so that instead of returning early if the size is already known, we only skip the decoding loop. That way we'll check if decoding is finished and shutdown the decoder.
Don't forget to ask for review :)
Comment on attachment 604684 [details] [diff] [review]
Right, I forgot the review flag. I'm out of town for the week, so no need to rush on the review. I'll address any review comments and do some try runs when I return.
Pushed to try: https://tbpl.mozilla.org/?tree=Try&rev=f1667d464be7
Try run for f1667d464be7 is complete.
Detailed breakdown of the results available here:
Results (out of 224 total builds):
Builds (or logs if builds failed) available at:
Created attachment 609289 [details] [diff] [review]
patch for check-in [r=joe]