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 27857 - [MSE] Reorder SourceBuffer.remove() exceptions handling for consistency
Summary: [MSE] Reorder SourceBuffer.remove() exceptions handling for consistency
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: Media Source Extensions (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: CR
Assignee: Aaron Colwell
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-19 15:31 UTC by Bartlomiej Gajda
Modified: 2015-02-03 18:58 UTC (History)
4 users (show)

See Also:


Attachments

Description Bartlomiej Gajda 2015-01-19 15:31:45 UTC
SourceBuffer.remove()

1. If duration equals NaN, then throw an InvalidAccessError exception and abort these steps.
2. If start is negative or greater than duration, then throw an InvalidAccessError exception and abort these steps.
3. If end is less than or equal to start or end equals NaN, then throw an InvalidAccessError exception and abort these steps.

4. If this object has been removed from the sourceBuffers attribute of the parent media source then throw an InvalidStateError exception and abort these steps.
5. If the updating attribute equals true, then throw an InvalidStateError exception and abort these steps.

---

I believe this is wrong order, and we move check number 4 (and 5 for consistency) before 1, so the new order would be "4 5 1 2 3"

While this might not seem as big deal, any reference to mediaSource data ("duration" in this example) feels wrong if the SourceBuffer is removed from parent MediaSource, and currently check for duration is before check for being removed.

This would also be consistent with appendWindowStart, appendWindowEnd, buffered, etc. as they also check first is SB removed.

Opinions?

Similar but less important issue is with setting mode of SourceBuffer (first InvalidAccess, then InvalidState), but there is no reference to mediaSource data there, so I don't thing it's that big of issue.
Comment 1 Bartlomiej Gajda 2015-01-19 18:51:29 UTC
> and we move check number 4 (and 5 for

and we *should* move