<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>27857</bug_id>
          
          <creation_ts>2015-01-19 15:31:45 +0000</creation_ts>
          <short_desc>[MSE] Reorder SourceBuffer.remove() exceptions handling for consistency</short_desc>
          <delta_ts>2015-02-03 18:58:21 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>Media Source Extensions</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>CR</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Bartlomiej Gajda">b.gajda</reporter>
          <assigned_to name="Aaron Colwell">acolwell</assigned_to>
          <cc>acolwell</cc>
    
    <cc>mike</cc>
    
    <cc>philipj</cc>
    
    <cc>public-html-media</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>117318</commentid>
    <comment_count>0</comment_count>
    <who name="Bartlomiej Gajda">b.gajda</who>
    <bug_when>2015-01-19 15:31:45 +0000</bug_when>
    <thetext>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 &quot;4 5 1 2 3&quot;

While this might not seem as big deal, any reference to mediaSource data (&quot;duration&quot; 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&apos;t thing it&apos;s that big of issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117328</commentid>
    <comment_count>1</comment_count>
    <who name="Bartlomiej Gajda">b.gajda</who>
    <bug_when>2015-01-19 18:51:29 +0000</bug_when>
    <thetext>&gt; and we move check number 4 (and 5 for

and we *should* move</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117674</commentid>
    <comment_count>2</comment_count>
    <who name="Aaron Colwell">acolwell</who>
    <bug_when>2015-02-03 18:58:21 +0000</bug_when>
    <thetext>Change committed...
https://github.com/w3c/media-source/commit/ee9ae4ba1681e34b6e90d172759f984ee64ab4c1</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>