[EME] Bug 25506 - Convert internal exception references.
authorDavid Dorwin <ddorwin@google.com>
Fri, 10 Oct 2014 14:54:36 -0700
changeset 460 57861d0e6e47
parent 459 3f14cd4554db
child 461 e3fc021a0f98
[EME] Bug 25506 - Convert internal exception references.
encrypted-media/encrypted-media-respec.html
encrypted-media/encrypted-media.js
--- a/encrypted-media/encrypted-media-respec.html	Fri Oct 10 14:54:22 2014 -0700
+++ b/encrypted-media/encrypted-media-respec.html	Fri Oct 10 14:54:36 2014 -0700
@@ -312,7 +312,7 @@
 
     <ol class="method-algorithm">
       <!-- TODO: Reference the CDM loaded during initialization instead of "<a def-id="cdm"></a> corresponding to the <a def-id="keySystem-attribute"></a> attribute". Here and elsewhere. -->
-      <li><p>If <var title="true">sessionType</var> is not supported by the <a def-id="cdm"></a> corresponding to the <a def-id="keySystem-attribute"></a> attribute, throw <a def-id="new-domexception-named"></a> <code><a href="#dfn-NotSupportedError">"NotSupportedError"</a></code>.</p></li>
+      <li><p>If <var title="true">sessionType</var> is not supported by the <a def-id="cdm"></a> corresponding to the <a def-id="keySystem-attribute"></a> attribute, throw <a def-id="new-domexception-named"></a> <a def-id="NotSupportedError"></a>.</p></li>
       <li><p>Let <var title="true">session</var> be a new <a def-id="mediakeysession"></a> object, and initialize it as follows:</p>
         <ol>
           <li><p>Let the <a def-id="sessionId"></a> attribute be the empty string.</p></li>
@@ -334,15 +334,15 @@
     <p class="note">Key systems that use such certificates should also support requesting the certificate from the server via an  additional round trip. This simplifies interoperability for applications that are not designed to provide certificates to specific key systems.</p>
 
     <ol class="method-algorithm">
-      <li><p>If <var title="true">serverCertificate</var> is an empty array, return a promise rejected with a new <a def-id="new-domexception-named"></a> <code><a href="#dfn-InvalidAccessError">"InvalidAccessError"</a></code>.</p></li>
-      <li><p>If the <a def-id="cdm"></a> corresponding to the <a def-id="keySystem-attribute"></a> attribute does not support server certificates, return a promise rejected with <a def-id="new-domexception-named"></a> <code><a href="#dfn-NotSupportedError">"NotSupportedError"</a></code>.</p></li>
+      <li><p>If <var title="true">serverCertificate</var> is an empty array, return a promise rejected with a new <a def-id="new-domexception-named"></a> <a def-id="InvalidAccessError"></a>.</p></li>
+      <li><p>If the <a def-id="cdm"></a> corresponding to the <a def-id="keySystem-attribute"></a> attribute does not support server certificates, return a promise rejected with <a def-id="new-domexception-named"></a> <a def-id="NotSupportedError"></a>.</p></li>
       <li><p>Let <var>certificate</var> be a copy of the contents of the <var title="true">serverCertificate</var> parameter.</p></li>
       <li><p>Let <var>promise</var> be a new promise.</p></li>
       <li><p>Run the following steps asynchronously:</p>
         <ol>
           <li><p>Let <var title="true">cdm</var> be the <var title="true">cdm</var> during the <a def-id="mediakeys-initialization">initialization</a> of this object.</p></li>
           <li><p>Use the <var title="true">cdm</var> to process <var>certificate</var>.</p></li>
-          <li><p>If any of the preceding steps failed, reject <var>promise</var> with <a def-id="new-domexception-named"></a> the appropriate <a href="#error-names">error name</a>.</p></li>
+          <li><p>If any of the preceding steps failed, reject <var>promise</var> with <a def-id="new-domexception-named"></a> <a def-id="appropriate-error-name"></a>.</p></li>
           <li><p>Resolve <var>promise</var>.</p></li>
         </ol>
       </li>
@@ -355,15 +355,15 @@
     <p>Creates a new <a def-id="mediakeys"></a> object for <var title="true">keySystem</var>.</p>
 
     <ol class="method-algorithm">
