[EME] Bug 25506 - Convert IDL for MediaKeySession.
authorDavid Dorwin <ddorwin@google.com>
Fri, 10 Oct 2014 14:43:57 -0700
changeset 454 51e766999bd6
parent 453 ca4a8e0cde5d
child 455 46fe11794010
[EME] Bug 25506 - Convert IDL for MediaKeySession.
encrypted-media/encrypted-media-respec.html
encrypted-media/encrypted-media.js
encrypted-media/spec-html.xsl
--- a/encrypted-media/encrypted-media-respec.html	Fri Oct 10 14:43:23 2014 -0700
+++ b/encrypted-media/encrypted-media-respec.html	Fri Oct 10 14:43:57 2014 -0700
@@ -157,18 +157,18 @@
     <section id="key-session">
     <h4>Key Session</h4>
     <p>A Key Session, or simply Session, provides a context for message exchange with the CDM as a result of which key(s) are made available to be <a href="#cdm">CDM</a>.
-    Sessions are embodied as <coderef>MediaKeySession</coderef> objects.
-    Each Key session is associated with a single instance of <a href="#initialization-data">Initialization Data</a> provided in the <methodref>generateRequest</methodref> call.
+    Sessions are embodied as <a def-id="mediakeysession"></a> objects.
+    Each Key session is associated with a single instance of <a href="#initialization-data">Initialization Data</a> provided in the <a def-id="generateRequest"></a> call.
     </p>
     <p>Each Key Session is associated with a single <a def-id="mediakeys"></a> object, and only <a href="#htmlmediaelement-extensions">media element(s)</a> associated with that object may access key(s) associated with the session.
     Other <a def-id="mediakeys"></a> objects, <a href="#cdm">CDM</a> instances, and media elements may <em>not</em> access the key session or use its key(s).
-    Key sessions and the keys they contain are no longer usable by the CDM for decryption when the <a href="#algorithms-session-close">session is closed</a>, including when the <coderef>MediaKeySession</coderef> object is destroyed.
+    Key sessions and the keys they contain are no longer usable by the CDM for decryption when the <a href="#algorithms-session-close">session is closed</a>, including when the <a def-id="mediakeysession"></a> object is destroyed.
     </p>
     </section>
 
     <section id="session-id">
     <h4>Session ID</h4>
-    <p>A Session ID is a unique string identifier generated by the <a href="#cdm">CDM</a> that can be used by the application to identify <coderef>MediaKeySession</coderef> objects.</p>
+    <p>A Session ID is a unique string identifier generated by the <a href="#cdm">CDM</a> that can be used by the application to identify <a def-id="mediakeysession"></a> objects.</p>
 
     <p>A new Session ID is generated each time the user agent and CDM successfully create a new session.</p>
 
@@ -184,7 +184,7 @@
     <p>Unless otherwise stated, key refers to a decryption key that can be used to decrypt blocks within <a def-id="media-data"></a>.
     Each such key is uniquely identified by a <a href="#decryption-key-id">key ID</a>.
     A key is associated with the <a href="#key-session">session</a> used to provide it to the CDM. (The same key may be present in multiple sessions.)
-    Such keys may only be provided to the <a href="#cdm">CDM</a> via an <methodref>update</methodref> call. (They may later be loaded by <methodref>load</methodref> as part of the stored session data.)
+    Such keys may only be provided to the <a href="#cdm">CDM</a> via an <a def-id="update"></a> call. (They may later be loaded by <a def-id="load"></a> as part of the stored session data.)
     </p>
     
     <p>A key is considered <em>usable</em> if the CDM is certain the key is currently usable for decryption.</p>
@@ -298,16 +298,16 @@
       <dt>MediaKeySession createSession(optional SessionType sessionType = "temporary")</dt>
       <dd>
     <!-- TODO: Fix indentation here and for all other methods. -->
-    <p>Returns a new <coderef>MediaKeySession</coderef> object.</p>
+    <p>Returns a new <a def-id="mediakeysession"></a> object.</p>
 
     <ol class="method-algorithm">
       <!-- TODO: Reference the CDM loaded during initialization instead of "<a href="#cdm">content decryption module</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 href="#cdm">content decryption module</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>Let <var title="true">session</var> be a new <coderef>MediaKeySession</coderef> object, and initialize it as follows:</p>
+      <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 <coderef>sessionId</coderef> attribute be the empty string.</p></li>
-          <li><p>Let the <coderef>expiration</coderef> attribute be <code>NaN</code>.</p></li>
-          <li><p>Let the <coderef>closed</coderef> attribute be a new promise.</p></li>
+          <li><p>Let the <a def-id="sessionId"></a> attribute be the empty string.</p></li>
+          <li><p>Let the <a def-id="expiration"></a> attribute be <code>NaN</code>.</p></li>
+          <li><p>Let the <a def-id="closed"></a> attribute be a new promise.</p></li>
           <li><p>Let the <var title="true">session type</var> be <var title="true">sessionType</var>.</p></li>
           <li><p>Let <var title="true">uninitialized</var> be true.</p></li>
           <li><p>Let <var title="true">callable</var> be false.</p></li>
@@ -462,44 +462,30 @@
     <section id="mediakeysession">
     <h2>MediaKeySession Object</h2>
     <p>The MediaKeySession object represents a <a href="#key-session">key session</a>.</p>
