[EME] Bug 24951 - Minor updates to algorithms involving initDataType.
authorDavid Dorwin <ddorwin@google.com>
Wed, 02 Apr 2014 17:09:40 -0700
changeset 276 3d45b0dfdb81
parent 275 ad3fa6e5b1cf
child 277 77ec878da37a
[EME] Bug 24951 - Minor updates to algorithms involving initDataType.
encrypted-media/encrypted-media.html
encrypted-media/encrypted-media.xml
--- a/encrypted-media/encrypted-media.html	Wed Apr 02 17:08:43 2014 -0700
+++ b/encrypted-media/encrypted-media.html	Wed Apr 02 17:09:40 2014 -0700
@@ -392,8 +392,7 @@
     <ol>
       <li><p>If <var title="true">initDataType</var> is an empty string, throw an <code><a href="http://www.w3.org/TR/dom/#dom-domexception-invalid_access_err">INVALID_ACCESS_ERR</a></code> exception and abort these steps.</p></li>
       <li><p>If <var title="true">initData</var> is null or an empty array, throw an <code><a href="http://www.w3.org/TR/dom/#dom-domexception-invalid_access_err">INVALID_ACCESS_ERR</a></code> exception and abort these steps.</p></li>
-      <li><p>If <var title="true">initDataType</var> contains an invalid or unrecognized <a href="#initialization-data-type">initialization data type</a>, throw a <code><a href="http://www.w3.org/TR/dom/#dom-domexception-not_supported_err">NOT_SUPPORTED_ERR</a></code> exception and abort these steps.</p></li>
-      <li><p>If the <a href="#cdm">content decryption module</a> corresponding to the <code><a href="#dom-keysystem">keySystem</a></code> attribute does not support the <a href="#initialization-data">Initialization Data</a> format <var title="true">initDataType</var>, throw a <code><a href="http://www.w3.org/TR/dom/#dom-domexception-not_supported_err">NOT_SUPPORTED_ERR</a></code> exception and abort these steps.</p></li>
+      <li><p>If <var title="true">initDataType</var> is not an <a href="#initialization-data-type">initialization data type</a> supported by the <a href="#cdm">content decryption module</a> corresponding to the <code><a href="#dom-keysystem">keySystem</a></code>, throw a <code><a href="http://www.w3.org/TR/dom/#dom-domexception-not_supported_err">NOT_SUPPORTED_ERR</a></code> exception and abort these steps.</p></li>
       <li>Let <var title="true">session</var> be a new <code><a href="#dom-mediakeysession">MediaKeySession</a></code> object, and initialize it as follows:
         <ol>
           <li><p>Set the <code><a href="#dom-error">error</a></code> attribute to null.</p></li>
@@ -804,7 +803,7 @@
 <var title="">event</var> . <code><a href="#dom-initdatatype">initDataType</a></code>
 </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>
+       <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> . <code><a href="#dom-initdata">initData</a></code>
@@ -918,8 +917,15 @@
     <p>The following steps are run when the <a href="#media-element">media element</a> encounters a source that may contain encrypted blocks or streams during the <a href="http://www.w3.org/TR/html5/embedded-content-0.html#concept-media-load-resource">resource fetch algorithm</a>:</p>
 
     <ol>
+      <li><p>Let <var title="">initDataType</var> be the empty string.</p></li>
       <li><p>Let <var title="">initData</var> be null.</p></li>