-      <li><p>If <var title="true">keySystem</var> is an empty string, return a promise rejected with <a def-id="new-domexception-named"></a> <code><a href="#dfn-InvalidAccessError">"InvalidAccessError"</a></code>.</p></li>
-      <li><p>If <var title="true">keySystem</var> is not one of the <a def-id="keysystems"></a> supported by the user agent, return a promise rejected with <a def-id="new-domexception-named"></a> <code><a href="#dfn-NotSupportedError">"NotSupportedError"</a></code>. String comparison is case-sensitive.</p></li>
-      <li><p>If <var title="true">keySystem</var> is not supported or not allowed in the <a def-id="origin"></a> of the calling context's <a def-id="document-concept"></a>, return a promise rejected with <a def-id="new-domexception-named"></a> <code><a href="#dfn-NotSupportedError">"NotSupportedError"</a></code>.</p></li>
+      <li><p>If <var title="true">keySystem</var> is an empty string, return a promise rejected with <a def-id="new-domexception-named"></a> <a def-id="InvalidAccessError"></a>.</p></li>
+      <li><p>If <var title="true">keySystem</var> is not one of the <a def-id="keysystems"></a> supported by the user agent, return a promise rejected with <a def-id="new-domexception-named"></a> <a def-id="NotSupportedError"></a>. String comparison is case-sensitive.</p></li>
+      <li><p>If <var title="true">keySystem</var> is not supported or not allowed in the <a def-id="origin"></a> of the calling context's <a def-id="document-concept"></a>, return a promise rejected with <a def-id="new-domexception-named"></a> <a def-id="NotSupportedError"></a>.</p></li>
       <li><p>Let <var>promise</var> be a new promise.</p></li>
       <li><p>Run the following steps asynchronously:</p>
         <ol>
           <li><p>Let <var title="true">cdm</var> be the <a def-id="cdm"></a> corresponding to <var title="true">keySystem</var>.</p></li>
           <li><p>Load and initialize the <var title="true">cdm</var> if necessary.</p></li>
-          <li><p>If <var title="true">cdm</var> fails to load or initialize, reject <var>promise</var> with <a def-id="new-domexception-named"></a> the appropriate <a href="#error-names">error name</a>.</p></li>
+          <li><p>If <var title="true">cdm</var> fails to load or initialize, reject <var>promise</var> with <a def-id="new-domexception-named"></a> <a def-id="appropriate-error-name"></a>.</p></li>
 
           <li>
             <p>Let <var title="true">media keys</var> be a new <a def-id="mediakeys"></a> object, and initialize it as follows:</p>
@@ -501,18 +501,18 @@
     </p>
 
     <ol class="method-algorithm">
-      <li><p>If this object's <var title="true">uninitialized</var> value is false, return a promise rejected with <a def-id="new-domexception-named"></a> <code><a href="#dfn-InvalidStateError">"InvalidStateError"</a></code>.</p></li>
+      <li><p>If this object's <var title="true">uninitialized</var> value is false, return a promise rejected with <a def-id="new-domexception-named"></a> <a def-id="InvalidStateError"></a>.</p></li>
       <li><p>Let this object's <var title="true">uninitialized</var> be false.</p></li><!-- For simplicity and consistency, this object cannot be reused after any failure. -->
-      <li><p>If <var title="true">initDataType</var> is an empty string, return a promise rejected with <a def-id="new-domexception-named"></a> <code><a href="#dfn-InvalidAccessError">"InvalidAccessError"</a></code>.</p></li>
-      <li><p>If <var title="true">initData</var> is an empty array, return a promise rejected with <a def-id="new-domexception-named"></a> <code><a href="#dfn-InvalidAccessError">"InvalidAccessError"</a></code>.</p></li>
+      <li><p>If <var title="true">initDataType</var> is an empty string, return a promise rejected with <a def-id="new-domexception-named"></a> <a def-id="InvalidAccessError"></a>.</p></li>
+      <li><p>If <var title="true">initData</var> is an empty array, return a promise rejected with <a def-id="new-domexception-named"></a> <a def-id="InvalidAccessError"></a>.</p></li>
       <li><p>Let <var title="true">media keys</var> be the <a def-id="mediakeys"></a> object that created this object.</p></li>