-    <pre class="was-idl">
-interface <precodedfn>MediaKeySession</precodedfn> : <dom4ref name="eventtarget">EventTarget</dom4ref> {
-  // session properties
-  readonly attribute DOMString <precoderef>sessionId</precoderef>;
-  readonly attribute unrestricted double <precoderef>expiration</precoderef>;
-  readonly attribute Promise&lt;void&gt; <precoderef>closed</precoderef>;
-
-  // session initialization
-  Promise&lt;void&gt; <premethodref>generateRequest</premethodref>(DOMString <a href="#initialization-data-type">initDataType</a>, (ArrayBuffer or ArrayBufferView) initData);
-  Promise&lt;boolean&gt; <premethodref>load</premethodref>(DOMString sessionId);
 
-  // session operations
-  Promise&lt;void&gt; <premethodref>update</premethodref>((ArrayBuffer or ArrayBufferView) response);
-  Promise&lt;void&gt; <premethodref>close</premethodref>();
-  Promise&lt;void&gt; <premethodref>remove</premethodref>();
-  
-  Promise&lt;sequence&lt;ArrayBuffer&gt;&gt; <premethodref>getUsableKeyIds</premethodref>();
-};
-</pre>
-
-    <section id="mediakeysession-attributes">
-    <h3>Attributes</h3>
-
-    <p>The <codedfn>sessionId</codedfn> attribute is the <a href="#session-id">Session ID</a> for this object and the associated key(s) or license(s).</p>
-
-    <p>The <codedfn>expiration</codedfn> attribute is the time, in milliseconds since 01 January, 1970 UTC, after which the key(s) in the session will no longer be usable to decrypt <a def-id="media-data"></a>, or <code>NaN</code> if no such time exists, as determined by the CDM.
-    </p>
-
-    <p>The <codedfn>closed</codedfn> attribute signals when object becomes closed as a result of the <a href="#algorithms-session-close">Session Close</a> algorithm being run.
-    This promise can only be fulfilled and is never rejected.</p>
-    </section>
-
-    <section id="mediakeysession-methods">
-    <h3>Methods</h3>
     <p>For methods that return a promise, all errors are reported asynchronously by rejecting the returned Promise. This includes WebIDL type mapping errors.</p>
     <p>The steps of an algorithm are always aborted when resolving or rejecting a promise.</p>
 
-    <p>The <methoddfn name="generateRequest">generateRequest(<var title="true">initDataType</var>, <var title="true">initData</var>)</methoddfn> method generates a request based on the <var title="true">initData</var>.</p>
+    <dl title="interface MediaKeySession : EventTarget" class='idl'>
+      <dt>readonly attribute DOMString sessionId</dt>
+      <dd>
+        <p>The <a href="#session-id">Session ID</a> for this object and the associated key(s) or license(s).</p>
+      </dd>
+
+      <dt>readonly attribute unrestricted double expiration</dt>
+      <dd>
+        <p>The time, in milliseconds since 01 January, 1970 UTC, after which the key(s) in the session will no longer be usable to decrypt <a def-id="media-data"></a>, or <code>NaN</code> if no such time exists, as determined by the CDM.</p>
+      </dd>
+
+      <dt>readonly attribute Promise&lt;void&gt; closed</dt>
+      <dd>
+        <p>Signals when object becomes closed as a result of the <a href="#algorithms-session-close">Session Close</a> algorithm being run.
+        This promise can only be fulfilled and is never rejected.</p>
+      </dd>
+    
+      <dt>Promise&lt;void&gt; generateRequest(DOMString initDataType, (ArrayBuffer or ArrayBufferView) initData)</dt>
+      <dd>
+    <p>Generates a request based on the <var title="true">initData</var>.</p>
     <p><var title="true">initData</var> is <a href="#initialization-data">Initialization Data</a>, and
     <var title="true">initDataType</var> is an <a href="#initialization-data-type">initialization data type</a> that indicates how to interpret <var title="true">initData</var>.
     </p>
@@ -557,7 +543,7 @@
             </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>Set the <coderef>sessionId</coderef> attribute to <var title="true">session id</var>.</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>
           <li><p>Resolve <var>promise</var>.</p></li>
@@ -565,8 +551,11 @@
       </li>
       <li><p>Return <var>promise</var>.</p></li>
     </ol>
+      </dd>
 
-    <p>The <methoddfn name="load">load(<var title="true">sessionId</var>)</methoddfn> method loads the data stored for the <var title="true">sessionId</var> into the session represented by the object.</p>
+      <dt>Promise&lt;boolean&gt; load(DOMString sessionId)</dt>
+      <dd>
+    <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>
@@ -608,7 +597,7 @@
             </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>Set the <coderef>sessionId</coderef> attribute to <var>sanitized session ID</var>.</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>
             <p>The algorithm may also be run later should additional processing be necessary to determine with certainty whether one or more keys is usable.</p>
@@ -620,8 +609,11 @@
       </li>
       <li><p>Return <var>promise</var>.</p></li>
     </ol>
-
-    <p>The <methoddfn name="update">update(<var title="true">response</var>)</methoddfn> method provides messages, including licenses, to the CDM.</p>
+      </dd>
+    
+      <dt>Promise&lt;void&gt; update((ArrayBuffer or ArrayBufferView) response)</dt>
+      <dd>
+    <p>Provides messages, including licenses, to the CDM.</p>
     <p class="note">The contents of <var title="true">response</var> are <var title="true"><a href="#key-system">keySystem</a></var>-specific.</p>
 
     <ol class="method-algorithm">
