Closed
Bug 756419
Opened 13 years ago
Closed 13 years ago
White standalone image background flashes into view when switching tabs
Categories
(Toolkit :: Themes, defect)
Tracking
()
RESOLVED
FIXED
mozilla17
People
(Reporter: ferongr, Assigned: jaws)
References
Details
(Keywords: regression, testcase, Whiteboard: [qa:see comment 17])
Attachments
(1 file, 1 obsolete file)
12.60 KB,
patch
|
roc
:
review+
bholley
:
review+
lsblakk
:
approval-mozilla-aurora+
lsblakk
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
Ever since bug 754133 landed, switching between standalone image tabs has become a disorienting procedure. With discarded decoded image data the system takes some time to re-decode the image. In that interval the white background is displayed instead of the image, resulting in brief a white flash.
Also, when slowly loading a large standalone image the experience is not ideal either.
Ideally the white background should only appear if there's a fully decoded image in view.
Comment 1•13 years ago
|
||
Confirmed. It's really annoying!
Comment 2•13 years ago
|
||
Gentle ping
and what are we going to do with this bug?
Updated•13 years ago
|
tracking-firefox15:
--- → ?
Comment 3•13 years ago
|
||
Tracking this regression in 15 and bring Jared in to the discussion to see if we can forward fix this before 15 ships or whether we have to look at backing out bug 754133.
Keywords: regression
Comment 4•13 years ago
|
||
I'm recommending:
1) changing image background from white to black only when image is loading and is not completely rendered - this will prevent this flashing issue
2) changing background from dark gray to black - will have win in battery saving on mobiles, and dark grey isn't needed as we have now bug #754133 fixed. But this probably need a new bug.
What do you guys think about these ideas?
Comment 5•13 years ago
|
||
(In reply to Lukas Blakk [:lsblakk] from comment #3)
> Tracking this regression in 15 and bring Jared in to the discussion to see
> if we can forward fix this before 15 ships or whether we have to look at
> backing out bug 754133.
This isn't severe enough to back out bug 754133.
Assignee | ||
Comment 6•13 years ago
|
||
I agree with Dao.
It looks like this could be achieved by hooking in to the https://developer.mozilla.org/en/XPCOM_Interface_Reference/imgIDecoderObserver#onStopDecode() event. However, I don't think I'll have time to get this bug fixed before Aurora 15 merges to Beta 15.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 7•13 years ago
|
||
Jared, assigning to you for now unless you can find someone else to take it. It's still early in the Beta cycle so we could take a fix in the coming weeks if you have time to prepare something.
Assignee: nobody → jaws
Assignee | ||
Comment 8•13 years ago
|
||
This patch sets and unsets the "decoded" class on the image when the image is decoded and discarded, respectively.
This *should* reduce instances of the white flashing, but I'm unable to reproduce it locally.
bholley: I flagged you for feedback due to the note in onStopDecode here <https://developer.mozilla.org/en/XPCOM_Interface_Reference/imgIDecoderObserver#onStopDecode%28%29>
I think we'll be OK without the code to remove the observer inside of onStopDecode since the observer is still removed in ImageDocument::Destroy.
Attachment #643958 -
Flags: review?(roc)
Attachment #643958 -
Flags: feedback?(bobbyholley+bmo)
Attachment #643958 -
Flags: review?(roc) → review+
Comment 9•13 years ago
|
||
Comment on attachment 643958 [details] [diff] [review]
Patch
>
> NS_IMETHODIMP
> ImageDocument::OnStopDecode(imgIRequest *aRequest,
> nsresult aStatus,
> const PRUnichar *aStatusArg)
> {
> UpdateTitleAndCharset();
>
>- nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(mImageContent);
>- if (imageLoader) {
>- mObservingImageLoader = false;
>- imageLoader->RemoveObserver(this);
>- }
>+ // Update the background-color of the image only after the
>+ // image has been decoded to prevent flashes of just the
>+ // background-color.
>+ mImageContent->SetAttr(kNameSpaceID_None, nsGkAtoms::_class,
>+ NS_LITERAL_STRING("decoded"), false);
This is wrong, because OnStopDecode is called at _load_ time (once per image), rather than at decode time. The comment on MDN and in the source sort of explains this, but is unfortunately hampered by a very terrible typo (it should say that this method is a companion to OnStopRequest, not to OnStopDecode, which doesn't make sense).
If you want to hear about when an image finishes decoding, listing for OnStopContainer.
Attachment #643958 -
Flags: feedback?(bobbyholley+bmo) → feedback-
Assignee | ||
Comment 10•13 years ago
|
||
This patch uses OnStopContainer to get the proper decode notification.
Note that the observer is no longer removed in OnStopDecode, since it is still needed for OnDiscard. We could remove the observer in OnDiscard, but then we would need to re-add the observer when the image starts decoding again (but wouldn't get that notification since the necessary observer would be removed).
Attachment #643958 -
Attachment is obsolete: true
Attachment #649087 -
Flags: review?(roc)
Attachment #649087 -
Flags: review?(bobbyholley+bmo)
Attachment #649087 -
Flags: review?(roc) → review+
Assignee | ||
Updated•13 years ago
|
Status: NEW → ASSIGNED
Comment 11•13 years ago
|
||
Comment on attachment 649087 [details] [diff] [review]
Patch v2
r=bholley. Presumably roc's r+ means we're ok exposing .decoded naked/unprefixed?
Attachment #649087 -
Flags: review?(bobbyholley+bmo) → review+
Assignee | ||
Comment 12•13 years ago
|
||
Yeah, we're ok unprefixed because this class is only applied on images in top-level synthetic documents.
https://hg.mozilla.org/integration/mozilla-inbound/rev/35ac9dfcef9b
Target Milestone: --- → mozilla17
Version: unspecified → 15 Branch
Comment 13•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 14•13 years ago
|
||
Comment on attachment 649087 [details] [diff] [review]
Patch v2
[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 754133
User impact if declined: users will see a brief flash of white before the image reloads when switching tabs
Testing completed (on m-c, etc.): landed on m-c on 8/9, tested locally
Risk to taking this patch (and alternatives if risky): minor risk, involves keeping an observer around longer than before, but no issues are expected
String or UUID changes made by this patch: none
Attachment #649087 -
Flags: approval-mozilla-beta?
Attachment #649087 -
Flags: approval-mozilla-aurora?
Updated•13 years ago
|
Attachment #649087 -
Flags: approval-mozilla-beta?
Attachment #649087 -
Flags: approval-mozilla-beta+
Attachment #649087 -
Flags: approval-mozilla-aurora?
Attachment #649087 -
Flags: approval-mozilla-aurora+
Assignee | ||
Comment 15•13 years ago
|
||
https://hg.mozilla.org/releases/mozilla-beta/rev/6bc2cad5a3b4
https://hg.mozilla.org/releases/mozilla-aurora/rev/7bd72ea6ab99
status-firefox15:
--- → fixed
status-firefox16:
--- → fixed
Comment 16•13 years ago
|
||
Is there a testcase QA can use to verify this is fixed?
Keywords: testcase-wanted
Reporter | ||
Comment 17•13 years ago
|
||
While not a real testcase, any sufficiently large image that doesn't decode instantly (e.g. http://kurtjohnson.net/Photos/2006.12.30.MP_pano.jpg )should suffice to verify.
1. Open and wait for the image to load.
2. Switch to another tab and wait for the image data to be discarded.
3. Switch back to the tab with the image.
Without the fix the white background intended to help with transparent images shows up until the image is decoded again and displayed.
With the fix, while the image is decoded you see no white background.
Comment 18•13 years ago
|
||
Thanks John. We'll try to verify it using that test.
Whiteboard: [qa:see comment 17]
Comment 19•13 years ago
|
||
Tested with http://www.free-pictures-photos.com/ and suggestions in comment 17 on 15b5 - Windows 7, Ubuntu and Mac OS.
No white background is displayed anymore and no other glitches spotted while switching tabs with large images.
Depends on: CVE-2013-0775
You need to log in
before you can comment on or make changes to this bug.
Description
•