-      <li><p>If the <a def-id="cdm"></a> corresponding to <var title="true">media keys</var>'s <a def-id="keySystem-attribute"></a> attribute does not support <var title="true">initDataType</var> as an <a def-id="initialization-data-type"></a>, return a promise rejected with <a def-id="new-domexception-named"></a> <code><a href="#dfn-NotSupportedError">"NotSupportedError"</a></code>. String comparison is case-sensitive.</p></li>
+      <li><p>If the <a def-id="cdm"></a> corresponding to <var title="true">media keys</var>'s <a def-id="keySystem-attribute"></a> attribute does not support <var title="true">initDataType</var> as an <a def-id="initialization-data-type"></a>, return a promise rejected with <a def-id="new-domexception-named"></a> <a def-id="NotSupportedError"></a>. String comparison is case-sensitive.</p></li>
       <li><p>Let <var>init data</var> be a copy of the contents of the <var title="true">initData</var> parameter.</p></li>
       <li><p>Let <var title="true">session type</var> be this object's <var title="true">session type</var>.</p></li>
       <li><p>Let <var>promise</var> be a new promise.</p></li>
       <li><p>Run the following steps asynchronously:</p>
         <ol>
-          <li><p>If the <var>init data</var> is not valid for <var title="true">initDataType</var>, reject <var>promise</var> with <a def-id="new-domexception-named"></a> <code><a href="#dfn-InvalidAccessError">"InvalidAccessError"</a></code>.</p></li>
+          <li><p>If the <var>init data</var> is not valid for <var title="true">initDataType</var>, reject <var>promise</var> with <a def-id="new-domexception-named"></a> <a def-id="InvalidAccessError"></a>.</p></li>
           <li><p>Let <var>sanitized init data</var> be a validated and/or sanitized version of <var>init data</var>.</p>
             <p class="note">The user agent should thoroughly validate the Initialization Data before passing it to the CDM.
               This may include verifying values are within reasonable limits, stripping irrelevant data or fields, pre-parsing it, sanitizing it, and/or generating a fully sanitized version.
@@ -521,13 +521,13 @@
               For Initialization Data formats that support multiple entries, the user agent should remove entries that are not needed by the CDM.
             </p>
           </li>
-          <li><p>If the previous step failed, reject <var>promise</var> with <a def-id="new-domexception-named"></a> <code><a href="#dfn-InvalidAccessError">"InvalidAccessError"</a></code>.</p></li>
+          <li><p>If the previous step failed, reject <var>promise</var> with <a def-id="new-domexception-named"></a> <a def-id="InvalidAccessError"></a>.</p></li>
           <li><p>Let <var title="true">session id</var> be the empty string.</p></li>
           <li><p>Let <var title="true">message</var> be null.</p></li>
           <li><p>Let <var title="true">cdm</var> be the CDM loaded during the <a def-id="mediakeys-initialization">initialization</a> of <var title="true">media keys</var>.</p></li>
           <li><p>Use the <var title="true">cdm</var> to execute the following steps:</p>
             <ol>
-              <li><p>If the <var>init data</var> is not supported by the <var title="true">cdm</var>, reject <var>promise</var> with <a def-id="new-domexception-named"></a> <code><a href="#dfn-NotSupportedError">"NotSupportedError"</a></code>.</p></li>
+              <li><p>If the <var>init data</var> is not supported by the <var title="true">cdm</var>, reject <var>promise</var> with <a def-id="new-domexception-named"></a> <a def-id="NotSupportedError"></a>.</p></li>
               <li><p>Follow the steps for the first matching condition from the following list:</p>
                 <dl class="switch">
                   <dt>If <var title="true">session type</var> is <a def-id="temporary-session"></a></dt>
@@ -552,7 +552,7 @@
               </li>
             </ol>
           </li>
-          <li><p>If any of the preceding steps failed, reject <var>promise</var> with <a def-id="new-domexception-named"></a> the appropriate <a href="#error-names">error name</a>.</p></li>
+          <li><p>If any of the preceding steps failed, reject <var>promise</var> with <a def-id="new-domexception-named"></a> <a def-id="appropriate-error-name"></a>.</p></li>
           <li><p>Set the <a def-id="sessionId"></a> attribute to <var title="true">session id</var>.</p></li>
           <li><p>Let this object's <var title="true">callable</var> be true.</p></li>
           <li><p>Run the <a href="#algorithms-queue-message">Queue a "message" Event</a> algorithm on the <var title="true">session</var>, providing <a def-id="message-type-licenserequest"></a> and <var title="true">message</var>.</p></li>
