Closed Bug 851755 Opened 12 years ago Closed 12 years ago

Make nsImageBoxFrame block onload when images are loading/decoding

Categories

(Core :: XUL, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: joe, Assigned: joe)

References

Details

Attachments

(1 file)

nsImageBoxFrame currently doesn't block its document's onload when the image starts decoding, but it should. It should also do similarly to nsImageLoadingContent (bug 841579) and not fire its load events before decode happens, just in case images run into errors. Try: https://tbpl.mozilla.org/?tree=Try&rev=3b1512e650b2
Attached patch wait for decode (deleted) — Splinter Review
Did I just dream about getting feedback about this patch? I swear I already got review on it. Or at least attached it to a bug.
Attachment #726498 - Flags: review?(tnikkel)
Were there some tests failing because of this?
Yep - one or two.
Comment on attachment 726498 [details] [diff] [review] wait for decode Review of attachment 726498 [details] [diff] [review]: ----------------------------------------------------------------- What happens if BlockOnload is called and then this frame gets destroyed? I think we should unblock onload in that case. ::: layout/xul/base/src/nsImageBoxFrame.cpp @@ +725,5 @@ > +/* void blockOnload (in imgIRequest aRequest); */ > +NS_IMETHODIMP > +nsImageBoxListener::BlockOnload(imgIRequest *aRequest) > +{ > + if (mFrame && mFrame->GetContent() && mFrame->GetContent()->GetDocument()) { I think you want GetCurrentDoc here.
[8:41 PM] <joe> tn: well anyways I think we're actually OK here [8:41 PM] <joe> that is, if destroying frames calls DestroyFrom [8:42 PM] <joe> because CancelAndForgetObserver, from within DestroyFrom, will call unblockonload if necessary [8:43 PM] <tn> joe, oh, okay, then that should be good
Attachment #726498 - Flags: review?(tnikkel) → review+
Depends on: 852850
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: