[EME] Bug 16553 - Remove obsolete CDM- and key ID-related text in First Time a Key Reference is Encountered algorithm.
authorDavid Dorwin <ddorwin@google.com>
Mon, 04 Nov 2013 17:41:16 -0800
changeset 191 84be32b27d5d
parent 190 47e74f565722
child 192 c6e105c755b9
[EME] Bug 16553 - Remove obsolete CDM- and key ID-related text in First Time a Key Reference is Encountered algorithm.

The CDM should not be involved in the needkey event.

This relates to the following, though does not directly address them or reflect their summaries.
Bug 21855 - Avoid network traffic and duplicate sessions for the same key(s)
Bug 16553 - Consider not firing a needkey event when a potentially encrypted stream is encountered if the key is already known
As noted in Comment 8, the removed text does what the bug summary says.
There was general agreement to remove it.

This also cleans up some issues resulting from the insertion of CORS text in changeset 69dbfb8baca8.
encrypted-media/encrypted-media.html
encrypted-media/encrypted-media.xml
--- a/encrypted-media/encrypted-media.html	Mon Nov 04 15:42:39 2013 -0800
+++ b/encrypted-media/encrypted-media.html	Mon Nov 04 17:41:16 2013 -0800
@@ -844,69 +844,26 @@
     <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="">cdm</var> be null.</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, let <var title="">initData</var> be that initialization data.</p></li>
       <li>
-<p>Determine whether there is an active <a href="#cdm">CDM</a> by following the steps for the first matching condition from the following list:</p>
-      <dl class="switch">
-        <dt>If the media element's <code><a href="#dom-keys">keys</a></code> attribute is not null</dt>
-        <dd>Let <var title="true">cdm</var> be the <var title="true">cdm</var> loaded in the <a href="#dom-media-keys-constructor"><code>MediaKeys</code> constructor</a>.</dd>
-        <dt>Otherwise</dt>
-        <dd>Jump to the <i>Need Key</i> step below.</dd>
-      </dl>
-      </li>
-      <li>
-<p>Use <var title="true">cdm</var> to determine whether the key is known:</p>
-        <ol>
-          <li><p>Let <var title="">key ID</var> be null.</p></li>
-          <li><p>If a key ID for the source is known at this time, let <var title="">key ID</var> be that ID.</p></li>
-          <li><p>If <var title="">initData</var> is not null and contains a key ID, let <var title="">key ID</var> be that ID.</p></li>
-          <li>
-<p>Determine whether the key is already known by following the steps for the first matching condition from the following list:</p>
-          <dl class="switch">
-            <dt>If <var title="">key ID</var> is not null</dt>
-            <dd>
-            <p>Determine whether the key is known by following the steps for the first matching condition from the following list:</p>
-            <dl class="switch">
-              <dt>If there is a key cached for <var title="">key ID</var>
-</dt>
-              <dd>Jump to the <i>Continue Normal Flow</i> step below.</dd>
-              <dt>Otherwise</dt>
-              <dd>Jump to the <i>Need Key</i> step below.</dd>
-            </dl>
-            </dd>
-            <dt>Otherwise</dt>
-            <dd>
-            <p>Determine whether the key is known by following the steps for the first matching condition from the following list:</p>
-            <dl class="switch">
-              <dt>If there is a single key cached (with or without a key ID)</dt>
-              <dd>Jump to the <i>Continue Normal Flow</i> step below.</dd>
-              <dt>Otherwise</dt>
-              <dd>Jump to the <i>Need Key</i> step below.</dd>
-            </dl>
-            </dd>
-          </dl>
-          </li>
-        </ol>
-      </li>
-      <li>
-<p><i>Need Key</i>:</p>
+<p>Follow the steps for the first matching condition from the following list:</p>
         <dl class="switch">
           <dt>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>
 </dt>
           <dd>
-<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>.</dd>
+<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>The event is of type <code><a href="#dom-mediakeyneededevent">MediaKeyNeededEvent</a></code> and has:</p>
+            <ul style="list-style-type:none"><li>
+              <code><a href="#dom-type">type</a></code> = the MIME type of the <a href="http://www.w3.org/TR/html5/embedded-content-0.html#media-data">media data</a> container format<br>
+              <code><a href="#dom-initdata">initData</a></code> = <var title="">initData</var>
+            </li></ul>
+            <p class="non-normative">Firing this event allows the application to begin acquiring the key process before it is needed.</p>
+            <p class="non-normative">Note that <code title="dom-media-readyState"><a href="http://www.w3.org/TR/html5/embedded-content-0.html#dom-media-readystate">readyState</a></code> is <em>not</em> changed and no algorithms are aborted. This event is merely informative.</p>
+          </dd>
           <dt>Otherwise</dt>
-          <dd>Abort media element's <a href="http://www.w3.org/TR/html5/embedded-content-0.html#concept-media-load-resource">resource fetch algorithm</a> and run the steps to report a <code><a href="#dom-media_err_encrypted">MEDIA_ERR_ENCRYPTED</a></code> error.</dd>
+          <dd>Abort media element's <a href="http://www.w3.org/TR/html5/embedded-content-0.html#concept-media-load-resource">resource fetch algorithm</a>, run the steps to report a <code><a href="#dom-media_err_encrypted">MEDIA_ERR_ENCRYPTED</a></code> error, and abort these steps.</dd>
         </dl>
