-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
What is the issue with the HTML Standard?
"error" events, in both the dedicated media source failure steps and the media data processing steps list are described as being fired synchronously, but implementations queue a task to fire the events.
Implementations implement the error events in the media data processing steps as specified prior to
22d0fa1#diff-42692259bbea922a55e8e0f8a8b7860df9b59e29b3f955bcfd4d0a3ca852cc01R27539, which didn't reflect the behavior of implementations.
Implementations have been unkeen to fire events synchronously because doing so is harder to get right. The event usually must be the last action in the task. For example, resetting the delaying-the-load-event flag after synchronously firing the event, as specified, would not have the desired effect when an error event handler triggers the load algorithm again, setting the flag. Implementations have additional object lifetime concerns that are not obvious from the spec prose. See for example WebKit/WebKit@3582cc1 and https://bugzilla.mozilla.org/show_bug.cgi?id=476771.
Implementations implement the dedicated media source failure steps similarly to what was specified prior to b64ac15#diff-42692259bbea922a55e8e0f8a8b7860df9b59e29b3f955bcfd4d0a3ca852cc01L27234
That spec change changed to the description of a number of state changes to asynchronous, which also didn't reflect behavior of implementations. That meant that state changes in response to MediaSource#endOfStream(), such as setting the error attribute, would be asynchronous when the readyState attribute equals HAVE_NOTHING, which would be inconsistent with similar state changes when the readyState attribute is greater than HAVE_NOTHING.