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 20952 - Add an update complete event
Summary: Add an update complete event
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: Media Source Extensions (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Aaron Colwell (c)
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-11 17:07 UTC by Adrian Bateman [MSFT]
Modified: 2013-02-19 01:03 UTC (History)
3 users (show)

See Also:


Attachments
Proposed patch (4.28 KB, patch)
2013-02-11 17:49 UTC, Adrian Bateman [MSFT]
Details

Description Adrian Bateman [MSFT] 2013-02-11 17:07:59 UTC
We should add an update complete event (maybe "update") on successful completion of append or remove that fires before updateend. This is a common pattern in Web APIs (see the Progress Events specification [1]). This is necessary because we have abort and error events that fire before updateend and, with the asynchronous nature of the API, we need an event signaling success. Without this applications must keep track of abort and error events to distinguish an updateend that occurs after one of these and an updateend that occurred because the operation completed successfully.

One situation that we found that highlights this need is from the steps in the abort() operation [2]. Consider the following: if(sb.updating) sb.abort(); Between the JavaScript checking the updating flag and calling abort() the current operation might complete. This means that step 3 of the abort operation will not fire since it is no longer updating. The updateend event will fire but the abort event will not. To avoid applications keeping track of this, we should make the following changes:

The segment parser loop [3] should add an additional step before step 9:
"Queue a task to fire a simple event named update at this SourceBuffer object."

The stream append loop [4] should add an additional step before step 12:
"Queue a task to fire a simple event named update at this SourceBuffer object."

The remove() method [5] should add an additional step before step 12:
"Queue a task to fire a simple event named update at this SourceBuffer object."

Add the "update" event to the Event Summary section [6].

[1] http://www.w3.org/TR/progress-events/#suggested-names-for-events-using-the-progressevent-interface
[2] https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#widl-SourceBuffer-abort-void
[3] https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#sourcebuffer-segment-parser-loop
[4] https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#sourcebuffer-stream-append-loop
[5] https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#widl-SourceBuffer-remove-void-double-start-double-end
[6] https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#sourcebuffer-events
Comment 1 Adrian Bateman [MSFT] 2013-02-11 17:49:12 UTC
Created attachment 1325 [details]
Proposed patch

Proposed patch for this change attached.
Comment 2 Aaron Colwell (c) 2013-02-19 01:03:49 UTC
Changes committed.
https://dvcs.w3.org/hg/html-media/rev/d5956e93b991

Proposed patch applied.