This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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
Created attachment 1325 [details] Proposed patch Proposed patch for this change attached.
Changes committed. https://dvcs.w3.org/hg/html-media/rev/d5956e93b991 Proposed patch applied.