[EME] Minor cleanup of isTypeSupported() changes in changeset 60.
authorDavid Dorwin <ddorwin@google.com>
Fri, 11 Jan 2013 20:25:10 -0800
changeset 62 d1a3fcfc773b
parent 61 2e758ded996d
child 63 db164d726dcd
[EME] Minor cleanup of isTypeSupported() changes in changeset 60.
encrypted-media/encrypted-media.html
encrypted-media/encrypted-media.xml
--- a/encrypted-media/encrypted-media.html	Fri Jan 11 19:53:18 2013 -0800
+++ b/encrypted-media/encrypted-media.html	Fri Jan 11 20:25:10 2013 -0800
@@ -384,7 +384,7 @@
       <li>Return the new object to the caller.</li>
     </ol>
 
-    <p>The <dfn id="dom-istypesupported"><code>isTypeSupported(type, keySystem)</code></dfn> method returns whether <var title="true">keySystem</var> supports <var title="true">type</var>.</p>
+    <p>The <dfn id="dom-istypesupported"><code>isTypeSupported(type, keySystem)</code></dfn> method returns whether <var title="true">keySystem</var> is supported with the specified container and codec <var title="true">type</var>(s).</p>
     <div class="example">
       <p>The following list shows some examples.</p>
       <dl>
@@ -402,18 +402,10 @@
     <p>It must run the following steps:</p>
     
     <ol>
-      <li>
-<p>Check whether the <a href="#key-system">Key System</a> is supported with the specified container and codec type(s) by following the steps for the first matching condition from the following list:</p>
-        <dl class="switch">
-          <dt>If <var title="true">keySystem</var> contains an unrecognized or unsupported <a href="#key-system">Key System</a>
-</dt>
-          <dd>Return false.</dd>
-          <dt>If the <a href="#key-system">Key System</a> specified by <var title="true">keySystem</var> does not support decrypting the container and/or codec specified in the rest of the <var title="true">type</var> string.</dt>
-          <dd>Return false.</dd>
-          <dt>Otherwise</dt>
-          <dd>Return true.</dd>
-        </dl>
-      </li>
+      <li><p>If <var title="true">keySystem</var> contains an unrecognized or unsupported <a href="#key-system">Key System</a>, return false and abort these steps.</p></li>
+      <li><p>If <var title="true">type</var> is null or an empty string, return true and abort these steps.</p></li>
+      <li><p>If the <a href="#key-system">Key System</a> specified by <var title="true">keySystem</var> does not support decrypting the container and/or codec specified by <var title="true">type</var>, return false and abort these steps.</p></li>
+      <li><p>Return true.</p></li>
     </ol>
 
     <p>The <dfn id="dom-error"><code>error</code></dfn> attribute is a <code><a href="#dom-mediakeyerror">MediaKeyError</a></code> representing the current error state of the session. It is null if there is no error.</p>
