[EME] Bug 25506 - Convert algorithm references.
authorDavid Dorwin <ddorwin@google.com>
Fri, 10 Oct 2014 14:54:46 -0700
changeset 461 e3fc021a0f98
parent 460 57861d0e6e47
child 462 23e27105939a
[EME] Bug 25506 - Convert algorithm references.
encrypted-media/encrypted-media-respec.html
encrypted-media/encrypted-media.js
--- a/encrypted-media/encrypted-media-respec.html	Fri Oct 10 14:54:36 2014 -0700
+++ b/encrypted-media/encrypted-media-respec.html	Fri Oct 10 14:54:46 2014 -0700
@@ -295,7 +295,7 @@
       <dd>
         A session for which a record of or data related to the session MAY be persisted.
         The application is responsible for managing any such storage that may be generated by the CDM.
-        See <a href="#session-storage">Session Storage and Persistence</a>.
+        See <a def-id="session-storage"></a>.
       </dd>
     </dl>
 
@@ -489,7 +489,7 @@
 
       <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.
+        <p>Signals when object becomes closed as a result of the <a def-id="session-close-algorithm"></a> being run.
         This promise can only be fulfilled and is never rejected.</p>
       </dd>
     
@@ -548,14 +548,14 @@
               <li><p>Let <var title="true">message</var> be a request for the <var title="true">requested session type</var> generated based on the <var>init data</var>, which is interpreted per <var title="true">initDataType</var>.</p>
                 <p class="note">For example, a license request.</p>
                 <p>The <var title="true">cdm</var> must not use any stream-specific data, including <a def-id="media-data"></a>, not provided via the <var>init data</var>.</p>
-                <p>The <var title="true">cdm</var> should <em>not</em> store session data, including the session ID, at this point. See <a href="#session-storage">Session Storage and Persistence</a>.</p>
+                <p>The <var title="true">cdm</var> should <em>not</em> store session data, including the session ID, at this point. See <a def-id="session-storage"></a>.</p>
               </li>
             </ol>
           </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>
+          <li><p>Run the <a def-id="queue-message-algorithm"></a> 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>
@@ -609,11 +609,11 @@
           <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>
+          <li><p>If the loaded session contains usable keys, run the <a def-id="keys-changed-algorithm"></a> 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>
           </li>
-          <li><p>Run the <a href="#algorithms-update-expiration">Update Expiration</a> algorithm on the <var title="true">session</var>, providing <var title="true">expiration time</var>.</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>Run the <a def-id="update-expiration-algorithm"></a> on the <var title="true">session</var>, providing <var title="true">expiration time</var>.</p></li>
+          <li><p>If <var title="true">message</var> is not null, run the <a def-id="queue-message-algorithm"></a> 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> with <code>true</code>.</p></li>
         </ol>
       </li>
@@ -658,7 +658,7 @@
                   <dt>Otherwise</dt>
                   <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>See also <a def-id="session-storage"></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>
                 <p class="note">The replacement algorithm within a session is <a def-id="keysystem"></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>
@@ -666,10 +666,10 @@
                 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> 
-              <li><p>If the set of usable keys changed, run the <a href="#algorithms-keys-changed">Usable Keys Changed</a> algorithm on the <var title="true">session</var>.</p>
+              <li><p>If the set of usable keys changed, run the <a def-id="keys-changed-algorithm"></a> 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>
               </li>
-              <li><p>If the expiration time for the session changed, run the <a href="#algorithms-update-expiration">Update Expiration</a> algorithm on the <var title="true">session</var>, providing the new expiration time.</p></li>
+              <li><p>If the expiration time for the session changed, run the <a def-id="update-expiration-algorithm"></a> on the <var title="true">session</var>, providing the new expiration time.</p></li>
               <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>
@@ -679,7 +679,7 @@
             </ol>
           </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>If <var title="true">message</var> is not null, run the <a def-id="queue-message-algorithm"></a> 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>
       </li>
@@ -694,7 +694,7 @@
 
     <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> <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>If the <a def-id="session-close-algorithm"></a> 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>
         <ol>
@@ -705,7 +705,7 @@
                 <p>Process the close request.</p>
                 <p>Do not remove stored session data.</p>
               </li>
-              <li><p>If the previous step caused the session to be closed, run the <a href="#algorithms-session-close">Session Close</a> algorithm on this object.</p></li>
+              <li><p>If the previous step caused the session to be closed, run the <a def-id="session-close-algorithm"></a> on this object.</p></li>
             </ol>
           </li>
           <li><p>Resolve <var>promise</var>.</p></li>
@@ -722,7 +722,7 @@
     <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> <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>If the <a def-id="session-close-algorithm"></a> 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>
@@ -740,7 +740,7 @@
           <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> <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>Run the <a def-id="session-close-algorithm"></a> on this object.</p></li>
               <li><p>Resolve <var>promise</var>.</p></li>
             </ol>
           </li>
