Closed Bug 1363719 Opened 8 years ago Closed 8 years ago

Adopted img elements have different behaviour in Firefox than other browsers

Categories

(Core :: DOM: Core & HTML, defect)

54 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1264529

People

(Reporter: andyearnshaw, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36 OPR/43.0.2442.1165 Steps to reproduce: I've noticed a difference, between the major browsers, in <img> element behaviour when moved between frames. We have some legacy code using <img src="data:image/png,invalid" onerror="*script using this*"> to work around the lack of document.currentScript in older browsers, which is how I ran into this quirk. Check the attachment, you should see an alert. Then press the button to move the (intentionally) broken img into the iframe. Press again to move it back. Actual results: The img element moves but its onerror handler isn't retriggered. Expected results: In Chrome, Safari and Microsoft Edge, moving the img between the frame document and the main document will cause the image to be downloaded again. In this case, the onerror handler will be retriggered. Note that I couldn't find any information on how this *should* behave in the HTML or DOM specs. However, I chose to file the bug as Firefox appears to be the odd one out here.
Component: Untriaged → DOM: Events
Product: Firefox → Core
Is this a dup. of bug 1076583? Edgar knows the best about the <img> inconsistency. :)
Component: DOM: Events → DOM: Core & HTML
Flags: needinfo?(echen)
Yes, it's a dupe. I looked first but obviously not hard enough. There's a change in that ticket: > Part 5: If an adoption of <img> is happening with the different source and destination document, we need to force it to reload, v2 This is what this issue was about.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Thanks Andy for updates.
Flags: needinfo?(echen)
Thanks for reporting this bug, Andy!! Adoption inconsistency is one of the things I would like to fix in bug 1076583. However, bug 1076583 is mainly to change the load behavior of non-responsive mode (e.g. <img> contains only src attribute) and there are still some possible spec issues (in terms of web-compatibility) need to consider. Probably it better to fix the adoption separately. There is another bug for adoption inconsistency already, bug 1264529. So I mark this bug as duplicated of bug 1264529 instead. Thank you again.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: