<?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>27283</bug_id>
          
          <creation_ts>2014-11-08 19:25:19 +0000</creation_ts>
          <short_desc>InvalidAccessError usage is questionable; use TypeError instead?</short_desc>
          <delta_ts>2015-10-19 23:48:09 +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>Encrypted Media Extensions</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>external_dependency</status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>27284</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Domenic Denicola">d</reporter>
          <assigned_to name="Adrian Bateman [MSFT]">adrianba</assigned_to>
          <cc>ddorwin</cc>
    
    <cc>jdsmith</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>114719</commentid>
    <comment_count>0</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2014-11-08 19:25:19 +0000</bug_when>
    <thetext>&quot;If keySystem is an empty string, return a promise rejected with a new DOMException whose name is InvalidAccessError.

If supportedConfigurations was provided and is empty, return a promise rejected with a new DOMException whose name is InvalidAccessError.&quot;

In general TypeErrors are preferred for invalid arguments. I think in general the existence of InvalidAccessError is a mistake from the days before it was realized that IDL was not a language-agnostic layer. (I will file a WebIDL bug to discuss.)

No big deal though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>115085</commentid>
    <comment_count>1</comment_count>
    <who name="Jerry Smith">jdsmith</who>
    <bug_when>2014-11-19 02:36:49 +0000</bug_when>
    <thetext>I&apos;ve not found any definitive guidance on using TypeError for invalid argument values; but have found examples in both Media Source Extensions and Web Crypto where invalid values return TypeError.  I recommend we adopt this practice for consistency with those specifications.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>115793</commentid>
    <comment_count>2</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2014-12-02 16:35:38 +0000</bug_when>
    <thetext>For the record, WebIDL bug filed at https://www.w3.org/Bugs/Public/show_bug.cgi?id=27284; no response as of yet.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>115801</commentid>
    <comment_count>3</comment_count>
    <who name="Jerry Smith">jdsmith</who>
    <bug_when>2014-12-02 19:12:49 +0000</bug_when>
    <thetext>I&apos;ve added a comment to https://www.w3.org/Bugs/Public/show_bug.cgi?id=27284 to indicate EME has a related bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116019</commentid>
    <comment_count>4</comment_count>
    <who name="David Dorwin">ddorwin</who>
    <bug_when>2014-12-08 17:53:03 +0000</bug_when>
    <thetext>We also use InvalidAccessError for invalid formats and invalid operations for the session type.

Would this change only apply to basic initial parameter checking (i.e. empty parameters)?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116020</commentid>
    <comment_count>5</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2014-12-08 18:04:03 +0000</bug_when>
    <thetext>&gt; We also use InvalidAccessError for invalid formats and invalid operations for the session type.

I did a review of all the places InvalidAccessError appears.

All of them seem related to invalid or unsanitizable objects appearing, and TypeError would fit, except

&gt; If this object&apos;s session type is not &quot;persistent&quot;, return a promise rejected with a new DOMException whose name is InvalidAccessError.

and

&gt; Otherwise
&gt;    Reject promise with a new DOMException whose name is InvalidAccessError.

(below &apos;If sessionType is &quot;persistent&quot;&apos;)

which seems like they should be RangeError.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123792</commentid>
    <comment_count>6</comment_count>
    <who name="David Dorwin">ddorwin</who>
    <bug_when>2015-10-19 23:48:09 +0000</bug_when>
    <thetext>Migrated to https://github.com/w3c/encrypted-media/issues/103.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>