@@ -568,12 +568,12 @@
     <p>Loads the data stored for the <var title="true">sessionId</var> into the session represented by the object.</p>
 
     <ol class="method-algorithm">
-      <li><p>If this object's <var title="true">uninitialized</var> value is false, return a promise rejected with <a def-id="new-domexception-named"></a> <code><a href="#dfn-InvalidStateError">"InvalidStateError"</a></code>.</p></li>
+      <li><p>If this object's <var title="true">uninitialized</var> value is false, return a promise rejected with <a def-id="new-domexception-named"></a> <a def-id="InvalidStateError"></a>.</p></li>
       <li><p>Let this object's <var title="true">uninitialized</var> be false.</p></li><!-- For simplicity and consistency, this object cannot be reused after any failure. -->
-      <li><p>If <var title="true">sessionId</var> is an empty string, return a promise rejected with <a def-id="new-domexception-named"></a> <code><a href="#dfn-InvalidAccessError">"InvalidAccessError"</a></code>.</p></li>
-      <li><p>If this object's <var title="true">session type</var> is not <a def-id="persistent-session"></a>, return a promise rejected with <a def-id="new-domexception-named"></a> <code><a href="#dfn-InvalidAccessError">"InvalidAccessError"</a></code>.</p></li>
+      <li><p>If <var title="true">sessionId</var> is an empty string, return a promise rejected with <a def-id="new-domexception-named"></a> <a def-id="InvalidAccessError"></a>.</p></li>
+      <li><p>If this object's <var title="true">session type</var> is not <a def-id="persistent-session"></a>, return a promise rejected with <a def-id="new-domexception-named"></a> <a def-id="InvalidAccessError"></a>.</p></li>
       <li><p>Let <var title="true">media keys</var> be the <a def-id="mediakeys"></a> object that created this object.</p></li>
-      <li><p>If the <a def-id="cdm"></a> corresponding to <var title="true">media keys</var>'s <a def-id="keySystem-attribute"></a> attribute does not support loading previous sessions, return a promise rejected with <a def-id="new-domexception-named"></a> <code><a href="#dfn-NotSupportedError">"NotSupportedError"</a></code>.</p></li>
+      <li><p>If the <a def-id="cdm"></a> corresponding to <var title="true">media keys</var>'s <a def-id="keySystem-attribute"></a> attribute does not support loading previous sessions, return a promise rejected with <a def-id="new-domexception-named"></a> <a def-id="NotSupportedError"></a>.</p></li>
       <li><p>Let <var>promise</var> be a new promise.</p></li>
       <li><p>Run the following steps asynchronously:</p>
         <ol>
@@ -582,7 +582,7 @@
               At a minimum, this should include checking that the length and value (e.g. alphanumeric) are reasonable.
             </p>
           </li>
-          <li><p>If the previous step failed, reject <var>promise</var> with <a def-id="new-domexception-named"></a> <code><a href="#dfn-InvalidAccessError">"InvalidAccessError"</a></code>.</p></li>
+          <li><p>If the previous step failed, reject <var>promise</var> with <a def-id="new-domexception-named"></a> <a def-id="InvalidAccessError"></a>.</p></li>
           <li><p>Let <var title="true">expiration time</var> be <code>NaN</code>.</p></li>
           <li><p>Let <var title="true">message</var> be null.</p></li>
           <li><p>Let <var title="true">message type</var> be null.</p></li>
@@ -593,7 +593,7 @@
               <li><p>If there is no data stored for the <var>sanitized session ID</var> in the <var title="true">origin</var>, resolve <var>promise</var> with <code>false</code>.</p></li><!-- Per https://github.com/w3ctag/promises-guide#rejections-should-be-used-for-exceptional-situations. -->
               <li><p>Let <var title="true">session data</var> be the data stored for the <var>sanitized session ID</var> in the <var title="true">origin</var>.
               This must not include data from other origin(s) or that is not associated with an origin.</p></li>
