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 7843 - Please make 'abort', ' loadend' and 'emptied' use "queue a task". Firing them sync is annoying to implement and doesn't seem to solve any problem.
Summary: Please make 'abort', ' loadend' and 'emptied' use "queue a task". Firing them...
Status: CLOSED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: LC
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords: NE
Depends on:
Blocks:
 
Reported: 2009-10-08 13:49 UTC by contributor
Modified: 2010-10-04 13:55 UTC (History)
6 users (show)

See Also:


Attachments

Description contributor 2009-10-08 13:49:17 UTC
Section: http://www.whatwg.org/specs/web-apps/current-work/#loading-the-media-resource

Comment:
Please make 'abort', ' loadend' and 'emptied' use "queue a task". Firing them sync is annoying to implement and doesn't seem to solve any problem.

Posted from: 88.131.66.80
Comment 1 Philip J├Ągenstedt 2009-10-14 08:32:14 UTC
Note that with no synchronous events in the load() method there should be no way of the load() algorithm recursing, so its first step could be removed.
Comment 2 Ian 'Hixie' Hickson 2009-10-20 09:11:38 UTC
If we make them async, the state of the element will be at odds with the event. For example, 'emptied' would fire at a time that doesn't involve the element being empty. That seems bad, from an API perspective, no?
Comment 3 Philip J├Ągenstedt 2009-10-20 11:14:53 UTC
I'd like to reopen this bug, but can't see an option to do that (probably need an admin account).

All other events on media elements are async with the actual state and cannot be trusted. In the case of 'abort' and 'emptied' ('loadend' is no more) the state of the media element is reset before firing them, so there is nothing there which scripts could reasonably depend on.

The main reason I'd like these events to be async is because it would be much easier to implement with all events being treated equally. In an interruptable ECMAScript engine synchronous (from the scripts point of view) event handling requires saving all state and waiting for the handler to finish before continuing. It can be done, but it's annoying and it would be nice if there were a compelling reason to do it.
Comment 4 Ian 'Hixie' Hickson 2009-10-20 21:52:54 UTC
Ok, done.
Comment 5 contributor 2009-10-20 21:53:38 UTC
Checked in as WHATWG revision r4212.
Check-in comment: Make 'abort' and 'emptied' events in load() fire asynchronously.
http://html5.org/tools/web-apps-tracker?from=4211&to=4212