[EME] Bug 25506 - Convert IDL for events.
authorDavid Dorwin <ddorwin@google.com>
Fri, 10 Oct 2014 14:42:59 -0700
changeset 452 b452f399da9d
parent 451 7fe137d8de0a
child 453 ca4a8e0cde5d
[EME] Bug 25506 - Convert IDL for events.
encrypted-media/encrypted-media-respec.html
encrypted-media/encrypted-media.js
--- a/encrypted-media/encrypted-media-respec.html	Fri Oct 10 14:42:34 2014 -0700
+++ b/encrypted-media/encrypted-media-respec.html	Fri Oct 10 14:42:59 2014 -0700
@@ -217,7 +217,7 @@
 
     <p>
     Initialization Data is a generic term for container-specific data that is used by <a href="#cdm">CDMs</a> to generate a license request.
-    Initialization data found with the <a def-id="media-data"></a> is provided to the application in the <coderef>initData</coderef> attribute of the <coderef>encrypted</coderef> event.
+    Initialization data found with the <a def-id="media-data"></a> is provided to the application in the <a def-id="encrypted-event-initdata-attribute"></a> attribute of the <a def-id="encrypted"></a> event.
     </p>
 
     <p>
@@ -236,7 +236,7 @@
     <section id="cross-origin">
     <h4>Cross Origin Limitations</h4>
     <p>During playback, embedded media data is exposed to script in the embedding <a def-id="origin"></a>.
-    In order for the API to provide <coderef>initData</coderef> in the <coderef>encrypted</coderef> event, <a def-id="media-data"></a> must be <a def-id="cors-same-origin"></a> with the embedding page.
+    In order for the API to provide <a href="#initialization-data">Initialization Data</a> in the <a def-id="encrypted"></a> event, <a def-id="media-data"></a> must be <a def-id="cors-same-origin"></a> with the embedding page.
     If <a def-id="media-data"></a> is cross-origin with the embedding document, authors should use the <a def-id="media-crossorigin"></a> attribute
     on the <a href="#htmlmediaelement-extensions">media element</a> and CORS headers on the <a def-id="media-data"></a> response to make it <a def-id="cors-same-origin"></a>.
     </p>
@@ -245,7 +245,7 @@
     <section id="mixed-content">
     <h4>Mixed Content Limitations</h4>
     <p>During playback, embedded media data is exposed to script in the embedding <a def-id="origin"></a>.
-    In order for the API to provide <coderef>initData</coderef> in the <coderef>encrypted</coderef> event, <a def-id="media-data"></a> must not be mixed content as defined in [MIXED-CONTENT].
+    In order for the API to provide <a href="#initialization-data">Initialization Data</a> in the <a def-id="encrypted"></a> event, <a def-id="media-data"></a> must not be mixed content as defined in [MIXED-CONTENT].
     </p>
     </section>
     </section>
@@ -533,7 +533,7 @@
           <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>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 "<coderef>licenserequest</coderef>" and <var title="true">message</var>.</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>
         </ol>
       </li>
@@ -576,7 +576,7 @@
               <li><p>If the CDM needs to send a message:</p>
                 <ol>
                   <li><p>Let <var title="true">message</var> be a message generated by the <a href="#cdm">CDM</a> based on the <var title="true">session data</var>.</p></li>
-                  <li><p>Let <var title="true">message type</var> be the appropriate <coderef>MediaKeyMessageType</coderef> for the message.</p></li>
+                  <li><p>Let <var title="true">message type</var> be the appropriate <a def-id="MediaKeyMessageType"></a> for the message.</p></li>
                 </ol>
               </li>
             </ol>
@@ -645,7 +645,7 @@
               <li><p>If a message needs to be sent to the server, execute the following steps:</p>
                 <ol>
                   <li><p>Let <var title="true">message</var> be that message.</p></li>
-                  <li><p>Let <var title="true">message type</var> be the appropriate <coderef>MediaKeyMessageType</coderef> for the message.</p></li>
+                  <li><p>Let <var title="true">message type</var> be the appropriate <a def-id="MediaKeyMessageType"></a> for the message.</p></li>
                 </ol>
               </li>
             </ol>
@@ -742,38 +742,50 @@
     </ol>
     </section>
 
-    <section id="mediakeysession-event-definitions">
-    <h3>Event Definitions</h3>
-    <pre class="was-idl">
-enum <precodedfn>MediaKeyMessageType</precodedfn> { "<precodedfn>licenserequest</precodedfn>", "<precodedfn>licenserenewal</precodedfn>", "<precodedfn>licenserelease</precodedfn>" };
-
-[Constructor(DOMString type, optional <precoderef>MediaKeyMessageEventInit</precoderef> eventInitDict)]
-interface <precodedfn>MediaKeyMessageEvent</precodedfn> : <dom4ref name="event">Event</dom4ref> {
-  readonly attribute <precoderef>MediaKeyMessageType</precoderef> <precoderef>type</precoderef>;
-  readonly attribute ArrayBuffer <precoderef>message</precoderef>;
-};
+    <section id="mediakeymessageevent">
+      <h3>MediaKeyMessageEvent</h3>
+      <p>The MediaKeyMessageEvent object is used for the <a def-id="message"></a> event.</p>
+      <p>Events are constructed as defined in <a def-id="constructing-events"></a> [[!DOM]].</p>
 
-dictionary <precodedfn>MediaKeyMessageEventInit</precodedfn> : <dom4ref name="eventinit">EventInit</dom4ref> {
-  <precoderef>MediaKeyMessageType</precoderef> <precoderef>type</precoderef> = "<precoderef>licenserequest</precoderef>";
-  ArrayBuffer <precoderef>message</precoderef> = ArrayBuffer();
-};
-</pre>
+      <dl title="enum MediaKeyMessageType" class="idl">
+        <dt>licenserequest</dt>
+        <dd>The message contains a request for a new license.</dd>
+        <dt>licenserenewal</dt>
+        <dd>The message contains a request to renew an existing license.</dd>
+        <dt>licenserelease</dt>
+        <dd>The message contains a proof of key release.</dd>
+      </dl>
 
-    <dl class="domintro">
-     <dt><var title="">event</var> . <coderef>type</coderef></dt>
-     <dd>
-       <p>Returns the type of the message.</p>
-     </dd>
-     <dt><var title="">event</var> . <coderef>message</coderef></dt>
-     <dd>
-       <p>Returns the message to send.</p>
-     </dd>
-    </dl>
-    <div class="impl">
-    <p>The <codedfn>type</codedfn> is the type of the message.</p>
-    <p>The <codedfn>message</codedfn> attribute contains a message from the CDM. Messages are Key System-specific.</p>
-    <p>Events are constructed as defined in <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#constructing-events">Constructing events</a>, in [[!DOM4]].</p>
-    </div>
+      <dl title="interface MediaKeyMessageEvent : Event" class="idl">
+        <dt class="extended-attribute">
+          Constructor(DOMString type, optional MediaKeyMessageEventInit eventInitDict)
+        </dt>
+        <dd>
+
+        <dt>readonly attribute MediaKeyMessageType type</dt>
+        <dd>
+          The type of the message.
+        </dd>
+
+        <dt>readonly attribute ArrayBuffer message</dt>
+        <dd>
+          The message from the CDM. Messages are Key System-specific.
+        </dd>
+      </dl>
+
+      <section id="mediakeymessageeventinit">
+        <h4>MediaKeyMessageEventInit</h4>
+        <dl title="dictionary MediaKeyMessageEventInit : EventInit" class="idl">
+          <dt>MediaKeyMessageType type = "licenserequest"</dt>
+          <dd>
+            The type of the message.
+          </dd>
+          <dt>ArrayBuffer message = ArrayBuffer()</dt>
+          <dd>
+            The message.
+          </dd>
+        </dl>
+      </section>
     </section>
 
     <section id="mediakeysession-events" class="informative">
@@ -791,13 +803,13 @@
       </thead>
       <tbody>
         <tr>
-          <td><codedfn prefix="event">keyschange</codedfn></td>
-          <td><code><dom4ref name="event">Event</dom4ref></code></td>
+          <td><a def-id="eventdfn">keyschange</a></td>
+          <td><a def-id="event"></a></td>
           <td>There has been a change in usable keys in the session.</td>
         </tr>
         <tr>
-          <td><codedfn prefix="event">message</codedfn></td>
-          <td><coderef>MediaKeyMessageEvent</coderef></td>
+          <td><a def-id="eventdfn">message</a></td>
+          <td><a>MediaKeyMessageEvent</a></td>
           <td>The CDM has generated a message for the session.</td>
         </tr>
       </tbody>
@@ -816,11 +828,11 @@
     <ol>
       <li><p>Let the <var title="true">session</var> be the specified <coderef>MediaKeySession</coderef> object.</p></li>
       <li>
