Closed Bug 1308126 Opened 3 years ago Closed 1 year ago
Inconsistent behavior of image loading between Firefox and Chrome/Edge
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 . 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 . We need to fix this.  See https://dxr.mozilla.org/mozilla-central/source/dom/html/HTMLImageElement.cpp#525 and bug 1076583.  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
More detailed explanation and working test case in this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1321300
Mass bug change to replace various 'parity' whiteboard flags with the new canonical keywords. (See bug 1443764 comment 13.)
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.