-              <li><p>If there is an unclosed <a def-id="persistent-session"></a> session in any <a def-id="document-concept"></a> representing the <var title="true">session data</var>, reject <var>promise</var> with <a def-id="new-domexception-named"></a> <code><a href="#dfn-QuotaExceededError">"QuotaExceededError"</a></code>.</p>
+              <li><p>If there is an unclosed <a def-id="persistent-session"></a> session in any <a def-id="document-concept"></a> representing the <var title="true">session data</var>, reject <var>promise</var> with <a def-id="new-domexception-named"></a> <a def-id="QuotaExceededError"></a>.</p>
                 <p class="note">In other words, do not create a session if a non-closed persistent session already exists for this <var>sanitized session ID</var> in any browsing context.</p>
               </li>
               <li><p>Load the <var title="true">session data</var>.</p></li>
@@ -606,7 +606,7 @@
               </li>
             </ol>
           </li>
-          <li><p>If any of the preceding steps failed, reject <var>promise</var> with <a def-id="new-domexception-named"></a> the appropriate <a href="#error-names">error name</a>.</p></li>
+          <li><p>If any of the preceding steps failed, reject <var>promise</var> with <a def-id="new-domexception-named"></a> <a def-id="appropriate-error-name"></a>.</p></li>
           <li><p>Set the <a def-id="sessionId"></a> attribute to <var>sanitized session ID</var>.</p></li>
           <li><p>Let this object's <var title="true">callable</var> be true.</p></li>
           <li><p>If the loaded session contains usable keys, run the <a href="#algorithms-keys-changed">Usable Keys Changed</a> algorithm on the <var title="true">session</var>.</p>
@@ -627,8 +627,8 @@
     <p class="note">The contents of <var title="true">response</var> are <a def-id="keysystem"></a>-specific.</p>
 
     <ol class="method-algorithm">
-      <li><p>If this object's <var title="true">callable</var> value is false, return a promise rejected with <a def-id="new-domexception-named"></a> <code><a href="#dfn-InvalidStateError">"InvalidStateError"</a></code>.</p></li>
-      <li><p>If <var title="true">response</var> is an empty array, return a promise rejected with <a def-id="new-domexception-named"></a> <code><a href="#dfn-InvalidAccessError">"InvalidAccessError"</a></code>.</p></li>
+      <li><p>If this object's <var title="true">callable</var> value is false, return a promise rejected with <a def-id="new-domexception-named"></a> <a def-id="InvalidStateError"></a>.</p></li>
+      <li><p>If <var title="true">response</var> is an empty array, return a promise rejected with <a def-id="new-domexception-named"></a> <a def-id="InvalidAccessError"></a>.</p></li>
       <li><p>Let <var>response copy</var> be a copy of the contents of the <var title="true">response</var> parameter.</p></li>
       <li><p>Let <var>promise</var> be a new promise.</p></li>
       <li><p>Run the following steps asynchronously:</p>
@@ -640,13 +640,13 @@
               Unknown fields should be rejected or removed.
             </p>
           </li>
-          <li><p>If the previous step failed, reject <var>promise</var> with <a def-id="new-domexception-named"></a> <code><a href="#dfn-InvalidAccessError">"InvalidAccessError"</a></code>.</p></li>
+          <li><p>If the previous step failed, reject <var>promise</var> with <a def-id="new-domexception-named"></a> <a def-id="InvalidAccessError"></a>.</p></li>
           <li><p>Let <var title="true">cdm</var> be the CDM loaded during the <a def-id="mediakeys-initialization">initialization</a> of the <a def-id="mediakeys"></a> object that created this object.</p></li>
           <li><p>Let <var title="true">message</var> be null.</p></li>
           <li><p>Let <var title="true">message type</var> be null.</p></li>
           <li><p>Use the <var title="true">cdm</var> to execute the following steps:</p>
             <ol>
-              <li><p>If the format of <var>sanitized response</var> is invalid in any way, reject <var>promise</var> with <a def-id="new-domexception-named"></a> <code><a href="#dfn-InvalidAccessError">"InvalidAccessError"</a></code>.</p></li>
+              <li><p>If the format of <var>sanitized response</var> is invalid in any way, reject <var>promise</var> with <a def-id="new-domexception-named"></a> <a def-id="InvalidAccessError"></a>.</p></li>
               <li><p>Process <var>sanitized response</var>, following the stipulation for the first matching condition from the following list:</p>
                 <dl class="switch">
                   <dt>If <var title="true">sessionType</var> is <a def-id="temporary-session"></a> and <var>sanitized response</var> does not specify that session data, including any license, key(s), or similar session data it contains, should be stored</dt>