@@ -885,7 +885,7 @@
     <ol>
       <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 media element(s) whose <a def-id="mediaKeys-attribute"></a> attribute is the MediaKeys object that created the <var title="true">session</var>.</p>
+      <li><p><a def-id="Queue-a-task-to-run-algorithm"></a> <a def-id="resume-playback-algorithm"></a> on each of the media element(s) whose <a def-id="mediaKeys-attribute"></a> 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>
       </li>
@@ -992,7 +992,7 @@
     </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, <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.
+      A session may only be loaded again after the <a def-id="session-close-algorithm"></a> 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 <a def-id="remove"></a>.
       The CDM may also remove sessions as appropriate, but applications should not rely on this.
@@ -1032,7 +1032,7 @@
 
       <dt>readonly attribute MediaWaitingFor waitingFor</dt>
       <dd>
-        <p>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>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 def-id="encrypted-block-algorithm"></a>.</p>
       </dd>
 
       <dt>attribute EventHandler onencrypted</dt>
@@ -1073,7 +1073,7 @@
                   <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>
+              <li><p><a def-id="Queue-a-task-to-run-algorithm"></a> <a def-id="resume-playback-algorithm"></a> on the media element.</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 <var>mediaKeys</var> has no sessions.</p>
               </li>
@@ -1198,7 +1198,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 <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>
+          <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 def-id="session-close-algorithm"></a> 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>
@@ -1251,7 +1251,7 @@
         <p>Run the following steps:</p>
         <p class="note">These steps are reached when there is no usable key for the block.</p>
         <ol>
-          <li><p>Run the <a href="#algorithms-queue-waiting">Queue a "waiting" Event</a> algorithm on the media element.</p></li>
+          <li><p>Run the <a def-id="queue-waiting-algorithm"></a> on the media element.</p></li>
           <li><p>Wait for a signal to resume playback.</p></li>
         </ol>
       </li>
@@ -1304,7 +1304,7 @@
     <ol>
       <li><p>Let the <var title="true">media element</var> be the specified <a def-id="htmlmediaelement"></a> object.</p></li>
       <li><p>If the <a def-id="waitingFor"></a> attribute on the <var title="true">media element</var> is not <a def-id="MediaWaitingFor-key"></a>, abort these steps.</p></li>
-      <li><p>Attempt to resume the <a def-id="resource-fetch-algorithm"></a> by running the <a href="#algorithms-encrypted-block">Encrypted Block Encountered</a> algorithm.</p></li>
+      <li><p>Attempt to resume the <a def-id="resource-fetch-algorithm"></a> by running the <a def-id="encrypted-block-algorithm"></a>.</p></li>
       <li><p>If the user agent can advance the <a def-id="current-playback-position"></a> in the <a def-id="direction-of-playback"></a>, run the following steps:</p>
         <ol>
           <li><p><a def-id="Queue-a-task-to-fire-an-event-named"></a> <a def-id="canplay"></a> at the <var title="true">media element</var>.</p></li>
--- a/encrypted-media/encrypted-media.js	Fri Oct 10 14:54:36 2014 -0700
+++ b/encrypted-media/encrypted-media.js	Fri Oct 10 14:54:46 2014 -0700
@@ -194,6 +194,15 @@
     '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',  },
 
+    'queue-message-algorithm': { func: term_helper, fragment: 'algorithms-queue-message', link_text: 'queue a "message" event algorithm',  },
+    'session-close-algorithm': { func: term_helper, fragment: 'algorithms-session-close', link_text: 'session close algorithm',  },
+    'encrypted-block-algorithm': { func: term_helper, fragment: 'algorithms-encrypted-block', link_text: 'encrypted block encountered algorithm',  },
+    'keys-changed-algorithm': { func: term_helper, fragment: 'algorithms-keys-changed', link_text: 'usable keys changed algorithm',  },
+    'update-expiration-algorithm': { func: term_helper, fragment: 'algorithms-update-expiration', link_text: 'update expiration algorithm',  },
+    'resume-playback-algorithm': { func: term_helper, fragment: 'algorithms-resume-playback', link_text: 'attempt to resume playback if necessary algorithm',  },
+    'queue-waiting-algorithm': { func: term_helper, fragment: 'algorithms-queue-waiting', link_text: 'queue a "waiting" event algorithm',  },
+    'session-storage': { func: term_helper, fragment: 'session-storage', link_text: 'Session Storage and Persistence',  },
+
     'MediaWaitingFor-none': { func: idlref_helper, fragment: 'idl-def-MediaWaitingFor.none', link_text: '"none"',  },
     'MediaWaitingFor-key': { func: idlref_helper, fragment: 'idl-def-MediaWaitingFor.key', link_text: '"key"',  },
     'MediaWaitingFor-data': { func: idlref_helper, fragment: 'idl-def-MediaWaitingFor.data', link_text: '"data"',  },