-        <p><a def-id="Queue-a-task-to-fire-an-event-named"></a> <coderef prefix="event">message</coderef> at the <var title="true">session</var>.</p>
-        <p>The event is of type <coderef>MediaKeyMessageEvent</coderef> and has:</p>
+        <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>
         <ul style="list-style-type:none"><li>
-          <coderef>type</coderef> = the specified <var title="true">message type</var><br></br>
-          <coderef>message</coderef> = the specified <var title="true">message</var>
+          <a def-id="message-event-type-attribute"></a> = the specified <var title="true">message type</var><br></br>
+          <a def-id="message-event-message-attribute"></a> = the specified <var title="true">message</var>
         </li></ul>
       </li>
     </ol>
@@ -835,7 +847,7 @@
     <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><a def-id="Queue-a-task-to-fire-an-event-named"></a> <coderef prefix="event">keyschange</coderef> at the <var title="true">session</var>.</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>
         <p class="note">For example, the user agenet may skip this step if no additional keys became available.</p>
@@ -976,7 +988,7 @@
 
     <p>The <codedfn>waitingFor</codedfn> attribute indicates what the media element is waiting for, if anything (indicated by the <a def-id="waiting"></a> and <a def-id="canplay"></a> events). This is described in the <a href="#algorithms-encrypted-block">Encrypted Block Encountered</a> algorithm.</p>
 
-    <p>The <codedfn>onencrypted</codedfn> event handler for the <coderef>encrypted</coderef> event must be supported by all HTMLMediaElements as both a content attribute and an IDL attribute.</p>
+    <p>The <codedfn>onencrypted</codedfn> event handler for the <a def-id="encrypted"></a> event must be supported by all HTMLMediaElements as both a content attribute and an IDL attribute.</p>
     </section>
 
     <section id="htmlmediaelement-methods">
@@ -1033,36 +1045,41 @@
     <p class="note">As a best practice, applications should create a MediaKeys object and call <methodref>setMediaKeys</methodref> before providing <a def-id="media-data"></a> (for example, setting the <a def-id="media-src"></a> attribute). This avoids potential delays in some implementations.</p>
     </section>
 
-    <section id="htmlmediaelement-event-definitions">
-    <h3>Event Definitions</h3>
-    <pre class="was-idl">
-[Constructor(DOMString type, optional <precoderef>MediaEncryptedEventInit</precoderef> eventInitDict)]
-interface <precodedfn>MediaEncryptedEvent</precodedfn> : <dom4ref name="event">Event</dom4ref> {
-  readonly attribute DOMString <precoderef>initDataType</precoderef>;
-  readonly attribute ArrayBuffer? <precoderef>initData</precoderef>;
-};
-
-dictionary <precodedfn>MediaEncryptedEventInit</precodedfn> : <dom4ref name="eventinit">EventInit</dom4ref> {
-  DOMString <precoderef>initDataType</precoderef> = "";
-  ArrayBuffer? <precoderef>initData</precoderef> = null;
-};
-</pre>
+    <section id="mediaencryptedevent">
+      <h3>MediaEncryptedEvent</h3>
+      <p>The MediaEncryptedEvent object is used for the <a def-id="encrypted"></a> event.</p>
+      <p>Events are constructed as defined in <a def-id="constructing-events"></a> [[!DOM]].</p>
 
-    <dl class="domintro">
-     <dt><var title="">event</var> . <coderef>initDataType</coderef></dt>
-     <dd>
-       <p>Returns a string indicating the <a href="#initialization-data-type">initialization data type</a> of the <a href="#initialization-data">Initialization Data</a> related to the event.</p>
-     </dd>
-     <dt><var title="">event</var> . <coderef>initData</coderef></dt>
-     <dd>
-       <p>Returns the <a href="#initialization-data">Initialization Data</a> related to the event.</p>
-     </dd>
-    </dl>
-    <div class="impl">
-    <p>The <codedfn>initDataType</codedfn> attribute contains a string indicating the <a href="#initialization-data-type">initialization data type</a> specific to the event. The format of the <coderef>initData</coderef> will vary according to the <coderef>initDataType</coderef>.</p>
-    <p>The <codedfn>initData</codedfn> attribute contains <a href="#initialization-data">Initialization Data</a> specific to the event.</p>
-    <p>Events are constructed as defined in <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#constructing-events">Constructing events</a>, in [DOM4].</p>
-    </div>
+      <dl title="interface MediaEncryptedEvent : Event" class="idl">
+        <dt class="extended-attribute">
+          Constructor(DOMString type, optional MediaEncryptedEventInit eventInitDict)
+        </dt>
+        <dd>
+
+        <dt>readonly attribute DOMString initDataType</dt>
+        <dd>
+          Indicates the <a href="#initialization-data-type">initialization data type</a> of the <a href="#initialization-data">Initialization Data</a> contained in the <a def-id="encrypted-event-initdata-attribute"></a> attribute.
+        </dd>
+
+        <dt>readonly attribute ArrayBuffer? initData</dt>
+        <dd>
+          The <a href="#initialization-data">Initialization Data</a> for the event.
+        </dd>
+      </dl>
+
+      <section id="mediaencryptedeventinit">
+        <h4>MediaEncryptedEventInit</h4>
+        <dl title="dictionary MediaEncryptedEventInit : EventInit" class="idl">
+          <dt>DOMString initDataType = ""</dt>
+          <dd>
+            The <a href="#initialization-data-type">initialization data type</a>.
+          </dd>
+          <dt>ArrayBuffer? initData = null</dt>
+          <dd>
+            The <a href="#initialization-data">Initialization Data</a>.
+          </dd>
+        </dl>
+      </section>
     </section>
 
     <section id="htmlmediaelement-events" class="informative">