@@ -660,7 +652,7 @@
                 <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>
                 <p class="note">The replacement algorithm within a session is <a href="#key-system">Key System</a>-dependent.</p>
                 <p class="note">Keys from different sessions should be cached independently such that closing one session does not affect keys in other sessions, even if they have overlapping key IDs.</p>
-                <p class="note">It is recommended that CDMs support a standard and reasonably high minimum number of keys per <coderef>MediaKeySession</coderef> object, including a standard replacement algorithm, and a standard and reasonably high minimum number of <coderef>MediaKeySession</coderef> objects.
+                <p class="note">It is recommended that CDMs support a standard and reasonably high minimum number of keys per <a def-id="mediakeysession"></a> object, including a standard replacement algorithm, and a standard and reasonably high minimum number of <a def-id="mediakeysession"></a> objects.
                 This enables a reasonable number of key rotation algorithms to be implemented across user agents and may reduce the likelihood of playback interruptions in use cases that involve various streams in the same element (i.e. adaptive streams, various audio and video tracks) using different keys.
                 </p>
               </li> 
@@ -683,10 +675,12 @@
       </li>
       <li><p>Return <var>promise</var>.</p></li>
     </ol>
+      </dd>
 
-    <p>The <methoddfn name="close">close()</methoddfn> method allows an application to indicate that it no longer needs the session and the CDM should release any resources associated with this object and close it.</p>
-    <p class="note">The returned promise is resolved when the request has been processed, and the <coderef>closed</coderef> attribute promise is resolved when the session is closed.</p>
-    <p>It must run the following steps:</p>
+      <dt>Promise&lt;void&gt; close()</dt>
+      <dd>
+    <p>Indicates that the application no longer needs the session and the CDM should release any resources associated with this object and close it.</p>
+    <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>
@@ -709,8 +703,11 @@
       </li>
       <li><p>Return <var>promise</var>.</p></li>
     </ol>
+      </dd>
 
-    <p>The <methoddfn name="remove">remove()</methoddfn> method allows an application to remove stored session data associated with this object.</p>
+      <dt>Promise&lt;void&gt; remove()</dt>
+      <dd>
+    <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>
@@ -725,8 +722,8 @@
               <li>
                 <p>Process the remove request.</p>
                 <p>This may involve exchanging message(s) with the application.</p>
-                <p>Unless this step fails, the CDM must have cleared all stored session data associated with this object, including the <coderef>sessionId</coderef>, before proceeding to the next step.</p>
-                <p class="note">A subsequent call to <methodref>load</methodref> with <coderef>sessionId</coderef> would fail because there is no data stored for that session ID.)</p>
+                <p>Unless this step fails, the CDM must have cleared all stored session data associated with this object, including the <a def-id="sessionId"></a>, before proceeding to the next step.</p>
+                <p class="note">A subsequent call to <a def-id="load"></a> with the value <a def-id="sessionId"></a> would fail because there is no data stored for that session ID.)</p>
               </li>
             </ol>
           </li>
@@ -741,9 +738,12 @@
       </li>
       <li><p>Return <var>promise</var>.</p></li>
     </ol>
-
+      </dd>
+      
+      <dt>Promise&lt;sequence&lt;ArrayBuffer&gt;&gt; getUsableKeyIds()</dt>
+      <dd>
     <p class="issue"><a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=26372">Bug 26372</a> - getUsableKeyIds() may be replaced.</p>
-    <p>The <methoddfn name="getUsableKeyIds">getUsableKeyIds()</methoddfn> method allows an application to get 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>
+    <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>
@@ -765,7 +765,9 @@
         </ol>
       </li>
     </ol>
-    </section>
+      </dd>
+
+    </dl>
 
     <section id="mediakeymessageevent">
       <h3>MediaKeyMessageEvent</h3>
@@ -816,7 +818,7 @@
     <section id="mediakeysession-events" class="informative">
     <h3>Event Summary</h3>
 
-    <p class="note">In some implementations, <coderef>MediaKeySession</coderef> objects may not fire any events until the <a def-id="mediakeys"></a> object is associated with a media element using <methodref>setMediaKeys</methodref>.</p>
+    <p class="note">In some implementations, <a def-id="mediakeysession"></a> objects may not fire any events until the <a def-id="mediakeys"></a> object is associated with a media element using <methodref>setMediaKeys</methodref>.</p>
 
     <table class="old-table">
       <thead>
@@ -846,12 +848,12 @@
 
     <section id="algorithms-queue-message">
     <h4>Queue a "message" Event</h4>
-    <p>The Queue a "message" Event algorithm is run when the CDM needs to queue a message event to a <coderef>MediaKeySession</coderef> object.
-    Requests to run this algorithm include a target <coderef>MediaKeySession</coderef> object, a <var title="true">message type</var>, and a <var title="true">message</var>.
+    <p>The Queue a "message" Event algorithm is run when the CDM needs to queue a message event to a <a def-id="mediakeysession"></a> object.
+    Requests to run this algorithm include a target <a def-id="mediakeysession"></a> object, a <var title="true">message type</var>, and a <var title="true">message</var>.
     </p>
     <p>The following steps are run:</p>
     <ol>
