<?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>27732</bug_id>
          
          <creation_ts>2015-01-03 10:30:15 +0000</creation_ts>
          <short_desc>DOMException lost some constants.</short_desc>
          <delta_ts>2016-12-09 12:59:48 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>WebIDL</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</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>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ms2ger">Ms2ger</reporter>
          <assigned_to name="Cameron McCormack">cam</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>d</cc>
    
    <cc>jsbell</cc>
    
    <cc>mike</cc>
    
    <cc>Ms2ger</cc>
    
    <cc>public-script-coord</cc>
    
    <cc>tobie.langel</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>116738</commentid>
    <comment_count>0</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2015-01-03 10:30:15 +0000</bug_when>
    <thetext>There&apos;s no reason to drop DOMException.DOMSTRING_SIZE_ERR and friends.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127929</commentid>
    <comment_count>1</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2016-10-22 16:28:50 +0000</bug_when>
    <thetext>Ms2ger, what is the complete list of constants that were lost? We should test that all browsers have them, and if so reintroduce them, but without such a list there&apos;s not much to do.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127936</commentid>
    <comment_count>2</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2016-10-23 01:16:58 +0000</bug_when>
    <thetext>You basically want to compare the &quot;Legacy code name and value&quot; values at https://heycam.github.io/webidl/#dfn-error-names-table with the constants listed in https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-17189187 and see which ones are missing.  But really, they&apos;re the ones that correspond to numeric gaps in the webidl table.

At first glance: DOMSTRING_SIZE_ERR = 2, NO_DATA_ALLOWED_ERR = 6, VALIDATION_ERR = 16, TYPE_MISMATCH_ERR = 17.

Note that the web platform test at WebIDL/ecmascript-binding/es-exceptions/DOMException-constants.html does test for their existence, as far as I can see, and would fail in a browser that doesn&apos;t support them.

Apart from that and the actual occurrence in the WebIDL for DOMEXception, I don&apos;t see any uses of DOMSTRING_SIZE_ERR, NO_DATA_ALLOWED_ERR, or VALIDATION_ERR in Gecko, which makes sense because the situations they would arise in for the DOM3 Core spec never arise on the web in practice, I think.

TYPE_MISMATCH_ERR is totally used, in both code and specs.  For example, https://w3c.github.io/webcrypto/Overview.html#Crypto-method-getRandomValues step 1 uses it (the &quot;throw TypeMismatchError&quot; bit).  So its removal from DOMException breaks various stuff even if we ignore the &quot;match UAs&quot; aspect of things.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127937</commentid>
    <comment_count>3</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2016-10-23 01:48:17 +0000</bug_when>
    <thetext>OK, cool. Combined with things like https://www.w3.org/Bugs/Public/show_bug.cgi?id=29372, it sounds like we should be sure when reintroducing to mark these as deprecated/do-not-use somehow. (I&apos;m very sad people are using TypeMismatchError instead of TypeError :(.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127938</commentid>
    <comment_count>4</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2016-10-23 01:48:56 +0000</bug_when>
    <thetext>Oops, I meant https://www.w3.org/Bugs/Public/show_bug.cgi?id=27284</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127940</commentid>
    <comment_count>5</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2016-10-23 21:15:10 +0000</bug_when>
    <thetext>&gt; I&apos;m very sad people are using TypeMismatchError instead of TypeError

The uses I see in Gecko that are standards-related are:

1) The getRandomValues case I already mentioned.
2) Something in the https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html
   implementation, but I don&apos;t know whether that error ever propagates out to
   content script.

so it might just be getRandomValues in practice.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128016</commentid>
    <comment_count>6</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2016-11-01 18:39:58 +0000</bug_when>
    <thetext>In the &quot;entries API&quot; (i.e. Chrome&apos;s directory upload, now being shipped by FF and Edge) - https://wicg.github.io/entries-api - calling dirEntry.getDirectory() with a path that resolves to a file, or dirEntry.getFile() with a path that resolves to a directory, results in a TypeMismatchError asynchronous result.

That&apos;s an odd one; it doesn&apos;t feel much like a TypeError to me, which is usually related to script types. 

This is a legacy API we&apos;re trying to standardize so we have some wiggle room as implementations converge; we managed to switch Chrome from FileError to DOMException, for example, since the names matched and we&apos;d deprecated `code`. Noting it here for completeness, tracked in the spec as https://wicg.github.io/entries-api/#issue-bfc3b40a</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128307</commentid>
    <comment_count>7</comment_count>
    <who name="Tobie Langel">tobie.langel</who>
    <bug_when>2016-12-09 12:59:48 +0000</bug_when>
    <thetext>Fixed in https://github.com/heycam/webidl/commit/c50ffc4.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>