@@ -1160,14 +1152,14 @@
   var licenseUrl;
 
   function selectKeySystem() {
-    if (<a href="#dom-mediakeys">MediaKeys</a>.<a href="#dom-istypesupported">isTypeSupported</a>("video/webm; codecs='vp8, vorbis'", "com.example.somesystem") != "") {
+    if (<a href="#dom-mediakeys">MediaKeys</a>.<a href="#dom-istypesupported">isTypeSupported</a>("video/webm; codecs='vp8, vorbis'", "com.example.somesystem")) {
       licenseUrl = "https://license.example.com/getkey"; // OR "https://example.&lt;My Video Site domain&gt;"
-      if (<a href="#dom-mediakeys">MediaKeys</a>.<a href="#dom-istypesupported">isTypeSupported</a>("video/webm; codecs='vp8, vorbis'", "com.example.somesystem.2_0") != "") {
+      if (<a href="#dom-mediakeys">MediaKeys</a>.<a href="#dom-istypesupported">isTypeSupported</a>("video/webm; codecs='vp8, vorbis'", "com.example.somesystem.2_0")) {
         keySystem = "com.example.somesystem.2_0";
-      } else if (<a href="#dom-mediakeys">MediaKeys</a>.<a href="#dom-istypesupported">isTypeSupported</a>("video/webm; codecs='vp8, vorbis'", "com.example.somesystem.1_5") != "") {
+      } else if (<a href="#dom-mediakeys">MediaKeys</a>.<a href="#dom-istypesupported">isTypeSupported</a>("video/webm; codecs='vp8, vorbis'", "com.example.somesystem.1_5")) {
         keySystem = "com.example.somesystem.1_5";
       }
-    } else if (<a href="#dom-mediakeys">MediaKeys</a>.<a href="#dom-istypesupported">isTypeSupported</a>("video/webm; codecs='vp8, vorbis'", "foobar") != "" {
+    } else if (<a href="#dom-mediakeys">MediaKeys</a>.<a href="#dom-istypesupported">isTypeSupported</a>("video/webm; codecs='vp8, vorbis'", "foobar")) {
       licenseUrl = "https://license.foobar.com/request";
       keySystem = "foobar";
     } else {
--- a/encrypted-media/encrypted-media.xml	Fri Jan 11 19:53:18 2013 -0800
+++ b/encrypted-media/encrypted-media.xml	Fri Jan 11 20:25:10 2013 -0800
@@ -372,7 +372,7 @@
       <li>Return the new object to the caller.</li>
     </ol>
 
-    <p>The <methoddfn name="isTypeSupported">isTypeSupported(<var title="true">type</var>, <var title="true">keySystem</var>)</methoddfn> method returns whether <var title="true">keySystem</var> supports <var title="true">type</var>.</p>
+    <p>The <methoddfn name="isTypeSupported">isTypeSupported(<var title="true">type</var>, <var title="true">keySystem</var>)</methoddfn> method returns whether <var title="true">keySystem</var> is supported with the specified container and codec <var title="true">type</var>(s).</p>
     <div class="example">
       <p>The following list shows some examples.</p>
       <dl>
@@ -390,16 +390,10 @@
     <p>It must run the following steps:</p>
     
     <ol>
-      <li><p>Check whether the <a href="#key-system">Key System</a> is supported with the specified container and codec type(s) by following the steps for the first matching condition from the following list:</p>
-        <dl class="switch">
-          <dt>If <var title="true">keySystem</var> contains an unrecognized or unsupported <a href="#key-system">Key System</a></dt>
-          <dd>Return false.</dd>
-          <dt>If the <a href="#key-system">Key System</a> specified by <var title="true">keySystem</var> does not support decrypting the container and/or codec specified in the rest of the <var title="true">type</var> string.</dt>
-          <dd>Return false.</dd>
-          <dt>Otherwise</dt>
-          <dd>Return true.</dd>
-        </dl>
-      </li>
+      <li><p>If <var title="true">keySystem</var> contains an unrecognized or unsupported <a href="#key-system">Key System</a>, return false and abort these steps.</p></li>
+      <li><p>If <var title="true">type</var> is null or an empty string, return true and abort these steps.</p></li>
+      <li><p>If the <a href="#key-system">Key System</a> specified by <var title="true">keySystem</var> does not support decrypting the container and/or codec specified by <var title="true">type</var>, return false and abort these steps.</p></li>
+      <li><p>Return true.</p></li>
     </ol>
 
     <p>The <codedfn>error</codedfn> attribute is a <coderef>MediaKeyError</coderef> representing the current error state of the session. It is null if there is no error.</p>
@@ -1104,14 +1098,14 @@
   var licenseUrl;
 
   function selectKeySystem() {
-    if (<precoderef>MediaKeys</precoderef>.<premethodref>isTypeSupported</premethodref>("video/webm; codecs='vp8, vorbis'", "com.example.somesystem") != "") {
+    if (<precoderef>MediaKeys</precoderef>.<premethodref>isTypeSupported</premethodref>("video/webm; codecs='vp8, vorbis'", "com.example.somesystem")) {
       licenseUrl = "https://license.example.com/getkey"; // OR "https://example.&lt;My Video Site domain&gt;"
-      if (<precoderef>MediaKeys</precoderef>.<premethodref>isTypeSupported</premethodref>("video/webm; codecs='vp8, vorbis'", "com.example.somesystem.2_0") != "") {
+      if (<precoderef>MediaKeys</precoderef>.<premethodref>isTypeSupported</premethodref>("video/webm; codecs='vp8, vorbis'", "com.example.somesystem.2_0")) {
         keySystem = "com.example.somesystem.2_0";
-      } else if (<precoderef>MediaKeys</precoderef>.<premethodref>isTypeSupported</premethodref>("video/webm; codecs='vp8, vorbis'", "com.example.somesystem.1_5") != "") {
+      } else if (<precoderef>MediaKeys</precoderef>.<premethodref>isTypeSupported</premethodref>("video/webm; codecs='vp8, vorbis'", "com.example.somesystem.1_5")) {
         keySystem = "com.example.somesystem.1_5";
       }
-    } else if (<precoderef>MediaKeys</precoderef>.<premethodref>isTypeSupported</premethodref>("video/webm; codecs='vp8, vorbis'", "foobar") != "" {
+    } else if (<precoderef>MediaKeys</precoderef>.<premethodref>isTypeSupported</premethodref>("video/webm; codecs='vp8, vorbis'", "foobar")) {
       licenseUrl = "https://license.foobar.com/request";
       keySystem = "foobar";
     } else {