-      <li><p>Let the <var title="true">session</var> be the specified <coderef>MediaKeySession</coderef> object.</p></li>
+      <li><p>Let the <var title="true">session</var> be the specified <a def-id="mediakeysession"></a> object.</p></li>
       <li>
         <p><a def-id="Queue-a-task-to-fire-an-event-named"></a> <a def-id="message"></a> at the <var title="true">session</var>.</p>
         <p>The event is of type <a def-id="MediaKeyMessageEvent"></a> and has:</p>
@@ -866,12 +868,12 @@
     <section id="algorithms-keys-changed">
     <h4>Usable Keys Changed</h4>
     <p>The Usable Keys Changed algorithm is run when the CDM changes the set of keys in the session that may be used for decryption.
-    This can happen as the result of an <methodref>update</methodref> call or some other event.
-    Requests to run this algorithm include a target <coderef>MediaKeySession</coderef> object.
+    This can happen as the result of an <a def-id="update"></a> call or some other event.
+    Requests to run this algorithm include a target <a def-id="mediakeysession"></a> object.
     </p>
     <p>The following steps are run:</p>
     <ol>
-      <li><p>Let the <var title="true">session</var> be the associated <coderef>MediaKeySession</coderef> object.</p></li>
+      <li><p>Let the <var title="true">session</var> be the associated <a def-id="mediakeysession"></a> object.</p></li>
       <li><p><a def-id="Queue-a-task-to-fire-an-event-named"></a> <a def-id="keyschange"></a> at the <var title="true">session</var>.</p></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 each of the <a href="#htmlmediaelement-extensions">media element(s)</a> whose <coderef prefix="attr">mediaKeys</coderef> attribute is the MediaKeys object that created the <var title="true">session</var>.</p>
         <p>The user agent may choose to skip this step if it knows resuming will fail.</p>
@@ -883,29 +885,29 @@
     <section id="algorithms-update-expiration">
     <h4>Update Expiration</h4>
     <p>The Update Expiration algorithm is run when the CDM changes the expiration time of a session.
-    This can happen as the result of an <methodref>update</methodref> call or some other event.
-    Requests to run this algorithm include a target <coderef>MediaKeySession</coderef> object and the new expiration time, which may be <code>NaN</code>.
+    This can happen as the result of an <a def-id="update"></a> call or some other event.
+    Requests to run this algorithm include a target <a def-id="mediakeysession"></a> object and the new expiration time, which may be <code>NaN</code>.
     </p>
     <p>The following steps are run:</p>
     <ol>
-      <li><p>Let the <var title="true">session</var> be the associated <coderef>MediaKeySession</coderef> object.</p></li>
+      <li><p>Let the <var title="true">session</var> be the associated <a def-id="mediakeysession"></a> object.</p></li>
       <li><p>Let <var title="true">expiration time</var> be <code>NaN</code>.</p></li>
       <li><p>If the new expiration time is not <code>NaN</code>, let <var title="true">expiration time</var> be the new expiration time in milliseconds since 01 January 1970 UTC.</p></li>
-      <li><p>Set the <var title="true">session</var>'s <coderef>expiration</coderef> attribute to <var title="true">expiration time</var>.</p></li>
+      <li><p>Set the <var title="true">session</var>'s <a def-id="expiration"></a> attribute to <var title="true">expiration time</var>.</p></li>
     </ol>
     </section>
 
     <section id="algorithms-session-close">
     <h4>Session Close</h4>
-    <p>The Session Close algorithm is run when the CDM closes the session associated with a <coderef>MediaKeySession</coderef> object.</p>
-    <p class="note">The CDM may close a session at any point, such as in response to a <methodref>close</methodref> call, when the session is no longer needed, or when system resources are lost.
+    <p>The Session Close algorithm is run when the CDM closes the session associated with a <a def-id="mediakeysession"></a> object.</p>
+    <p class="note">The CDM may close a session at any point, such as in response to a <a def-id="close"></a> call, when the session is no longer needed, or when system resources are lost.
     Keys in other sessions should be unaffected, even if they have overlapping key IDs.
     </p>
     <p>The following steps are run:</p>
     <ol>
-      <li><p>Let the <var title="true">session</var> be the associated <coderef>MediaKeySession</coderef> object.</p></li>
+      <li><p>Let the <var title="true">session</var> be the associated <a def-id="mediakeysession"></a> object.</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>Let <var>promise</var> be the <coderef>closed</coderef> attribute of the <var title="true">session</var>.</p></li>
+      <li><p>Let <var>promise</var> be the <a def-id="closed"></a> attribute of the <var title="true">session</var>.</p></li>
       <li><p>Resolve <var>promise</var>.</p></li>
     </ol>
     </section>
@@ -974,15 +976,15 @@
     <p>Persisted data must always be stored such that only the <a def-id="origin"></a> of this object's <a def-id="document-concept"></a> can access it.
       In addition, the data must only be accessible by the current profile of this user agent - other user agent profiles, user agents, and applications must not be able to access the stored data.
     </p>
-    <p>The CDM should not store session data, including the Session ID, until <methodref>update</methodref> is called the first time.
-      Specifically, the CDM should not store session data during the <methodref>generateRequest</methodref> algorithm.
+    <p>The CDM should not store session data, including the Session ID, until <a def-id="update"></a> is called the first time.
+      Specifically, the CDM should not store session data during the <a def-id="generateRequest"></a> algorithm.
       This ensures that the application is aware of the session and knows it needs to eventually remove it.
     </p>
     <p>The CDM must ensure that data for a given session is only present in one active unclosed session in any <a def-id="document-concept"></a>.
