<?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>25347</bug_id>
          
          <creation_ts>2014-04-15 11:56:17 +0000</creation_ts>
          <short_desc>[MSE] &apos;nullable&apos; arguments and type conversions and INVALID_ACCESS_ERR (vs. WebIDL)</short_desc>
          <delta_ts>2014-04-29 21:13:49 +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="Fredrik S">fs</reporter>
          <assigned_to name="Aaron Colwell">acolwell</assigned_to>
          <cc>acolwell</cc>
    
    <cc>ddorwin</cc>
    
    <cc>mike</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>103870</commentid>
    <comment_count>0</comment_count>
    <who name="Fredrik S">fs</who>
    <bug_when>2014-04-15 11:56:17 +0000</bug_when>
    <thetext>Throughout this specification method arguments are marked as non-nullable (consistently in both the parameter table and the IDL-fragments), but the &apos;null&apos; value is still assumed handled in the algorithm steps.

Example:

interface MediaSource : EventTarget {
    ...
    SourceBuffer   addSourceBuffer (DOMString type);
    void           removeSourceBuffer (SourceBuffer sourceBuffer);
    ...
};

&quot;addSourceBuffer
...
When this method is invoked, the user agent must run the following steps:

1. If type is null or an empty string then throw an INVALID_ACCESS_ERR exception and abort these steps.
...
removeSourceBuffer
...
When this method is invoked, the user agent must run the following steps:

1. If sourceBuffer is null then throw an INVALID_ACCESS_ERR exception and abort these steps.&quot;

In both of these cases the algorithmic steps assumes null is a valid value and handles it.
However, assuming WebIDL semantics [1], these methods would never be invoked with null as the value. In the case of addSourceBuffer(null), null would be converted to the string &apos;null&apos; [2], and for removeSourceBuffer(null) a TypeError exception would be thrown because the null value cannot be converted to an object of interface type &quot;SourceBuffer&quot; [3].

Similar issues exists for other methods in the specification.

[1] The spec does not reference WebIDL AFAICS, but seems to follow notational and other conventions from it.
[2] http://heycam.github.io/webidl/#es-DOMString
[3] http://heycam.github.io/webidl/#es-interface</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103876</commentid>
    <comment_count>1</comment_count>
    <who name="Aaron Colwell">acolwell</who>
    <bug_when>2014-04-15 15:08:05 +0000</bug_when>
    <thetext>Thanks for filing this. I&apos;ve been meaning to fix this for a while, but never filed a bug for it. I&apos;ll also remove text around handling invalid enum values as part of this work as well since WebIDL also takes care of that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104719</commentid>
    <comment_count>2</comment_count>
    <who name="Aaron Colwell">acolwell</who>
    <bug_when>2014-04-29 21:13:49 +0000</bug_when>
    <thetext>Changes committed.
https://dvcs.w3.org/hg/html-media/rev/ba5233c6654d</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>