-      <li><p>If <a href="#initialization-data">Initialization Data</a> was encountered and if the <a href="http://www.w3.org/TR/html5/embedded-content-0.html#media-data">media data</a> is <a href="http://www.w3.org/TR/html5/infrastructure.html#cors-same-origin">CORS-same-origin</a>, let <var title="">initData</var> be that initialization data. Let <var title="">initDataType</var> be the string representing the <a href="#initialization-data-type">initialization data type</a>.</p></li>
+      <li>
+        <p>If <a href="#initialization-data">Initialization Data</a> was encountered and if the <a href="http://www.w3.org/TR/html5/embedded-content-0.html#media-data">media data</a> is <a href="http://www.w3.org/TR/html5/infrastructure.html#cors-same-origin">CORS-same-origin</a>, run the following steps:</p>
+        <ol>
+          <li><p>Let <var title="">initDataType</var> be the string representing the <a href="#initialization-data-type">initialization data type</a> of that initialization data.</p></li>
+          <li><p>Let <var title="">initData</var> be that initialization data.</p></li>
+        </ol>
+      </li>
       <li>
         <p><a href="http://www.w3.org/TR/html5/webappapis.html#queue-a-task">Queue a task</a> to <a href="http://www.w3.org/TR/html5/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="#dom-needkey">needkey</a></code> at the <a href="#media-element">media element</a>.</p>
         <p>The event is of type <code><a href="#dom-mediakeyneededevent">MediaKeyNeededEvent</a></code> and has:</p>
--- a/encrypted-media/encrypted-media.xml	Wed Apr 02 17:08:43 2014 -0700
+++ b/encrypted-media/encrypted-media.xml	Wed Apr 02 17:09:40 2014 -0700
@@ -389,8 +389,7 @@
     <ol>
       <li><p>If <var title="true">initDataType</var> is an empty string, throw an <invalid-access-err/> exception and abort these steps.</p></li>
       <li><p>If <var title="true">initData</var> is null or an empty array, throw an <invalid-access-err/> exception and abort these steps.</p></li>
-      <li><p>If <var title="true">initDataType</var> contains an invalid or unrecognized <a href="#initialization-data-type">initialization data type</a>, throw a <not-supported-err/> exception and abort these steps.</p></li>
-      <li><p>If the <a href="#cdm">content decryption module</a> corresponding to the <coderef>keySystem</coderef> attribute does not support the <a href="#initialization-data">Initialization Data</a> format <var title="true">initDataType</var>, throw a <not-supported-err/> exception and abort these steps.</p></li>
+      <li><p>If <var title="true">initDataType</var> is not an <a href="#initialization-data-type">initialization data type</a> supported by the <a href="#cdm">content decryption module</a> corresponding to the <coderef>keySystem</coderef>, throw a <not-supported-err/> exception and abort these steps.</p></li>
       <li>Let <var title="true">session</var> be a new <coderef>MediaKeySession</coderef> object, and initialize it as follows:
         <ol>
           <li><p>Set the <coderef>error</coderef> attribute to null.</p></li>
@@ -771,7 +770,7 @@
     <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>
+       <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>
@@ -878,8 +877,15 @@
     <p>The following steps are run when the <a href="#media-element">media element</a> encounters a source that may contain encrypted blocks or streams during the <resource-fetch-algorithm/>:</p>
 
     <ol>
+      <li><p>Let <var title="">initDataType</var> be the empty string.</p></li>
       <li><p>Let <var title="">initData</var> be null.</p></li>
-      <li><p>If <a href="#initialization-data">Initialization Data</a> was encountered and if the <videoanchor name="media-data">media data</videoanchor> is <cors-same-origin/>, let <var title="">initData</var> be that initialization data. Let <var title="">initDataType</var> be the string representing the <a href="#initialization-data-type">initialization data type</a>.</p></li>
+      <li>
+        <p>If <a href="#initialization-data">Initialization Data</a> was encountered and if the <videoanchor name="media-data">media data</videoanchor> is <cors-same-origin/>, run the following steps:</p>
+        <ol>
+          <li><p>Let <var title="">initDataType</var> be the string representing the <a href="#initialization-data-type">initialization data type</a> of that initialization data.</p></li>
+          <li><p>Let <var title="">initData</var> be that initialization data.</p></li>
+        </ol>
+      </li>
       <li>
         <p><Queue-a-task/> to <fire-a-simple-event/> named <coderef>needkey</coderef> at the <a href="#media-element">media element</a>.</p>
         <p>The event is of type <coderef>MediaKeyNeededEvent</coderef> and has:</p>