-      In other words, <methodref>load</methodref> must fail when there is already a <coderef>MediaKeySession</coderef> representing the session specified by the <var title="true">sessionId</var> parameter, either because the object that created it via <methodref>generateRequest</methodref> is still active or it has been loaded into another object via <methodref>load</methodref>.
+      In other words, <a def-id="load"></a> must fail when there is already a <a def-id="mediakeysession"></a> representing the session specified by the <var title="true">sessionId</var> parameter, either because the object that created it via <a def-id="generateRequest"></a> is still active or it has been loaded into another object via <a def-id="load"></a>.
       A session may only be loaded again after the <a href="#algorithms-session-close">Session Close</a> algorithm has not been run on the object representing it.
     </p>
-    <p>An application that creates a <a def-id="persistent-session"></a> session should later remove the stored data using <methodref>remove</methodref>.
+    <p>An application that creates a <a def-id="persistent-session"></a> session should later remove the stored data using <a def-id="remove"></a>.
       The CDM may also remove sessions as appropriate, but applications should not rely on this.
     </p>
     <p class="note">See the <a href="#security">Security Considerations</a> and <a href="#privacy">Privacy Considerations</a> sections for additional considerations when supporting persistent storage.</p>
@@ -1176,7 +1178,7 @@
         <ol>
           <li><p>Let <var title="true">media keys</var> be the <a def-id="mediakeys"></a> object referenced by that atribute.</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 <var title="true">media keys</var>.</p></li>
-          <li><p>If there is at least one <coderef>MediaKeySession</coderef> created by the <var title="true">media keys</var> on which the <a href="#algorithms-session-close">Session Close</a> algorithm has not been run, run the following steps:</p>
+          <li><p>If there is at least one <a def-id="mediakeysession"></a> created by the <var title="true">media keys</var> on which the <a href="#algorithms-session-close">Session Close</a> algorithm has not been run, run the following steps:</p>
             <p class="note">This check ensures the <var title="true">cdm</var> has finished loading and is a prequisite for a matching key being available.</p>
             <ol>
               <li><p>Let the <var title="true">block key ID</var> be the key ID of the current block.</p>
@@ -1343,22 +1345,22 @@
     <h4>Behavior</h4>
     <p>The following describe how Clear Key implements key system-specific behaviors:</p>
     <ul>
-      <li><p>In the <methodref>generateRequest</methodref> algorithm:</p>
+      <li><p>In the <a def-id="generateRequest"></a> algorithm:</p>
         <ul>
           <li><p>The generated <var title="true">message</var> is a JSON object encoded in UTF-8 as described in <a href="#clear-key-request-format">License Request Format</a>.</p></li>
           <li><p>The request is generated by extracting the key IDs from the <var>init data</var>.</p></li>
           <li><p>The "type" member value is the value of the <var title="true">sessionType</var> parameter.</p></li>
         </ul>
       </li>
-      <li><p>The <coderef>sessionId</coderef> attribute is a numerical value representable by a 32-bit integer.</p></li>
-      <li><p>The <coderef>expiration</coderef> attribute is always <code>NaN</code>.</p></li>
-      <li><p>In the <methodref>update</methodref> algorithm:</p>
+      <li><p>The <a def-id="sessionId"></a> attribute is a numerical value representable by a 32-bit integer.</p></li>
+      <li><p>The <a def-id="expiration"></a> attribute is always <code>NaN</code>.</p></li>
+      <li><p>In the <a def-id="update"></a> algorithm:</p>
         <ul>
           <li><p>The <var title="true">response</var> parameter is a JWK Set as described in <a href="#clear-key-license-format">License Format</a>.</p></li>
           <li><p><var>sanitized response</var> is considered invalid if it is not a valid JWK Set with at least one valid JWK key of a valid length for the media type.</p></li>
         </ul>
       </li>
-      <li><p>The <methodref>getUsableKeyIds</methodref> method always returns all key IDs that have been provided via <methodref>update</methodref>.</p></li>
+      <li><p>The <a def-id="getUsableKeyIds"></a> method always returns all key IDs that have been provided via <a def-id="update"></a>.</p></li>
       <li><p><a href="#initialization-data">Initialization Data</a>: Implementations may support any combination of registered Initialization Data types [[EME-REGISTRY]].
         Implementations should support the "<a href="keyids-format.html">keyids</a>" type and other types appropriate for content types supported by the user agent.
       </p></li>
@@ -1399,7 +1401,7 @@
 
     <section id="clear-key-license-format">
     <h4>License Format</h4>
-    <p>This section describes the format of the license to be provided via the <var title="true">response</var> parameter of the <methodref>update</methodref> method.</p>
+    <p>This section describes the format of the license to be provided via the <var title="true">response</var> parameter of the <a def-id="update"></a> method.</p>
 
     <p>The format is a JSON Web Key (JWK) Set containing representation of the symmetric key to be used for decryption, as defined in the <a href="http://tools.ietf.org/html/draft-ietf-jose-json-web-key">IETF Internet-draft JSON Web Key (JWK) specification</a>.</p>
 
@@ -1417,10 +1419,10 @@
 
     <p>The JSON object may have an optional "type" member value, which may be any of the <a def-id="sessiontype"></a> values.
       If not specified, the default value of <a def-id="temporary-session"></a> is used.