@@ -1079,8 +1096,8 @@
       </thead>
       <tbody>
         <tr>
-          <td><codedfn>encrypted</codedfn></td>
-          <td><coderef>MediaEncryptedEvent</coderef></td>
+          <td><a def-id="eventdfn">encrypted</a></td>
+          <td><a>MediaEncryptedEvent</a></td>
           <td>The user agent encounters <a href="#initialization-data">Initialization Data</a> in the <a def-id="media-data"></a>.</td>
           <td><a def-id="readystate"></a> is equal to <a def-id="have-metadata"></a> or greater.
           <p class="note">It is possible that the element is playing or has played.</p>
@@ -1109,14 +1126,14 @@
         <p class="note">While the media element may allow loading of "Optionally-blockable Content" [MIXED-CONTENT], the user agent must not expose Initialization Data from such media data to the application.</p>
       </li>
       <li>
-        <p><a def-id="Queue-a-task-to-fire-an-event-named"></a> <coderef>encrypted</coderef> at the media element.</p>
-        <p>The event is of type <coderef>MediaEncryptedEvent</coderef> and has:</p>
+        <p><a def-id="Queue-a-task-to-fire-an-event-named"></a> <a def-id="encrypted"></a> at the media element.</p>
+        <p>The event is of type <a def-id="MediaEncryptedEvent"></a> and has:</p>
         <ul style="list-style-type:none"><li>
-          <coderef>initDataType</coderef> = <var title="">initDataType</var><br></br>
-          <coderef>initData</coderef> = <var title="">initData</var>
+          <a def-id="encrypted-event-initdatatype-attribute"></a> = <var title="">initDataType</var><br></br>
+          <a def-id="encrypted-event-initdata-attribute"></a> = <var title="">initData</var>
         </li></ul>
         <p class="note"><a def-id="readystate"></a> is <em>not</em> changed and no algorithms are aborted. This event merely provides information.</p>
-        <p class="note">The <coderef>initData</coderef> attribute will be null if the media data is <em>not</em> <a def-id="cors-same-origin"></a> or is <a href="#mixed-content">mixed content</a>.
+        <p class="note">The <a def-id="encrypted-event-initdata-attribute"></a> attribute will be null if the media data is <em>not</em> <a def-id="cors-same-origin"></a> or is <a href="#mixed-content">mixed content</a>.
           Applications may retrieve the Initialization Data from an alternate source.
         </p>
       </li>
@@ -1325,7 +1342,7 @@
 
     <section id="clear-key-request-format">
     <h4>License Request Format</h4>
-    <p>This section describes the format of the license request provided to the application via the <coderef>message</coderef> attribute of the <precoderef prefix="event">message</precoderef> event.</p>
+    <p>This section describes the format of the license request provided to the application via the <a def-id="message-event-message-attribute"></a> attribute of the <a def-id="message"></a> event.</p>
     
     <p>The format is a JSON object containing the following members:</p>
     <dl>
@@ -1335,7 +1352,7 @@
       <dd>The requested <coderef>SessionType</coderef></dd>
     </dl>
 