-        <p>The event is of type <code><a href="#dom-mediakeyneededevent">MediaKeyNeededEvent</a></code> and has:</p>
-        <ul style="list-style-type:none"><li>
-          <code><a href="#dom-type">type</a></code> = the MIME type of the <a href="http://www.w3.org/TR/html5/embedded-content-0.html#media-data">media data</a> container format
-          <code><a href="#dom-initdata">initData</a></code> = <var title="">initData</var>
-        </li></ul>
-        <p class="non-normative">Firing this event allows the application to begin acquiring the key process before it is needed.</p>
-        <p class="non-normative">Note that <code title="dom-media-readyState"><a href="http://www.w3.org/TR/html5/embedded-content-0.html#dom-media-readystate">readyState</a></code> is <em>not</em> changed and no algorithms are aborted. This event is merely informative.</p>
       </li>
 
       <li><p><i>Continue Normal Flow</i>: Continue with the existing media element's <a href="http://www.w3.org/TR/html5/embedded-content-0.html#concept-media-load-resource">resource fetch algorithm</a>.</p></li>
--- a/encrypted-media/encrypted-media.xml	Mon Nov 04 15:42:39 2013 -0800
+++ b/encrypted-media/encrypted-media.xml	Mon Nov 04 17:41:16 2013 -0800
@@ -799,62 +799,23 @@
     <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="">cdm</var> be null.</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, let <var title="">initData</var> be that initialization data.</p></li>
-      <li><p>Determine whether there is an active <a href="#cdm">CDM</a> by following the steps for the first matching condition from the following list:</p>
-      <dl class="switch">
-        <dt>If the media element's <coderef>keys</coderef> attribute is not null</dt>
-        <dd>Let <var title="true">cdm</var> be the <var title="true">cdm</var> loaded in the <a href="#dom-media-keys-constructor"><code>MediaKeys</code> constructor</a>.</dd>
-        <dt>Otherwise</dt>
-        <dd>Jump to the <i>Need Key</i> step below.</dd>
-      </dl>
-      </li>
-      <li><p>Use <var title="true">cdm</var> to determine whether the key is known:</p>
-        <ol>
-          <li><p>Let <var title="">key ID</var> be null.</p></li>
-          <li><p>If a key ID for the source is known at this time, let <var title="">key ID</var> be that ID.</p></li>
-          <li><p>If <var title="">initData</var> is not null and contains a key ID, let <var title="">key ID</var> be that ID.</p></li>
-          <li><p>Determine whether the key is already known by following the steps for the first matching condition from the following list:</p>
-          <dl class="switch">
-            <dt>If <var title="">key ID</var> is not null</dt>
-            <dd>
-            <p>Determine whether the key is known by following the steps for the first matching condition from the following list:</p>
-            <dl class="switch">
-              <dt>If there is a key cached for <var title="">key ID</var></dt>
-              <dd>Jump to the <i>Continue Normal Flow</i> step below.</dd>
-              <dt>Otherwise</dt>
-              <dd>Jump to the <i>Need Key</i> step below.</dd>
-            </dl>
-            </dd>
-            <dt>Otherwise</dt>
-            <dd>
-            <p>Determine whether the key is known by following the steps for the first matching condition from the following list:</p>
-            <dl class="switch">
-              <dt>If there is a single key cached (with or without a key ID)</dt>
-              <dd>Jump to the <i>Continue Normal Flow</i> step below.</dd>
-              <dt>Otherwise</dt>
-              <dd>Jump to the <i>Need Key</i> step below.</dd>
-            </dl>
-            </dd>
-          </dl>
-          </li>
-        </ol>
-      </li>
-      <li><p><i>Need Key</i>:</p>
+      <li><p>Follow the steps for the first matching condition from the following list:</p>
         <dl class="switch">
           <dt>If the <videoanchor name="media-data">media data</videoanchor> is <cors-same-origin/></dt>
-          <dd><Queue-a-task/> to <fire-a-simple-event/> named <coderef>needkey</coderef> at the <a href="#media-element">media element</a>.</dd>
+          <dd><Queue-a-task/> to <fire-a-simple-event/> named <coderef>needkey</coderef> at the <a href="#media-element">media element</a>.
+            <p>The event is of type <coderef>MediaKeyNeededEvent</coderef> and has:</p>
+            <ul style="list-style-type:none"><li>
+              <coderef>type</coderef> = the MIME type of the <videoanchor name="media-data">media data</videoanchor> container format<br></br>
+              <coderef>initData</coderef> = <var title="">initData</var>
+            </li></ul>
+            <p class="non-normative">Firing this event allows the application to begin acquiring the key process before it is needed.</p>
+            <p class="non-normative">Note that <readystate/> is <em>not</em> changed and no algorithms are aborted. This event is merely informative.</p>
+          </dd>
           <dt>Otherwise</dt>
-          <dd>Abort media element's <resource-fetch-algorithm/> and run the steps to report a <coderef>MEDIA_ERR_ENCRYPTED</coderef> error.</dd>
+          <dd>Abort media element's <resource-fetch-algorithm/>, run the steps to report a <coderef>MEDIA_ERR_ENCRYPTED</coderef> error, and abort these steps.</dd>
         </dl>
-        <p>The event is of type <coderef>MediaKeyNeededEvent</coderef> and has:</p>
-        <ul style="list-style-type:none"><li>
-          <coderef>type</coderef> = the MIME type of the <videoanchor name="media-data">media data</videoanchor> container format
-          <coderef>initData</coderef> = <var title="">initData</var>
-        </li></ul>
-        <p class="non-normative">Firing this event allows the application to begin acquiring the key process before it is needed.</p>
-        <p class="non-normative">Note that <readystate/> is <em>not</em> changed and no algorithms are aborted. This event is merely informative.</p>
       </li>
 
       <li><p><i>Continue Normal Flow</i>: Continue with the existing media element's <resource-fetch-algorithm/>.</p></li>