Closed
Bug 683290
Opened 13 years ago
Closed 12 years ago
We won't discard any images on the current tab even if they are not in the DOM
Categories
(Core :: Graphics: ImageLib, defect)
Core
Graphics: ImageLib
Tracking
()
People
(Reporter: jrmuizel, Assigned: khuey)
References
(Blocks 1 open bug)
Details
(Whiteboard: [MemShrink:P2])
Attachments
(2 files, 4 obsolete files)
1.51 KB,
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
32.14 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
Chrome and Safari will discard in this case. We should too. This situation can occur on things like facebook slideshows.
Reporter | ||
Updated•13 years ago
|
Blocks: image-suck
Assignee | ||
Updated•13 years ago
|
Assignee: nobody → khuey
Assignee | ||
Comment 1•13 years ago
|
||
This builds on the patch in Bug 684919 which adds COMPtrWithFlag<T>, which acts mostly like nsCOMPtr<T> with a flag bit. The API might change in that bug, so this may end up looking a bit different. The flag bit is used to store whether or not the image should be tracked. Then we add a BindToTree/UnbindFromTree implementation that registers/unregisters the image with the document depending on the value of that flag.
Attachment #558801 -
Flags: review?
Assignee | ||
Updated•13 years ago
|
Attachment #558801 -
Flags: review? → review?(jmuizelaar)
Assignee | ||
Comment 2•13 years ago
|
||
Comment on attachment 558801 [details] [diff] [review] Patch Joe says this should be reviewed by a content person.
Attachment #558801 -
Flags: review?(jmuizelaar) → review?(bzbarsky)
Comment 3•13 years ago
|
||
Comment on attachment 558801 [details] [diff] [review] Patch Review of attachment 558801 [details] [diff] [review]: ----------------------------------------------------------------- ::: content/base/src/nsImageLoadingContent.cpp @@ +329,5 @@ > > // We can only do this if we have a presshell > + // XXXkhuey should this be GetOurCurrentDocument? Decoding if we're not in > + // the document seems silly. > + nsIDocument* doc = GetOurOwnerDocument(); When do we have an owner document but not a current document? (This is one of the reasons I want a content person to review this. ;) ) @@ +845,5 @@ > + // XXXkhuey this is an incredibly nasty hack, but because cloning notifies > + // synchronously, we can't use a temporary nsCOMPtr here (we'll assert to > + // death in OnStopDecode). Note that the reference on the outparameter > + // is owned by the RequestWithState, so this is not leaky, even though it > + // looks like it might be. Bug 580466 shall save us! Can you note in that bug so whoever fixes it knows to fix this too?
Comment 4•13 years ago
|
||
Comment on attachment 558801 [details] [diff] [review] Patch Canceling review request for now per irc discussion. Specifically: 1) We're going to add a getter_AddRefs that takes a RequestWithState (or generally a COMPtrAndFlag, I would think). 2) Kyle will test whether this gets us flicker on image-swapping tests and if so how to deal with that.
Updated•13 years ago
|
Attachment #558801 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 5•13 years ago
|
||
Attachment #558801 -
Attachment is obsolete: true
Assignee | ||
Comment 6•13 years ago
|
||
The attached patch addresses point #1 from comment 4. I've verified that we can get flicker (asynchronous decoding) with this patch, so that remains an issue.
Assignee | ||
Comment 7•13 years ago
|
||
Comment on attachment 558922 [details] [diff] [review] Patch We discussed a possible bandaid for flickering issues on IRC, which is to do some amount of decoding synchronously in RasterImage::RequestDecode, and then do the rest (if any is left) asynchronously on the event loop. I'm going to file a separate bug for addressing that.
Attachment #558922 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 8•13 years ago
|
||
Note that with the attached patch (and without Bug 685516) we will always do a decode when <img>.src is set and we will always decode synchronously when inserting an image that has a compressed size of less than 150K into the DOM, so the potential for flicker is fairly low to begin with.
Comment 9•13 years ago
|
||
Comment on attachment 558922 [details] [diff] [review] Patch > nsImageLoadingContent::ClearCurrentRequest(nsresult aReason) >+ mCurrentRequest.Set(nsnull, false); Why not Clear()? Similar in ClearPendingRequest. The comment about why GetOurDocument is not called GetDocument should now explain why the methods are not GetOwnerDoc and GetCurrentDoc. Speaking of which, probably better to call the new methods GetOurOwnerDoc and GetOurCurrentDoc. But either way. You need to add BindToTree and UnbindFromTree calling up into nsImageLoadingContent to nsSVGImageElement. r- for this part to make sure it happens.
Attachment #558922 -
Flags: review?(bzbarsky) → review-
Assignee | ||
Comment 10•13 years ago
|
||
Not sure if you wanted to look at this again ...
Attachment #558922 -
Attachment is obsolete: true
Attachment #562417 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 11•13 years ago
|
||
Attachment #562417 -
Attachment is obsolete: true
Attachment #562418 -
Flags: review?(bzbarsky)
Attachment #562417 -
Flags: review?(bzbarsky)
Comment 12•13 years ago
|
||
> Not sure if you wanted to look at this again ...
I did. Hence the r- vs "r+ if you change this".
Comment 13•13 years ago
|
||
Comment on attachment 562418 [details] [diff] [review] Patch (now with hg qref) r=me
Attachment #562418 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 14•13 years ago
|
||
(In reply to Boris Zbarsky (:bz) from comment #12) > > Not sure if you wanted to look at this again ... > > I did. Hence the r- vs "r+ if you change this". It felt more like an "r- so you pay attention" ;-) Thanks for the review.
Comment 15•13 years ago
|
||
Kyle, Has this bug landed? It appears to be finished, but isn't closed.
Assignee | ||
Comment 16•13 years ago
|
||
There are some test failures I need to sort through before landing.
Assignee | ||
Comment 17•13 years ago
|
||
Assignee | ||
Updated•13 years ago
|
Attachment #565836 -
Attachment is patch: true
Attachment #565836 -
Flags: review?(jmuizelaar)
Assignee | ||
Comment 18•13 years ago
|
||
The test failures are because RasterImage::GetFrame ignores the flags it's given if it doesn't already have a decoder.
Comment 19•13 years ago
|
||
Comment on attachment 565836 [details] [diff] [review] Make RasterImage::GetFrame honor the flags it r=bholley contingent on that followup bug discussed on IRC (factoring out the 3 copy-pasted instances of the 'screwed' code into a helper method).
Attachment #565836 -
Flags: review?(jmuizelaar) → review+
Assignee | ||
Comment 20•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/701372c96a92 https://hg.mozilla.org/mozilla-central/rev/d3b8c0394c5e Huzzah!
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla10
Updated•13 years ago
|
Whiteboard: [MemShrink]
Comment 21•13 years ago
|
||
Backed out for Android reftest failures: https://hg.mozilla.org/mozilla-central/rev/29c1738d7e27
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: mozilla10 → ---
Assignee | ||
Comment 22•13 years ago
|
||
The test failures are caused by the patch in bug 685516.
Updated•13 years ago
|
Whiteboard: [MemShrink] → [MemShrink:P2]
Assignee | ||
Comment 23•13 years ago
|
||
Since I can't manage to get the tests running on android under a debugger, we have the following options: 1. Land this without Bug 685516. 2. Scope Bug 685516 to affect desktop only (in other words, keep synchronously decoding small images on mobile). 3. Find someone who can actually debug on android to debug the test failures in Bug 685516.
Comment 26•12 years ago
|
||
On behalf of Facebook Inc, let me just say that we are prepared to give over one thousand free "pokes" to anyone who fixes this bug or alternatively https://bugzilla.mozilla.org/show_bug.cgi?id=689623. I will also gladly show you Mark Zuckerberg's desk and give you free dinner and cookies as part of a complementary tour of Facebook HQ in Menlo Park.
Comment 27•12 years ago
|
||
This is one of two worst image-related bugs that we're aware of (the other is bug 689623). Tons of slideshows on the web hit this. On a memory-constrained mobile device, this is a particularly bad bug, so k90?.
blocking-kilimanjaro: --- → ?
Assignee | ||
Comment 28•12 years ago
|
||
Unbitrotted. The patch is mostly the same.
Attachment #562418 -
Attachment is obsolete: true
Attachment #644367 -
Flags: review?(bzbarsky)
Comment 29•12 years ago
|
||
Comment on attachment 644367 [details] [diff] [review] Patch, again The indentation in nsNodeUtils.cpp is off, unless this is a diff -w. It might make sense to put the flags next to mImageBlockingStatus and make the PRUin16 or even PRUint8 to make them pack better. r=me with that.
Attachment #644367 -
Flags: review?(bzbarsky) → review+
Comment 30•12 years ago
|
||
Is this patch for FF14? Can I get this patch for FF11? Thanks,
Assignee | ||
Comment 31•12 years ago
|
||
(In reply to HyungGon Baek from comment #30) > Is this patch for FF14? This patch is for trunk, more or less. > Can I get this patch for FF11? If you do the work, yes. Otherwise, no. It's not a good use of my time to backport this to an unsupported version.
Comment 32•12 years ago
|
||
(In reply to Kyle Huey [:khuey] (khuey@mozilla.com) from comment #31) > > Can I get this patch for FF11? > > If you do the work, yes. Otherwise, no. It's not a good use of my time to > backport this to an unsupported version. Not to mention entirely insecure. Please upgrade to the latest version of Firefox!
Comment 33•12 years ago
|
||
Kyle, is something holding back the landing of the reviewed patch?
Comment 34•12 years ago
|
||
IIRC, there's some work that needs to be done to update the tests that fail for bogus reasons.
Comment 35•12 years ago
|
||
Appears to me its re-landed just today on m-i, should be coming to m-c next merge hopefully, unless it backed out again: m-i cset: https://hg.mozilla.org/integration/mozilla-inbound/rev/adf31747cf5e https://hg.mozilla.org/integration/mozilla-inbound/rev/92727400355a merged to m-c in cset: https://hg.mozilla.org/mozilla-central/rev/a0bddf5fcb91 with followup fix: https://hg.mozilla.org/mozilla-central/rev/d67c02074ced No idea why the bug has not been updated...
Comment 36•12 years ago
|
||
(In reply to Jim Jeffery not reading bug-mail 1/2/11 from comment #35) > Appears to me its re-landed just today on m-i, should be coming to m-c next > merge hopefully, unless it backed out again: It originated from the build-system repo and was merged to m-c first, then inbound.
Assignee | ||
Comment 37•12 years ago
|
||
I was waiting to make sure it stuck before updating the bug. I've already landed and backed out twice. https://hg.mozilla.org/mozilla-central/rev/92727400355a https://hg.mozilla.org/mozilla-central/rev/adf31747cf5e And two followups to deal with johns's nsObjectLoadingContent refactoring. https://hg.mozilla.org/mozilla-central/rev/30ce9f55180f https://hg.mozilla.org/mozilla-central/rev/91711277a553
Status: REOPENED → RESOLVED
Closed: 13 years ago → 12 years ago
OS: Mac OS X → All
Hardware: x86 → All
Resolution: --- → FIXED
Version: unspecified → 17 Branch
Updated•12 years ago
|
Target Milestone: --- → mozilla17
Version: 17 Branch → Trunk
You need to log in
before you can comment on or make changes to this bug.
Description
•