Closed Bug 1308126 Opened 3 years ago Closed 1 year ago

Inconsistent behavior of image loading between Firefox and Chrome/Edge

Categories

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

51 Branch
x86
Windows 10
defect

Tracking

()

RESOLVED DUPLICATE of bug 1308069
Tracking Status
firefox49 --- unaffected
firefox50 --- unaffected
firefox51 --- affected
firefox52 --- wontfix

People

(Reporter: alice0775, Assigned: edgar)

References

(Depends on 1 open bug)

Details

(Keywords: parity-chrome, parity-edge)

Attachments

(1 file)

Attached file testcase
Something timing problem.

img.src="";
img.src="valid image url";

An alert box pops up on Nigitly52.0a1, Aurora51.0a2 and IE11.
No error on Chrome and Edge.


Steps to reproduce:
1. Open attached testcase

Actual Results:
 an alert pops up

Expected Results:
 I'm not sure either
Seems like Chrome clears the pending error event if the src changed before it fired:

https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/loader/ImageLoader.cpp?sq=package:chromium&rcl=1475738528&l=189

(see ImageLoader::setImageWithoutConsideringPendingLoadEvent)
Currently we load image synchronously if image is in non-responsive mode [1].
Besides the comment 0, If we set img.src to "" multiple times in succession, error event will be fired multiple times. 
This is not in line with spec [2]. We need to fix this.

[1] See https://dxr.mozilla.org/mozilla-central/source/dom/html/HTMLImageElement.cpp#525 and bug 1076583.
[2] See step 7 of https://html.spec.whatwg.org/multipage/embedded-content.html#update-the-image-data.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P2
See Also: → 1308069
Depends on: 1076583
FYI, Bug 1308069 fixed the problem in case the testcase(comment#0).
More detailed explanation and working test case in this bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1321300
Mass wontfix for bugs affecting firefox 52.
Mass bug change to replace various 'parity' whiteboard flags with the new canonical keywords. (See bug 1443764 comment 13.)
Whiteboard: [parity-chrome][parity-edge]
Per comment 3.
Assignee: nobody → echen
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1308069
You need to log in before you can comment on or make changes to this bug.