-    <p>When contained in the ArrayBuffer <coderef>message</coderef> attribute of a <coderef>MediaKeyMessageEvent</coderef> object, the JSON string is encoded in UTF-8 as specified in the <a href="http://www.w3.org/TR/encoding/">Encoding</a> specification.
+    <p>When contained in the ArrayBuffer <a def-id="message-event-message-attribute"></a> attribute of a <a def-id="MediaKeyMessageEvent"></a> object, the JSON string is encoded in UTF-8 as specified in the <a href="http://www.w3.org/TR/encoding/">Encoding</a> specification.
       Applications may decode the contents of the ArrayBuffer to a JSON string using the <a href="http://www.w3.org/TR/encoding/#interface-textdecoder">TextDecoder interface</a>.
     </p>
 
@@ -1418,7 +1435,7 @@
     </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>.
-    Applications should determine the URLs to use. The <coderef>type</coderef> attribute of the <coderef prefix="event">message</coderef> event can be used by the application to select among a set of URLs if applicable.
+    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>
     <p>Unsandboxed CDMs (or CDMs that use platform features) and UAs that use them must be especially careful in all areas of security, including parsing of key and media data, etc. due to the potential for compromises to provide access to OS/platform features, interact with or run as root, access drivers, kernel, firmware, hardware, etc., all of which may not be written to be robust against hostile software or web-based attacks. Additionally, CDMs may not be updated with security fixes as frequently, especially when part of the OS, platform or hardware.</p>
@@ -1559,7 +1576,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 <coderef prefix="event">message</coderef> 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 <methodref>update</methodref>).</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>
 
@@ -1600,7 +1617,7 @@
         function(createdMediaKeys) {
           var initData = new Uint8Array([ ... ]);
           var keySession = createdMediaKeys.<premethodref>createSession</premethodref>();
-          keySession.addEventListener("<precoderef prefix="event">message</precoderef>", handleMessage, false);
+          keySession.addEventListener("<a def-id="message"></a>", handleMessage, false);
           return keySession.<premethodref>generateRequest</premethodref>("webm", initData);
         }
       ).catch(
@@ -1626,7 +1643,7 @@
     </section>
 
     <section id="example-selecting-key-system">
-    <h3>Selecting a Supported Key System and Using Initialization Data from the "encrypted" Event</h3>
+    <h3>Selecting a Supported Key System and Using Initialization Data from the <a def-id="encrypted"></a> Event</h3>
     <p class="exampledescription">This example selects a supported <a href="#key-system">Key System</a> using the <methodref>isTypeSupported</methodref> method then uses
     the <a href="#initialization-data">Initialization Data</a> from the <a def-id="media-data"></a> to generate the license request and send it to the appropriate license server.
     One of the supported key systems uses a serverCertificate, which is provided proactively.
@@ -1676,7 +1693,7 @@
         console.error.bind(console, "Unable to create or use new MediaKeys")
       );
     }