@@ -656,7 +656,7 @@
                     Such data must be stored such that only the <a def-id="origin"></a> of this object's <a def-id="document-concept"></a> can access it.
                   </dd>
                   <dt>Otherwise</dt>
-                  <dd>Reject <var>promise</var> with <a def-id="new-domexception-named"></a> <code><a href="#dfn-InvalidAccessError">"InvalidAccessError"</a></code>.</dd>
+                  <dd>Reject <var>promise</var> with <a def-id="new-domexception-named"></a> <a def-id="InvalidAccessError"></a>.</dd>
                 </dl>
                 <p>See also <a href="#session-storage">Session Storage and Persistence</a>.</p>
                 <p class="note">When <var>sanitized response</var> contains key(s) and/or related data, <var title="true">cdm</var> will likely cache the key and related data indexed by key ID.</p>
@@ -678,7 +678,7 @@
               </li>
             </ol>
           </li>
-          <li><p>If any of the preceding steps failed, reject <var>promise</var> with <a def-id="new-domexception-named"></a> the appropriate <a href="#error-names">error name</a>.</p></li>
+          <li><p>If any of the preceding steps failed, reject <var>promise</var> with <a def-id="new-domexception-named"></a> <a def-id="appropriate-error-name"></a>.</p></li>
           <li><p>If <var title="true">message</var> is not null, run the <a href="#algorithms-queue-message">Queue a "message" Event</a> algorithm on the <var title="true">session</var>, providing <var title="true">message type</var> and <var title="true">message</var>.</p></li>
           <li><p>Resolve <var>promise</var>.</p></li>
         </ol>
@@ -693,7 +693,7 @@
     <p class="note">The returned promise is resolved when the request has been processed, and the <a def-id="closed"></a> attribute promise is resolved when the session is closed.</p>
 
     <ol class="method-algorithm">
-      <li><p>If this object's <var title="true">callable</var> value is false, return a promise rejected with <a def-id="new-domexception-named"></a> <code><a href="#dfn-InvalidStateError">"InvalidStateError"</a></code>.</p></li>
+      <li><p>If this object's <var title="true">callable</var> value is false, return a promise rejected with <a def-id="new-domexception-named"></a> <a def-id="InvalidStateError"></a>.</p></li>
       <li><p>If the <a href="#algorithms-session-close">Session Close</a> algorithm has been run on this object, return a resolved promise.</p></li>
       <li><p>Let <var>promise</var> be a new promise.</p></li>
       <li><p>Run the following steps asynchronously:</p>
@@ -720,9 +720,9 @@
     <p>Removes stored session data associated with this object.</p>
 
     <ol class="method-algorithm">
-      <li><p>If this object's <var title="true">callable</var> value is false, return a promise rejected with <a def-id="new-domexception-named"></a> <code><a href="#dfn-InvalidStateError">"InvalidStateError"</a></code>.</p></li>
-      <li><p>If this object's <var title="true">session type</var> is not <a def-id="persistent-session"></a>, return a promise rejected with <a def-id="new-domexception-named"></a> <code><a href="#dfn-InvalidAccessError">"InvalidAccessError"</a></code>.</p></li>
-      <li><p>If the <a href="#algorithms-session-close">Session Close</a> algorithm has been run on this object, return a promise rejected with <a def-id="new-domexception-named"></a> <code><a href="#dfn-InvalidStateError">"InvalidStateError"</a></code>.</p></li>
+      <li><p>If this object's <var title="true">callable</var> value is false, return a promise rejected with <a def-id="new-domexception-named"></a> <a def-id="InvalidStateError"></a>.</p></li>
+      <li><p>If this object's <var title="true">session type</var> is not <a def-id="persistent-session"></a>, return a promise rejected with <a def-id="new-domexception-named"></a> <a def-id="InvalidAccessError"></a>.</p></li>
+      <li><p>If the <a href="#algorithms-session-close">Session Close</a> algorithm has been run on this object, return a promise rejected with <a def-id="new-domexception-named"></a> <a def-id="InvalidStateError"></a>.</p></li>
       <li><p>Let <var>promise</var> be a new promise.</p></li>
       <li><p>Run the following steps asynchronously:</p>
         <ol>
@@ -739,7 +739,7 @@
           </li>
           <li><p>Run the following steps asynchronously once the above step has completed:</p>
             <ol>