-      The <methodref>update</methodref> algorithm compares this value to the <var title="true">sessionType</var>.
+      The <a def-id="update"></a> algorithm compares this value to the <var title="true">sessionType</var>.
     </p>
 
-    <p>When passed to the <methodref>update</methodref> method as the ArrayBuffer <var title="true">response</var> parameter, the JSON string must be encoded in UTF-8 as specified in the <a href="http://www.w3.org/TR/encoding/">Encoding</a> specification.
+    <p>When passed to the <a def-id="update"></a> method as the ArrayBuffer <var title="true">response</var> parameter, the JSON string must be encoded in UTF-8 as specified in the <a href="http://www.w3.org/TR/encoding/">Encoding</a> specification.
       Applications may encode the JSON string using the <a href="http://www.w3.org/TR/encoding/#interface-textencoder">TextEncoder interface</a>.
     </p>
 
@@ -1454,12 +1456,12 @@
     <section id="security" class="informative">
     <h2>Security Considerations</h2>
 
-    <p>User Agent and Key System implementations must consider <a def-id="media-data"></a>, <a href="#initialization-data">Initialization Data</a>, responses (i.e. data passed to <methodref>update</methodref>), licenses, key data, and all other data provided by the application as untrusted content and potential attack vectors.
+    <p>User Agent and Key System implementations must consider <a def-id="media-data"></a>, <a href="#initialization-data">Initialization Data</a>, responses (i.e. data passed to <a def-id="update"></a>), licenses, key data, and all other data provided by the application as untrusted content and potential attack vectors.
     They must use appropriate safeguards to mitigate any associated threats and take care to safely parse, decrypt, etc. such data.
     User Agents may want to validate data before passing it to the CDM, especially if the CDM does not run in the same (sandboxed) context as the DOM (i.e. rendering).
     </p>
     <p>Implementations should not return active content or passive content that affects program control flow to the application.
-    For example, it is not safe to expose URLs or other information that may have come from media data, such as is the case for the Initialization Data passed to <methodref>generateRequest</methodref>.
+    For example, it is not safe to expose URLs or other information that may have come from media data, such as is the case for the Initialization Data passed to <a def-id="generateRequest"></a>.
     Applications should determine the URLs to use. The <a def-id="message-event-type-attribute"></a> attribute of the <a def-id="message"></a> event can be used by the application to select among a set of URLs if applicable.
     </p>
     <p>User Agents are responsible for providing users with a secure way to browse the web. Since User Agents may integrate with third party CDM implementations, CDM implementers must provide sufficient information and controls to user agent implementers to enable them to properly asses the security implications of integrating with the Key System.</p>
@@ -1601,7 +1603,7 @@
     <p>In order to protect identifiers and other information discussed in previous sections, user agents may choose to only support the EME APIs and/or specific Key Systems (i.e. based on privacy and security risks) on secure origins.
     This is especially important if a user agent chooses to support a Key System implementation that exposes identifiers or other such information without effectively anonymizing it in transit (i.e. without <a href="#identifier-encryption">encrypting identifiers</a>).
     </p>
-    <p>Regardless of user agent limitations, applications should use secure transport (e.g. HTTPS) for all traffic containing messages from the CDM (i.e. all data passed from <a def-id="message"></a> events and to <methodref>update</methodref>).</p>
+    <p>Regardless of user agent limitations, applications should use secure transport (e.g. HTTPS) for all traffic containing messages from the CDM (i.e. all data passed from <a def-id="message"></a> events and to <a def-id="update"></a>).</p>
     <p>All user agents should properly handle <a href="https://w3c.github.io/webappsec/specs/mixedcontent/">Mixed Content</a> to avoid exposure to insecure content or transport when the user agent or application wish to enforce secure origin and transport.</p>
     </section>
 
@@ -1643,7 +1645,7 @@
           var initData = new Uint8Array([ ... ]);
           var keySession = createdMediaKeys.<a def-id="createSession-call"></a>();
           keySession.addEventListener("<a def-id="message"></a>", handleMessage, false);
