Closed
Bug 1318624
Opened 6 years ago
Closed 6 years ago
Should not start a load of an image if it's document is not an active document
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: edgar, Assigned: edgar)
References
Details
Attachments
(2 files, 3 obsolete files)
5.72 KB,
patch
|
jdm
:
review+
|
Details | Diff | Splinter Review |
4.06 KB,
patch
|
edgar
:
review+
|
Details | Diff | Splinter Review |
We try to start the load of an image which is in a document fragment. This seem not follow the spec, see step 1 of https://html.spec.whatwg.org/multipage/embedded-content.html#updating-the-image-data. * Test script: http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=4675 * Expected result: no error event. * Actual result: got an unexpected error event.
Assignee | ||
Comment 1•6 years ago
|
||
WIP patch, working on the test cases ...
Assignee | ||
Comment 2•6 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=8cb6d0c08a4d98723f99ab0867c3da47ab725c09
Assignee | ||
Comment 3•6 years ago
|
||
(In reply to Edgar Chen [:edgar] from comment #0) > We try to start the load of an image which is in a document fragment. This > seem not follow the spec, see step 1 of > https://html.spec.whatwg.org/multipage/embedded-content.html#updating-the- > image-data. > > * Test script: > http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=4675 > > * Expected result: > no error event. > > * Actual result: > got an unexpected error event. Test other browsers: Chrome, Safari, and Edge all have no error event fired.
Assignee | ||
Comment 4•6 years ago
|
||
Attachment #8812225 -
Attachment is obsolete: true
Assignee | ||
Comment 5•6 years ago
|
||
Assignee | ||
Comment 6•6 years ago
|
||
Attachment #8868954 -
Attachment is obsolete: true
Assignee | ||
Comment 7•6 years ago
|
||
Comment on attachment 8868953 [details] [diff] [review] Should not perform a load of a image if it's document is not active document, v2 Review of attachment 8868953 [details] [diff] [review]: ----------------------------------------------------------------- Originally, I planned to fix this along with the non-responsive load behavior changes in bug 1076583. However, bug 1076583 is blocked since there is still some possible spec issues (in terms of web-compatibility) need to be considered. So It's better to fix this separately here. In this patch, I add checks for non-responsive mode only, since we already do same check in http://searchfox.org/mozilla-central/rev/f55349994fdac101d121b11dac769f3f17fbec4b/dom/html/HTMLImageElement.cpp#945 for the responsive mode. Josh, may I have your review? Thank you.
Attachment #8868953 -
Flags: review?(josh)
Assignee | ||
Comment 8•6 years ago
|
||
Comment on attachment 8868959 [details] [diff] [review] Add wpt for img in non-active document, v2 Review of attachment 8868959 [details] [diff] [review]: ----------------------------------------------------------------- I have run this test on Chrome, Safari, and Edge. All of them can pass.
Attachment #8868959 -
Flags: review?(josh)
Updated•6 years ago
|
Attachment #8868953 -
Flags: review?(josh) → review+
Comment 9•6 years ago
|
||
Comment on attachment 8868959 [details] [diff] [review] Add wpt for img in non-active document, v2 Review of attachment 8868959 [details] [diff] [review]: ----------------------------------------------------------------- ::: testing/web-platform/tests/html/semantics/embedded-content/the-img-element/non-active-document.html @@ +18,5 @@ > + var d = p.parseFromString('<img>', 'text/html'); > + var i = d.querySelector('img'); > + i.onerror = t.unreached_func('got unexpected error event'); > + i.onload = t.unreached_func('got unexpected load event'); > + i.src = '/images/green-1x1.png'; We should add a `<img src=/images/green-1x1.png>` in this file so that any loads here would be cached.
Attachment #8868959 -
Flags: review?(josh) → review+
Assignee | ||
Comment 10•6 years ago
|
||
Addressed review comment #9. Thanks for the review, Josh.
Attachment #8868959 -
Attachment is obsolete: true
Attachment #8869302 -
Flags: review+
Comment 11•6 years ago
|
||
Pushed by echen@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/9c9166bc787d Should not perform a load of a image if it's document is not active document; r=jdm https://hg.mozilla.org/integration/mozilla-inbound/rev/55ccbc9a9bfc Add wpt for img in non-active document; r=jdm
Comment 12•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9c9166bc787d https://hg.mozilla.org/mozilla-central/rev/55ccbc9a9bfc
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Updated•4 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•