-              <li><p>If any of the preceding steps failed, reject <var>promise</var> with <a def-id="new-domexception-named"></a> the appropriate <a href="#error-names">error name</a>.</p></li>
+              <li><p>If any of the preceding steps failed, reject <var>promise</var> with <a def-id="new-domexception-named"></a> <a def-id="appropriate-error-name"></a>.</p></li>
               <li><p>Run the <a href="#algorithms-session-close">Session Close</a> algorithm on this object.</p></li>
               <li><p>Resolve <var>promise</var>.</p></li>
             </ol>
@@ -756,7 +756,7 @@
     <p>Gets the key IDs for keys in the session that the CDM <em>knows</em> are currently usable to decrypt <a def-id="media-data"></a>.</p>
     
     <ol class="method-algorithm">
-      <li><p>If this object's <var title="true">callable</var> value is false, return a promise rejected with <a def-id="new-domexception-named"></a> <code><a href="#dfn-InvalidStateError">"InvalidStateError"</a></code>.</p></li>
+      <li><p>If this object's <var title="true">callable</var> value is false, return a promise rejected with <a def-id="new-domexception-named"></a> <a def-id="InvalidStateError"></a>.</p></li>
       <li><p>Let <var>promise</var> be a new promise.</p></li>
       <li><p>Run the following steps asynchronously:</p>
         <ol>
@@ -767,7 +767,7 @@
             </ol>
           </li>
           <li>
-            <p>If the preceding step failed, reject <var>promise</var> with <a def-id="new-domexception-named"></a> the appropriate <a href="#error-names">error name</a>.</p>
+            <p>If the preceding step failed, reject <var>promise</var> with <a def-id="new-domexception-named"></a> <a def-id="appropriate-error-name"></a>.</p>
           </li>
           <li>
             <p>Resolve <var>promise</var> with a new Sequence object, each element of which contains one element of <var title="true">usable key ids</var>.</p>
@@ -1047,20 +1047,20 @@
     <ol class="method-algorithm">
       <!-- For simplicity and consistency, do not allow multiple pending calls. -->
       <li><p>If <var>mediaKeys</var> and the <a def-id="mediaKeys-attribute"></a> attribute are the same object, return a resolved promise.</p></li>
-      <li><p>If this object's <var title="true">attaching media keys</var> value is true, return a promise rejected with <a def-id="new-domexception-named"></a> <code><a href="#dfn-InvalidStateError">"InvalidStateError"</a></code>.</p></li>
+      <li><p>If this object's <var title="true">attaching media keys</var> value is true, return a promise rejected with <a def-id="new-domexception-named"></a> <a def-id="InvalidStateError"></a>.</p></li>
       <li><p>Let this object's <var title="true">attaching media keys</var> value be true.</p></li>
       <li><p>Let <var>promise</var> be a new promise.</p></li>
       <li><p>Run the following steps asynchronously:</p>
         <ol>
-          <li><p>If <var>mediaKeys</var> is not null, it is already in use by another media element, and the user agent is unable to use it with this element, let this object's <var title="true">attaching media keys</var> value be false and reject <var>promise</var> with <a def-id="new-domexception-named"></a> <code><a href="#dfn-QuotaExceededError">"QuotaExceededError"</a></code>.</p></li>
+          <li><p>If <var>mediaKeys</var> is not null, it is already in use by another media element, and the user agent is unable to use it with this element, let this object's <var title="true">attaching media keys</var> value be false and reject <var>promise</var> with <a def-id="new-domexception-named"></a> <a def-id="QuotaExceededError"></a>.</p></li>
           <li><p>If the <a def-id="mediaKeys-attribute"></a> attribute is not null, run the following steps:</p>
             <ol>