-    addSession(video, event.<precoderef>initDataType</precoderef>, event.<precoderef>initData</precoderef>);
+    addSession(video, event.<a def-id="encrypted-event-initdatatype-attribute"></a>, event.<a def-id="encrypted-event-initdata-attribute"></a>);
   }
 
   function addSession(video, initDataType, initData) {
@@ -1689,14 +1706,14 @@
 
   function makeNewRequest(mediaKeys, initDataType, initData) {
     var keySession = mediaKeys.<premethodref>createSession</premethodref>();
-    keySession.addEventListener("<precoderef prefix="event">message</precoderef>", licenseRequestReady, false);
+    keySession.addEventListener("<a def-id="message"></a>", licenseRequestReady, false);
     keySession.<premethodref>generateRequest</premethodref>(initDataType, initData).catch(
       console.error.bind(console, "Unable to create or initialize key session")
     );
   }
 
   function licenseRequestReady(event) {
-    var request = event.<precoderef>message</precoderef>;
+    var request = event.<a def-id="message-event-message-attribute"></a>;
 
     var xmlhttp = new XMLHttpRequest();
     xmlhttp.keySession = event.target;
@@ -1737,7 +1754,7 @@
   function licenseRequestReady(event) { ... }
 
   function handleInitData(event) {
-    makeNewRequest(mediaKeys, event.<precoderef>initDataType</precoderef>, event.<precoderef>initData</precoderef>);
+    makeNewRequest(mediaKeys, event.<a def-id="encrypted-event-initdatatype-attribute"></a>, event.<a def-id="encrypted-event-initdata-attribute"></a>);
   }
 
   selectKeySystem();
@@ -1779,8 +1796,8 @@
   // This replaces the implementation in the previous example.
   function makeNewRequest(mediaKeys, initDataType, initData) {
     var keySession = mediaKeys.<premethodref>createSession</premethodref>();
-    keySession.addEventListener("<precoderef prefix="event">message</precoderef>", handleMessage, false);
-    keySession.addEventListener("<precoderef prefix="event">keyschange</precoderef>", handleKeysChange, false);
+    keySession.addEventListener("<a def-id="message"></a>", handleMessage, false);
+    keySession.addEventListener("<a def-id="keyschange"></a>", handleKeysChange, false);
     keySession.<precoderef>closed</precoderef>.then(
       console.log.bind(console, "Session closed")
     );
@@ -1800,7 +1817,7 @@
 
   function sendMessage(type, message, keySession) {
     var url = licenseUrl;
-    if (type == "<precoderef>licenserenewal</precoderef>")
+    if (type == <a def-id="message-type-licenserenewal"></a>)
       url = renewalUrl;
     xmlhttp = new XMLHttpRequest();
     xmlhttp.keySession = keySession;
@@ -1813,7 +1830,7 @@
   }
 
   function handleMessage(event) {
-    sendMessage(event.<precoderef>type</precoderef>, event.<precoderef>message</precoderef>, event.target);
+    sendMessage(event.<a def-id="message-event-type-attribute"></a>, event.<a def-id="message-event-message-attribute"></a>, event.target);
   }
 
   function handleKeysChange(event) {
@@ -1871,7 +1888,7 @@
   // Called if the application does not have a stored sessionId for the media resource.
   function makeNewRequest(mediaKeys, initDataType, initData) {
     var keySession = mediaKeys.<premethodref>createSession</premethodref>("persistent");
-    keySession.addEventListener("<precoderef prefix="event">message</precoderef>", handleMessage, false);
+    keySession.addEventListener("<a def-id="message"></a>", handleMessage, false);
     keySession.<precoderef>closed</precoderef>.then(
       function() {
         console.log("Session " + this.sessionId + " closed");
@@ -1889,7 +1906,7 @@
   // Called if the application has a stored sessionId for the media resource.
   function loadStoredSession(mediaKeys, sessionId) {
     var keySession = mediaKeys.<premethodref>createSession</premethodref>("persistent");
-    keySession.addEventListener("<precoderef prefix="event">message</precoderef>", handleMessage, false);
+    keySession.addEventListener("<a def-id="message"></a>", handleMessage, false);
     keySession.<precoderef>closed</precoderef>.then(
       console.log.bind(console, "Session closed")
     );
--- a/encrypted-media/encrypted-media.js	Fri Oct 10 14:42:34 2014 -0700
+++ b/encrypted-media/encrypted-media.js	Fri Oct 10 14:42:59 2014 -0700
@@ -141,9 +141,25 @@
   var emeDefinitions = {
     'eme-spec': { func: link_helper, fragment: '#', link_text: 'Encrypted Media Extensions', },
 
+    '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',  },
+
+    'message-type-licenserequest': { func: idlref_helper, fragment: 'idl-def-MediaKeyMessageType.licenserequest', link_text: '"licenserequest"',  },
+    'message-type-licenserenewal': { func: idlref_helper, fragment: 'idl-def-MediaKeyMessageType.licenserenewal', link_text: '"licenserenewal"',  },
+
+    'MediaKeyMessageType': { func: idlref_helper, fragment: 'idl-def-MediaKeyMessageType', link_text: 'MediaKeyMessageType',  },
+    'MediaKeyMessageEvent': { func: idlref_helper, fragment: 'idl-def-MediaKeyMessageEvent', link_text: 'MediaKeyMessageEvent',  },
+    'message-event-type-attribute': { func: idlref_helper, fragment: 'widl-MediaKeyMessageEvent-type', link_text: 'type',  },
+    'message-event-message-attribute': { func: idlref_helper, fragment: 'widl-MediaKeyMessageEvent-message', link_text: 'message',  },
+    'MediaEncryptedEvent': { func: idlref_helper, fragment: 'idl-def-MediaEncryptedEvent', link_text: 'MediaEncryptedEvent',  },
+    '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',  },
+
     'interface-textencoder': { func: encodingapi_helper, fragment: 'interface-textencoder', link_text: 'TextEncoder interface',  },
     
     'eventdfn': { func: eventdfn_helper, fragment: '', link_text: '', },
+    'event': { func: code_dom_helper, fragment: 'event', link_text: 'Event', },
 
     'videoref': { func: videoref_helper, fragment: '', link_text: '', },
     'media-timeline': { func: videoref_helper, fragment: 'media-timeline', link_text: 'media timeline',  },