Closed
Bug 841579
Opened 13 years ago
Closed 13 years ago
nsImageLoadingContent shouldn't depend on load happening after decode
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla22
People
(Reporter: joe, Assigned: joe)
References
Details
Attachments
(2 files, 3 obsolete files)
8.56 KB,
patch
|
joe
:
review+
|
Details | Diff | Splinter Review |
9.18 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
Currently, nsImageLoadingContent seems to depend on load happening after decode, in that errors that get noticed after the size decode happens are ignored. This is relatively OK, except that in bug 716140, all decode notifications are made asynchronously, and further, all images must go through a size decode, even ones we're decoding fully right away.
As an alternative to this, I propose this patch, which will make nsImageLoadingContent wait for the DECCODE_COMPLETE notification if, when LOAD_COMPLETE fires, one of (a) we are still waiting for a decode; or (b) we have asked for a decode.
Attachment #714136 -
Flags: review?(khuey)
![]() |
Assignee | |
Comment 1•13 years ago
|
||
Attachment #714139 -
Flags: review?(khuey)
Comment 2•13 years ago
|
||
Is this green on try right now? I believe we could get rid of the "delay firing OnStopRequest" stuff from bug 704059 if this works.
![]() |
Assignee | |
Comment 3•13 years ago
|
||
hm, though this does seem to break a couple of crashtests: https://tbpl.mozilla.org/?tree=Try&rev=a530385e3a30
![]() |
Assignee | |
Comment 4•13 years ago
|
||
Another try that should probably fix some of that orange: https://tbpl.mozilla.org/?tree=Try&rev=3b4713931db0
Attachment #714136 -
Attachment is obsolete: true
Attachment #714136 -
Flags: review?(khuey)
Attachment #714158 -
Flags: review?(khuey)
![]() |
Assignee | |
Comment 5•13 years ago
|
||
Argh, typo + not running tests locally = sad Try run. New one, including a fix for dependent bug 841661 that caused my tests to fail without cause: https://tbpl.mozilla.org/?tree=Try&rev=e334074e7154
Attachment #714158 -
Attachment is obsolete: true
Attachment #714158 -
Flags: review?(khuey)
Attachment #714251 -
Flags: review?(khuey)
Comment 6•13 years ago
|
||
Is there any reason why this couldn't utilize the existing onload blocking notifications? It seems like we could check if the REQUEST_BLOCKS_ONLOAD flag is set, and if it is, set another flag indicating that we deferred the load events. Then, in UnblockOnload, check that flag and fire the events if needed.
![]() |
Assignee | |
Comment 7•13 years ago
|
||
Onload is unblocked at the earliest of OnStopRequest or OnDecodingFinished, IIRC, so it won't work, I think?
![]() |
Assignee | |
Comment 8•13 years ago
|
||
Since what we're looking for is actually errors that might come after OnStopRequest, we need to check for errors in OnStopRequest too.
This version is very happy on try: https://tbpl.mozilla.org/?tree=Try&rev=2a5e6da4fc4b
Attachment #714251 -
Attachment is obsolete: true
Attachment #714251 -
Flags: review?(khuey)
Attachment #714554 -
Flags: review?(khuey)
![]() |
Assignee | |
Comment 9•13 years ago
|
||
One change is needed to this patch to make it entirely correct:
- if (NS_SUCCEEDED(aStatus) &&
+ if (NS_SUCCEEDED(aStatus) && !(reqStatus & imgIRequest::STATUS_ERROR) &&
When reviewing, please pretend that's the code you're reviewing.
Attachment #714554 -
Flags: review?(khuey) → review+
![]() |
Assignee | |
Comment 10•13 years ago
|
||
Comment on attachment 714139 [details] [diff] [review]
test that removing images from the DOM midway through loading doesn't inhibit proper loads
rs=khuey
Attachment #714139 -
Flags: review?(khuey) → review+
![]() |
Assignee | |
Comment 11•13 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/0222cb048028
https://hg.mozilla.org/integration/mozilla-inbound/rev/d21d144e3db9
Target Milestone: --- → mozilla22
Comment 12•13 years ago
|
||
Glad to see this getting pushed in. This is super great stuff, Joe. I've filed bug 847630 to take advantage of this to simplify the code in VectorImage a bit.
![]() |
Assignee | |
Comment 13•13 years ago
|
||
Backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/644043c3de95 - it broke chrome://mochitests/content/chrome/image/test/mochitest/test_removal_ondecode.html and /tests/image/test/mochitest/test_bug512435.html.
Target Milestone: mozilla22 → ---
![]() |
Assignee | |
Comment 14•13 years ago
|
||
Try run was successful: https://tbpl.mozilla.org/?tree=Try&rev=303b6b3e03c7
Landed again, hopefully to stick this time:
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/7fb88d0bf0ec
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/66006561df23
![]() |
Assignee | |
Comment 15•13 years ago
|
||
And out the code comes again, despite the green runs on Try, because it causes a frequent intermittent failure in image/test/mochitest/test_bug512435.html | img_{a,b} should be decoded before onload fires.
http://hg.mozilla.org/integration/mozilla-inbound/rev/d4a0f20ca152
![]() |
Assignee | |
Comment 16•13 years ago
|
||
Thanks to bug 848624, our build scripts didn't know that imgIRequest.idl had changed, so it put the old version of imgIRequest.xpt into the distributed interfaces.xpt, meaning that it was a crapshoot as to whether our build machines were even testing the new interface, depending on how recently the machine had been clobbered.
This also explains why I could never reproduce the bug on my computer or on try.
Anyways, repushed with a UUID change, which should fix that problem and let it stick.
https://hg.mozilla.org/integration/mozilla-inbound/rev/d37fdbac89f2
Comment 17•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
Updated•7 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•