-              <li><p>If the user agent or CDM do not support removing the association, let this object's <var title="true">attaching media keys</var> value be false and reject <var>promise</var> with <a def-id="new-domexception-named"></a> <code><a href="#dfn-NotSupportedError">"NotSupportedError"</a></code>.</p></li>
-              <li><p>If the association cannot currently be removed, let this object's <var title="true">attaching media keys</var> value be false and reject <var>promise</var> with <a def-id="new-domexception-named"></a> <code><a href="#dfn-InvalidStateError">"InvalidStateError"</a></code>.</p>
+              <li><p>If the user agent or CDM do not support removing the association, let this object's <var title="true">attaching media keys</var> value be false and reject <var>promise</var> with <a def-id="new-domexception-named"></a> <a def-id="NotSupportedError"></a>.</p></li>
+              <li><p>If the association cannot currently be removed, let this object's <var title="true">attaching media keys</var> value be false and reject <var>promise</var> with <a def-id="new-domexception-named"></a> <a def-id="InvalidStateError"></a>.</p>
                 <p class="note">For example, some implementations may not allow removal during playback.</p>
               </li>
               <li><p>Stop using the CDM instance represented by the <a def-id="mediaKeys-attribute"></a> attribute to decrypt <a def-id="media-data"></a> and remove the association with the media element.</p></li>
-              <li><p>If the preceding step failed, let this object's <var title="true">attaching media keys</var> value be false and reject <var>promise</var> with <a def-id="new-domexception-named"></a> the appropriate <a href="#error-names">error name</a>.</p></li>
+              <li><p>If the preceding step failed, let this object's <var title="true">attaching media keys</var> value be false and reject <var>promise</var> with <a def-id="new-domexception-named"></a> <a def-id="appropriate-error-name"></a>.</p></li>
             </ol>
           </li>
           <li><p>If <var>mediaKeys</var> is not null, run the following steps:</p>
@@ -1070,7 +1070,7 @@
                 <ol>
                   <li><p>Set the <a def-id="mediaKeys-attribute"></a> attribute to null.</p></li><!-- In case it was previously not null since the previous association has been removed. -->
                   <li><p>Let this object's <var title="true">attaching media keys</var> value be false.</p></li>
-                  <li><p>Reject <var>promise</var> with <a def-id="new-domexception-named"></a> the appropriate <a href="#error-names">error name</a>.</p></li>
+                  <li><p>Reject <var>promise</var> with <a def-id="new-domexception-named"></a> <a def-id="appropriate-error-name"></a>.</p></li>
                 </ol>
               </li>
               <li><p><a def-id="Queue-a-task-to-run-algorithm"></a> <a href="#algorithms-resume-playback">Attempt to Resume Playback If Necessary</a> algorithm on the media element.</p>
--- a/encrypted-media/encrypted-media.js	Fri Oct 10 14:54:22 2014 -0700
+++ b/encrypted-media/encrypted-media.js	Fri Oct 10 14:54:36 2014 -0700
@@ -89,6 +89,15 @@
     df.appendChild($("<code/>").wrapInner($("<a/>").attr({href: DOM_spec_url + '#dom-domexception-' + id}).text(text))[0]);
   }
 
+  function local_exception_helper(doc, df, id, text) {
+    df.appendChild($("<code/>").wrapInner($("<a/>").attr({href: url_helper(doc, "#dfn-" + text)}).text(text))[0]);
+  }
+
+  function appropriate_error_name_helper(doc, df, id, text) {
+    df.appendChild(doc.createTextNode('the appropriate '));
+    term_helper(doc, df, 'error-names', 'error name');
+  }
+  
   function webmref_helper(doc, df, id, text) {
     link_helper(doc, df, 'http://www.webmproject.org/code/specs/container/#' + id, text);
   }
@@ -210,6 +219,12 @@
     'encrypted-event-initdatatype-attribute': { func: idlref_helper, fragment: 'widl-MediaEncryptedEventInit-initDataType', link_text: 'initDataType',  },
     'encrypted-event-initdata-attribute': { func: idlref_helper, fragment: 'widl-MediaEncryptedEventInit-initData', link_text: 'initData',  },
 
+    'NotSupportedError': { func: local_exception_helper, fragment: '', link_text: 'NotSupportedError'  },
+    'InvalidStateError': { func: local_exception_helper, fragment: '', link_text: 'InvalidStateError'  },
+    'InvalidAccessError': { func: local_exception_helper, fragment: '', link_text: 'InvalidAccessError'  },
+    'QuotaExceededError': { func: local_exception_helper, fragment: '', link_text: 'QuotaExceededError'  },
+    'appropriate-error-name': { func: appropriate_error_name_helper, fragment: '', },
+
     'interface-textdecoder': { func: encodingapi_helper, fragment: 'interface-textdecoder', link_text: 'TextDecoder interface',  },
     'interface-textencoder': { func: encodingapi_helper, fragment: 'interface-textencoder', link_text: 'TextEncoder interface',  },