This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 25795 - <img> error/loadend are always simple events
Summary: <img> error/loadend are always simple events
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-19 07:01 UTC by contributor
Modified: 2014-06-16 10:50 UTC (History)
3 users (show)

See Also:


Attachments

Description contributor 2014-05-19 07:01:56 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/edits.html
Multipage: http://www.whatwg.org/C#img-load
Complete: http://www.whatwg.org/c#img-load
Referrer: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html

Comment:
error/loadend are always simple events
"first fire a simple event named error at the img element and then fire a
simple event named loadend at the img element."

Why not use progress events for error/loadend here in the same-origin case?

Posted from: 210.95.255.149 by simonp@opera.com
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36 OPR/21.0.1432.48 (Edition Next)
Comment 1 Ian 'Hixie' Hickson 2014-05-21 20:23:09 UTC
What would it mean for them to be progress events?
Comment 2 Simon Pieters 2014-05-23 10:18:12 UTC
They would use ProgressEvent instead of just Event. In XHR they use ProgressEvent. <img> seems to switch between ProgressEvent and Event depending on origin, except error/loadend which are always Event. I think they would expose the same information as the last "progress" event.
Comment 3 Ian 'Hixie' Hickson 2014-05-23 19:54:20 UTC
Do "error" and "loadend" normally expose the last "progress" event's information?

If they do normally do that, then sure...
Comment 4 Simon Pieters 2014-06-16 10:06:22 UTC
Thinking about this some more, it seems simpler and possibly safer to always use Event for error, and not fire 'progress' at all until dimensions are known (it would be confusing anyway to fire 'progress' events for two ongoing fetches in the parallel loading case).
Comment 5 Simon Pieters 2014-06-16 10:50:06 UTC
Fire 'progress' event only for the current request.
https://github.com/ResponsiveImagesCG/picture-element/commit/22efd4478d7714ac12fd128ca2c455d0f91f42a4