-          return keySession.<premethodref>generateRequest</premethodref>("webm", initData);
+          return keySession.<a def-id="generateRequest-call"></a>("webm", initData);
         }
       ).catch(
         console.error.bind(console, "Unable to create or initialize key session")
@@ -1655,7 +1657,7 @@
     var keySession = event.target;
 
     var license = new Uint8Array([ ... ]);
-    keySession.<premethodref>update</premethodref>(license).catch(
+    keySession.<a def-id="update-call"></a>(license).catch(
       console.error.bind(console, "update() failed")
     );
   }
@@ -1732,7 +1734,7 @@
   function makeNewRequest(mediaKeys, initDataType, initData) {
     var keySession = mediaKeys.<a def-id="createSession-call"></a>();
     keySession.addEventListener("<a def-id="message"></a>", licenseRequestReady, false);
-    keySession.<premethodref>generateRequest</premethodref>(initDataType, initData).catch(
+    keySession.<a def-id="generateRequest-call"></a>(initDataType, initData).catch(
       console.error.bind(console, "Unable to create or initialize key session")
     );
   }
@@ -1746,7 +1748,7 @@
     xmlhttp.onreadystatechange = function() {
       if (xmlhttp.readyState == 4) {
         var license = new Uint8Array(xmlhttp.response);
-        xmlhttp.keySession.<premethodref>update</premethodref>(license).catch(
+        xmlhttp.keySession.<a def-id="update-call"></a>(license).catch(
           console.error.bind(console, "update() failed")
         );
       }
@@ -1804,7 +1806,7 @@
     <section id="example-using-all-events">
     <h3>Using All Events</h3>
     <p class="exampledescription">This is a more complete example showing all events being used.</p>
-    <p class="exampledescription">Note that <code>handleMessage()</code> could be called multiple times, including in response to the <methodref>update</methodref> call if multiple round trips are required and for any other reason the Key System might need to send a message.</p>
+    <p class="exampledescription">Note that <code>handleMessage()</code> could be called multiple times, including in response to the <a def-id="update"></a> call if multiple round trips are required and for any other reason the Key System might need to send a message.</p>
 
     <pre class="example highlight">
 &lt;script&gt;
@@ -1823,17 +1825,17 @@
     var keySession = mediaKeys.<a def-id="createSession-call"></a>();
     keySession.addEventListener("<a def-id="message"></a>", handleMessage, false);
     keySession.addEventListener("<a def-id="keyschange"></a>", handleKeysChange, false);
-    keySession.<precoderef>closed</precoderef>.then(
+    keySession.<a def-id="closed"></a>.then(
       console.log.bind(console, "Session closed")
     );
-    keySession.<premethodref>generateRequest</premethodref>(initDataType, initData).catch(
+    keySession.<a def-id="generateRequest-call"></a>(initDataType, initData).catch(
       console.error.bind(console, "Unable to create or initialize key session")
     );
   }
 
   function handleMessageResponse(keySession, response) {
     var license = new Uint8Array(response);
-    keySession.<premethodref>update</premethodref>(license).catch(
+    keySession.<a def-id="update-call"></a>(license).catch(
       function(err) {
         console.error("update() failed: " + err);
       }
@@ -1859,7 +1861,7 @@
   }
 
   function handleKeysChange(event) {
-    event.target.<precoderef>getUsableKeyIds</precoderef>().then(
+    event.target.<a def-id="getUsableKeyIds-call"></a>().then(
       function(keyIdSequence) {
         // Process keyIdSequence and respond appropriately.
       }
@@ -1870,8 +1872,8 @@
 
   function handleError(event) {
     // Report <!-- TODO: Remove or fix when bug 26372 is addressed.
-    event.target.error.name and event.target.error.<precoderef>systemCode</precoderef>,
-    //  -->and do some bookkeeping with event.target.<precoderef>sessionId</precoderef> if necessary.
+    event.target.error.name and event.target.error.<a def-id="systemCode"></a>,
+    //  -->and do some bookkeeping with event.target.<a def-id="sessionId"></a> if necessary.
   }
 
   selectKeySystem();
@@ -1912,16 +1914,16 @@
 
   // Called if the application does not have a stored sessionId for the media resource.
   function makeNewRequest(mediaKeys, initDataType, initData) {
-    var keySession = mediaKeys.<a def-id="createSession-call"></a>("persistent");
+    var keySession = mediaKeys.<a def-id="createSession-call"></a>(<a def-id="persistent-session"></a>);
     keySession.addEventListener("<a def-id="message"></a>", handleMessage, false);
-    keySession.<precoderef>closed</precoderef>.then(
+    keySession.<a def-id="closed"></a>.then(
       function() {
-        console.log("Session " + this.sessionId + " closed");
+        console.log("Session " + this.<a def-id="sessionId"></a> + " closed");
       }.bind(keySession)        
     );
-    keySession.<premethodref>generateRequest</premethodref>(initDataType, initData).then(
+    keySession.<a def-id="generateRequest-call"></a>(initDataType, initData).then(
       function() {
-        // Store this.<precoderef>sessionId</precoderef> in the application.
+        // Store this.<a def-id="sessionId"></a> in the application.
       }.bind(keySession)
     ).catch(
       console.error.bind(console, "Unable to create or initialize a persistable key session")
@@ -1930,12 +1932,12 @@
 
   // Called if the application has a stored sessionId for the media resource.
   function loadStoredSession(mediaKeys, sessionId) {
-    var keySession = mediaKeys.<a def-id="createSession-call"></a>("persistent");
+    var keySession = mediaKeys.<a def-id="createSession-call"></a>(<a def-id="persistent-session"></a>);
     keySession.addEventListener("<a def-id="message"></a>", handleMessage, false);
-    keySession.<precoderef>closed</precoderef>.then(
+    keySession.<a def-id="closed"></a>.then(
       console.log.bind(console, "Session closed")
     );
-    keySession.<premethodref>load</premethodref>(sessionId).then(
+    keySession.<a def-id="load-call"></a>(sessionId).then(
       function(loaded) {
         if (!loaded) {
           console.error("No stored session with the ID " + sessionId + " was found.");
@@ -1950,17 +1952,17 @@
 
   // Called when the application wants to stop using the session without removing the stored license.
   function closeSession(keySession) {
-    keySession.<premethodref>close</premethodref>();
+    keySession.<a def-id="close-call"></a>();
   }
 
   // Called when the application wants to remove the stored license.
   // The stored session data has not been completely removed until the promise returned by remove() is fulfilled.
   // The remove() call may initiate a series of messages to/from the server that must be completed before this occurs.
   function removeStoredSession(keySession) {
-    keySession.<premethodref>remove</premethodref>().then(
+    keySession.<a def-id="remove-call"></a>().then(
       function() {
-        console.log("Session " + this.sessionId + " removed");
-        // The application should remove its record of this.sessionId.
+        console.log("Session " + this.<a def-id="sessionId"></a> + " removed");
+        // The application should remove its record of this.<a def-id="sessionId"></a>.
       }.bind(keySession)
     ).catch(
       console.error.bind(console, "Failed to remove the session")
@@ -1970,7 +1972,7 @@
   // This replaces the implementation in the previous example.
   function handleMessageResponse(keySession, response) {
     var license = new Uint8Array(response);
-    keySession.<premethodref>update</premethodref>(license).then(
+    keySession.<a def-id="update-call"></a>(license).then(
       function() {
         // If this was the last required message from the server, the license is
         // now stored. Update the application state as appropriate.
--- a/encrypted-media/encrypted-media.js	Fri Oct 10 14:43:23 2014 -0700
+++ b/encrypted-media/encrypted-media.js	Fri Oct 10 14:43:57 2014 -0700
@@ -161,6 +161,23 @@
     'isTypeSupported-call': { func: idlref_helper, fragment: 'widl-MediaKeys-isTypeSupported-IsTypeSupportedResult-DOMstring-keySystem-DOMString-initDataType-DOMString-contentType-DOMString-capability', link_text: 'isTypeSupported',  },
     'mediakeys-initialization': { func: term_helper, fragment: 'widl-MediaKeys-create-Promise-MediaKeys--DOMString-keySystem', link_text: ''  },
 
+    'mediakeysession': { func: idlref_helper, fragment: 'idl-def-MediaKeySession', link_text: 'MediaKeySession',  },
+    'sessionId': { func: idlref_helper, fragment: 'widl-MediaKeySession-sessionId', link_text: 'sessionId',  },
+    'expiration': { func: idlref_helper, fragment: 'widl-MediaKeySession-expiration', link_text: 'expiration',  },
+    'closed': { func: idlref_helper, fragment: 'widl-MediaKeySession-closed', link_text: 'closed',  },
+    'generateRequest': { func: idlref_helper, fragment: 'widl-MediaKeySession-generateRequest-Promise-void--DOMString-initDataType-ArrayBuffer-ArrayBufferView-initData', link_text: 'generateRequest()',  },
+    'generateRequest-call': { func: idlref_helper, fragment: 'widl-MediaKeySession-generateRequest-Promise-void--DOMString-initDataType-ArrayBuffer-ArrayBufferView-initData', link_text: 'generateRequest',  },
+    'load': { func: idlref_helper, fragment: 'widl-MediaKeySession-load-Promise-boolean--DOMString-sessionId', link_text: 'load()',  },
+    'load-call': { func: idlref_helper, fragment: 'widl-MediaKeySession-load-Promise-boolean--DOMString-sessionId', link_text: 'load',  },
+    'update': { func: idlref_helper, fragment: 'widl-MediaKeySession-update-Promise-void--ArrayBuffer-ArrayBufferView-response', link_text: 'update()',  },
+    'update-call': { func: idlref_helper, fragment: 'widl-MediaKeySession-update-Promise-void--ArrayBuffer-ArrayBufferView-response', link_text: 'update',  },
+    'close': { func: idlref_helper, fragment: 'widl-MediaKeySession-close-Promise-void', link_text: 'close()',  },
+    'close-call': { func: idlref_helper, fragment: 'widl-MediaKeySession-close-Promise-void', link_text: 'close',  },
+    'remove': { func: idlref_helper, fragment: 'widl-MediaKeySession-remove-Promise-void', link_text: 'remove()',  },
+    'remove-call': { func: idlref_helper, fragment: 'widl-MediaKeySession-remove-Promise-void', link_text: 'remove',  },
+    'getUsableKeyIds': { func: idlref_helper, fragment: 'widl-MediaKeySession-getUsableKeyIds-Promise-sequence-ArrayBuffer', link_text: 'getUsableKeyIds()',  },
+    'getUsableKeyIds-call': { func: idlref_helper, fragment: 'widl-MediaKeySession-getUsableKeyIds-Promise-sequence-ArrayBuffer', link_text: 'getUsableKeyIds',  },
+
     'keyschange': { func: eventref_helper, fragment: 'keyschange', link_text: 'keyschange',  },
     'message': { func: eventref_helper, fragment: 'message', link_text: 'message',  },
     'encrypted': { func: eventref_helper, fragment: 'encrypted', link_text: 'encrypted',  },
--- a/encrypted-media/spec-html.xsl	Fri Oct 10 14:43:23 2014 -0700
+++ b/encrypted-media/spec-html.xsl	Fri Oct 10 14:43:57 2014 -0700
@@ -51,11 +51,6 @@
     <code><a><xsl:attribute name="href">#dom-<xsl:value-of select="translate(@prefix,$upper,$lower)"/><xsl:value-of select="translate(.,$upper,$lower)"/></xsl:attribute><xsl:value-of select="."/>()</a></code>
   </xsl:template>
 
-  <!-- Still used in IDL and event definitions. -->
-  <xsl:template match="//dom4ref">
-    <a><xsl:attribute name="href">http://www.w3.org/TR/dom/#<xsl:value-of select="@name"/></xsl:attribute><xsl:value-of select="."/></a>
-  </xsl:template>
-
   <!-- Used in IDL. -->
   <xsl:template match="//EventHandler">
     <a><xsl:attribute name="href">http://www.w3.org/TR/html5/webappapis.html#eventhandler</xsl:attribute>EventHandler</a>