Last Comment Bug 739457 - Images loaded into background tabs are decoded immediately
: Images loaded into background tabs are decoded immediately
Product: Core
Classification: Components
Component: ImageLib (show other bugs)
: unspecified
: All All
-- normal (vote)
: mozilla14
Assigned To: Justin Lebar (not reading bugmail)
: Milan Sreckovic [:milan]
Depends on: 512435
  Show dependency treegraph
Reported: 2012-03-26 16:09 PDT by Justin Lebar (not reading bugmail)
Modified: 2015-08-07 03:42 PDT (History)
6 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Patch v1 (3.19 KB, patch)
2012-03-26 17:26 PDT, Justin Lebar (not reading bugmail)
joe: review+
Details | Diff | Splinter Review

Description User image Justin Lebar (not reading bugmail) 2012-03-26 16:09:16 PDT
I thought setting decodeondraw = true was supposed to make us wait until a tab is focused before we decode its images, but either that's wrong, or it's broken.

Either way, this is particularly problematic now that we have a cap on the amount of decoded image data we'll keep around, because we can end up in the case where we load a background tab, decode all its images, and then immediately throw those images away, because we don't have space for them!
Comment 1 User image Justin Lebar (not reading bugmail) 2012-03-26 17:26:48 PDT
Created attachment 609548 [details] [diff] [review]
Patch v1
Comment 2 User image Joe Drew (not getting mail) 2012-03-26 17:35:14 PDT
Comment on attachment 609548 [details] [diff] [review]
Patch v1

I'm not convinced that putting it into a single if statement is actually better for readability, but it's not a big deal.
Comment 3 User image Justin Lebar (not reading bugmail) 2012-03-27 00:40:10 PDT
Comment 4 User image Ed Morley [:emorley] 2012-03-28 14:26:40 PDT
Comment 5 User image Timothy Nikkel (:tnikkel) 2012-03-28 16:42:20 PDT
the presshell->IsVisible() check will work for hidden tabs, but it will also report that iframes that have an ancestor with CSS visibility: hidden as not visible. I'm not sure if that is desirable or not.

Also, you might want to also check IsActive on the presshell, I think that now returns false for foreground tabs in minimized windows (which is not covered by IsVisible). Or you might not want to.
Comment 6 User image Justin Lebar (not reading bugmail) 2012-03-29 12:05:26 PDT
It sounds like IsVisible is at least sensible here.
Comment 7 User image Timothy Nikkel (:tnikkel) 2012-03-29 12:06:58 PDT
Yeah, I just added those comments in case IsVisible wasn't doing what you expected. But it sounds like it is.

Note You need to log in before you can comment on or make changes to this bug.