[EME] Bug 24117 - keys and setMediaKeys() should be named consistently
authorAdrian Bateman <adrianba@microsoft.com>
Tue, 07 Jan 2014 09:05:30 -0800
changeset 230 5356bcc1bf3a
parent 229 0fac368f1ba5
child 231 1cbd047358a4
[EME] Bug 24117 - keys and setMediaKeys() should be named consistently
encrypted-media/encrypted-media.html
encrypted-media/encrypted-media.xml
--- a/encrypted-media/encrypted-media.html	Tue Jan 07 08:48:53 2014 -0800
+++ b/encrypted-media/encrypted-media.html	Tue Jan 07 09:05:30 2014 -0800
@@ -253,7 +253,7 @@
     <pre class="idl">
 partial interface <dfn id="dom-htmlmediaelement">HTMLMediaElement</dfn> {
   // Encrypted Media
-  readonly attribute <a href="#dom-mediakeys">MediaKeys</a> <a href="#dom-keys">keys</a>;
+  readonly attribute <a href="#dom-mediakeys">MediaKeys</a> <a href="#dom-attrmediakeys">mediaKeys</a>;
   void <a href="#dom-setmediakeys">setMediaKeys</a>(<a href="#dom-mediakeys">MediaKeys</a> mediaKeys);
   
   attribute <a href="http://www.w3.org/TR/html5/webappapis.html#eventhandler">EventHandler</a> <a href="#dom-onneedkey">onneedkey</a>;
@@ -286,12 +286,12 @@
   attribute DOMString <a href="#dom-sourcekeysystem">keySystem</a>;
 };</pre>
 
-    <p>The <dfn id="dom-keys"><code>keys</code></dfn> attribute is the <code><a href="#dom-mediakeys">MediaKeys</a></code> being used when decrypting encrypted <a href="http://www.w3.org/TR/html5/embedded-content-0.html#media-data">media data</a> for this <a href="#media-element">media element</a>.</p>
+    <p>The <dfn id="dom-attrmediakeys"><code>mediaKeys</code></dfn> attribute is the <code><a href="#dom-mediakeys">MediaKeys</a></code> being used when decrypting encrypted <a href="http://www.w3.org/TR/html5/embedded-content-0.html#media-data">media data</a> for this <a href="#media-element">media element</a>.</p>
     <p>The <dfn id="dom-setmediakeys"><code>setMediaKeys</code></dfn> method provides the <code><a href="#dom-mediakeys">MediaKeys</a></code> to use. When calling this method, the media element must run the following steps:</p>
     
     <ol>
       <li><p>If the <code><a href="#dom-mediakeys">MediaKeys</a></code> object is already in use and the user agent is unable to re-use it with this element, throw a <code><a href="https://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-domexception-quota_exceeded_err">QUOTA_EXCEEDED_ERR</a></code> exception and abort these steps.</p></li>
-      <li>Set the <code><a href="#dom-keys">keys</a></code> attribute of the media element to <var>mediaKeys</var>.</li>
+      <li>Set the <code><a href="#dom-attrmediakeys">mediaKeys</a></code> attribute of the media element to <var>mediaKeys</var>.</li>
     </ol>
     
     <p class="non-normative">Note: as a best practice, applications should create a MediaKeys object and call setMediaKeys before providing media data (for example, setting the src attribute of the media element). This avoids potential delays in some implementations.</p>
@@ -932,7 +932,7 @@
       <li>
 <p>Follow 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>
+        <dt>If the media element's <code><a href="#dom-attrmediakeys">mediaKeys</a></code> attribute is not null:</dt>
         <dd>Run the following steps:
           <ol>
             <li><p>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>.</p></li>
@@ -1267,12 +1267,12 @@
   function load() {
     var video = document.getElementById("video");
 
-    if (!video.<a href="#dom-keys">keys</a>)
+    if (!video.<a href="#dom-attrmediakeys">mediaKeys</a>)
       video.<a href="#dom-setmediakeys">setMediaKeys</a>(new <a href="#dom-mediakeys">MediaKeys</a>("org.w3.clearkey"));
     if (!video.<a href="#dom-keys">keys</a>)
       throw "Could not create MediaKeys";
 
-    var keySession = video.<a href="#dom-keys">keys</a>.<a href="#dom-createsession">createSession</a>();
+    var keySession = video.<a href="#dom-attrmediakeys">mediaKeys</a>.<a href="#dom-createsession">createSession</a>();
     if (!keySession)
       throw "Could not create key session";
 
@@ -1306,12 +1306,12 @@
   function handleKeyNeeded(event) {
     var video = event.target;
 
-    if (!video.<a href="#dom-keys">keys</a>)
+    if (!video.<a href="#dom-attrmediakeys">mediaKeys</a>)
       video.<a href="#dom-setmediakeys">setMediaKeys</a>(new <a href="#dom-mediakeys">MediaKeys</a>("org.w3.clearkey"));
-    if (!video.<a href="#dom-keys">keys</a>)
+    if (!video.<a href="#dom-attrmediakeys">mediaKeys</a>)
       throw "Could not create MediaKeys";
 
-    var keySession = video.<a href="#dom-keys">keys</a>.<a href="#dom-createsession">createSession</a>(event.<a href="#dom-type">type</a>, event.<a href="#dom-initdata">initData</a>);
+    var keySession = video.<a href="#dom-attrmediakeys">mediaKeys</a>.<a href="#dom-createsession">createSession</a>(event.<a href="#dom-type">type</a>, event.<a href="#dom-initdata">initData</a>);
     if (!keySession)
       throw "Could not create key session";
 
@@ -1346,12 +1346,12 @@
   function handleKeyNeeded(event) {
     var video = event.target;
 
-    if (!video.<a href="#dom-keys">keys</a>)
+    if (!video.<a href="#dom-attrmediakeys">mediaKeys</a>)
       video.<a href="#dom-setmediakeys">setMediaKeys</a>(new <a href="#dom-mediakeys">MediaKeys</a>("com.example.somesystem.1_0"));
-    if (!video.<a href="#dom-keys">keys</a>)
+    if (!video.<a href="#dom-attrmediakeys">mediaKeys</a>)
       throw "Could not create MediaKeys";
 
-    var keySession = video.<a href="#dom-keys">keys</a>.<a href="#dom-createsession">createSession</a>(event.<a href="#dom-type">type</a>, event.<a href="#dom-initdata">initData</a>);
+    var keySession = video.<a href="#dom-attrmediakeys">mediaKeys</a>.<a href="#dom-createsession">createSession</a>(event.<a href="#dom-type">type</a>, event.<a href="#dom-initdata">initData</a>);
     if (!keySession)
       throw "Could not create key session";
 
@@ -1404,14 +1404,14 @@
   function handleKeyNeeded(event) {
     var video = event.target;
 
-    if (!video.<a href="#dom-keys">keys</a>) {
+    if (!video.<a href="#dom-attrmediakeys">mediaKeys</a>) {
       selectKeySystem();
       video.<a href="#dom-setmediakeys">setMediaKeys</a>(new <a href="#dom-mediakeys">MediaKeys</a>(keySystem));
     }
-    if (!video.<a href="#dom-keys">keys</a>)
+    if (!video.<a href="#dom-attrmediakeys">mediaKeys</a>)
       throw "Could not create MediaKeys";
 
-    var keySession = video.<a href="#dom-keys">keys</a>.<a href="#dom-createsession">createSession</a>(event.<a href="#dom-type">type</a>, event.<a href="#dom-initdata">initData</a>);
+    var keySession = video.<a href="#dom-attrmediakeys">mediaKeys</a>.<a href="#dom-createsession">createSession</a>(event.<a href="#dom-type">type</a>, event.<a href="#dom-initdata">initData</a>);
     if (!keySession)
       throw "Could not create key session";
 
@@ -1483,14 +1483,14 @@
   function handleKeyNeeded(event) {
     var video = event.target;
 
-    if (!video.<a href="#dom-keys">keys</a>) {
+    if (!video.<a href="#dom-attrmediakeys">mediaKeys</a>) {
       selectKeySystem();  // See previous example for implementation.
       video.<a href="#dom-setmediakeys">setMediaKeys</a>(new <a href="#dom-mediakeys">MediaKeys</a>(keySystem));
     }
-    if (!video.<a href="#dom-keys">keys</a>)
+    if (!video.<a href="#dom-attrmediakeys">mediaKeys</a>)
       throw "Could not create MediaKeys";
 
-    var keySession = video.<a href="#dom-keys">keys</a>.<a href="#dom-createsession">createSession</a>(event.<a href="#dom-type">type</a>, event.<a href="#dom-initdata">initData</a>);
+    var keySession = video.<a href="#dom-attrmediakeys">mediaKeys</a>.<a href="#dom-createsession">createSession</a>(event.<a href="#dom-type">type</a>, event.<a href="#dom-initdata">initData</a>);
     if (!keySession)
       throw "Could not create key session";
 
--- a/encrypted-media/encrypted-media.xml	Tue Jan 07 08:48:53 2014 -0800
+++ b/encrypted-media/encrypted-media.xml	Tue Jan 07 09:05:30 2014 -0800
@@ -250,7 +250,7 @@
     <pre class="idl">
 partial interface <precodedfn>HTMLMediaElement</precodedfn> {
   // Encrypted Media
-  readonly attribute <precoderef>MediaKeys</precoderef> <precoderef>keys</precoderef>;
+  readonly attribute <precoderef>MediaKeys</precoderef> <precoderef prefix="attr">mediaKeys</precoderef>;
   void <premethodref>setMediaKeys</premethodref>(<precoderef>MediaKeys</precoderef> mediaKeys);
   
   attribute <EventHandler/> <precoderef>onneedkey</precoderef>;
@@ -283,12 +283,12 @@
   attribute DOMString <precoderef prefix="source">keySystem</precoderef>;
 };</pre>
 
-    <p>The <codedfn>keys</codedfn> attribute is the <coderef>MediaKeys</coderef> being used when decrypting encrypted <videoanchor name="media-data">media data</videoanchor> for this <a href="#media-element">media element</a>.</p>
+    <p>The <codedfn prefix="attr">mediaKeys</codedfn> attribute is the <coderef>MediaKeys</coderef> being used when decrypting encrypted <videoanchor name="media-data">media data</videoanchor> for this <a href="#media-element">media element</a>.</p>
     <p>The <methoddfn name="setMediaKeys">setMediaKeys</methoddfn> method provides the <coderef>MediaKeys</coderef> to use. When calling this method, the media element must run the following steps:</p>
     
     <ol>
       <li><p>If the <coderef>MediaKeys</coderef> object is already in use and the user agent is unable to re-use it with this element, throw a <quota-exceeded-err/> exception and abort these steps.</p></li>
-      <li>Set the <coderef>keys</coderef> attribute of the media element to <var>mediaKeys</var>.</li>
+      <li>Set the <coderef prefix="attr">mediaKeys</coderef> attribute of the media element to <var>mediaKeys</var>.</li>
     </ol>
     
     <p class="non-normative">Note: as a best practice, applications should create a MediaKeys object and call setMediaKeys before providing media data (for example, setting the src attribute of the media element). This avoids potential delays in some implementations.</p>
@@ -883,7 +883,7 @@
     <ol>
       <li><p>Follow 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>
+        <dt>If the media element's <coderef prefix="attr">mediaKeys</coderef> attribute is not null:</dt>
         <dd>Run the following steps:
           <ol>
             <li><p>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>.</p></li>
@@ -1206,12 +1206,12 @@
   function load() {
     var video = document.getElementById("video");
 
-    if (!video.<precoderef>keys</precoderef>)
+    if (!video.<precoderef prefix="attr">mediaKeys</precoderef>)
       video.<premethodref>setMediaKeys</premethodref>(new <precoderef>MediaKeys</precoderef>("org.w3.clearkey"));
     if (!video.<precoderef>keys</precoderef>)
       throw "Could not create MediaKeys";
 
-    var keySession = video.<precoderef>keys</precoderef>.<premethodref>createSession</premethodref>();
+    var keySession = video.<precoderef prefix="attr">mediaKeys</precoderef>.<premethodref>createSession</premethodref>();
     if (!keySession)
       throw "Could not create key session";
 
@@ -1245,12 +1245,12 @@
   function handleKeyNeeded(event) {
     var video = event.target;
 
-    if (!video.<precoderef>keys</precoderef>)
+    if (!video.<precoderef prefix="attr">mediaKeys</precoderef>)
       video.<premethodref>setMediaKeys</premethodref>(new <precoderef>MediaKeys</precoderef>("org.w3.clearkey"));
-    if (!video.<precoderef>keys</precoderef>)
+    if (!video.<precoderef prefix="attr">mediaKeys</precoderef>)
       throw "Could not create MediaKeys";
 
-    var keySession = video.<precoderef>keys</precoderef>.<premethodref>createSession</premethodref>(event.<precoderef>type</precoderef>, event.<precoderef>initData</precoderef>);
+    var keySession = video.<precoderef prefix="attr">mediaKeys</precoderef>.<premethodref>createSession</premethodref>(event.<precoderef>type</precoderef>, event.<precoderef>initData</precoderef>);
     if (!keySession)
       throw "Could not create key session";
 
@@ -1285,12 +1285,12 @@
   function handleKeyNeeded(event) {
     var video = event.target;
 
-    if (!video.<precoderef>keys</precoderef>)
+    if (!video.<precoderef prefix="attr">mediaKeys</precoderef>)
       video.<premethodref>setMediaKeys</premethodref>(new <precoderef>MediaKeys</precoderef>("com.example.somesystem.1_0"));
-    if (!video.<precoderef>keys</precoderef>)
+    if (!video.<precoderef prefix="attr">mediaKeys</precoderef>)
       throw "Could not create MediaKeys";
 
-    var keySession = video.<precoderef>keys</precoderef>.<premethodref>createSession</premethodref>(event.<precoderef>type</precoderef>, event.<precoderef>initData</precoderef>);
+    var keySession = video.<precoderef prefix="attr">mediaKeys</precoderef>.<premethodref>createSession</premethodref>(event.<precoderef>type</precoderef>, event.<precoderef>initData</precoderef>);
     if (!keySession)
       throw "Could not create key session";
 
@@ -1343,14 +1343,14 @@
   function handleKeyNeeded(event) {
     var video = event.target;
 
-    if (!video.<precoderef>keys</precoderef>) {
+    if (!video.<precoderef prefix="attr">mediaKeys</precoderef>) {
       selectKeySystem();
       video.<premethodref>setMediaKeys</premethodref>(new <precoderef>MediaKeys</precoderef>(keySystem));
     }
-    if (!video.<precoderef>keys</precoderef>)
+    if (!video.<precoderef prefix="attr">mediaKeys</precoderef>)
       throw "Could not create MediaKeys";
 
-    var keySession = video.<precoderef>keys</precoderef>.<premethodref>createSession</premethodref>(event.<precoderef>type</precoderef>, event.<precoderef>initData</precoderef>);
+    var keySession = video.<precoderef prefix="attr">mediaKeys</precoderef>.<premethodref>createSession</premethodref>(event.<precoderef>type</precoderef>, event.<precoderef>initData</precoderef>);
     if (!keySession)
       throw "Could not create key session";
 
@@ -1422,14 +1422,14 @@
   function handleKeyNeeded(event) {
     var video = event.target;
 
-    if (!video.<precoderef>keys</precoderef>) {
+    if (!video.<precoderef prefix="attr">mediaKeys</precoderef>) {
       selectKeySystem();  // See previous example for implementation.
       video.<premethodref>setMediaKeys</premethodref>(new <precoderef>MediaKeys</precoderef>(keySystem));
     }
-    if (!video.<precoderef>keys</precoderef>)
+    if (!video.<precoderef prefix="attr">mediaKeys</precoderef>)
       throw "Could not create MediaKeys";
 
-    var keySession = video.<precoderef>keys</precoderef>.<premethodref>createSession</premethodref>(event.<precoderef>type</precoderef>, event.<precoderef>initData</precoderef>);
+    var keySession = video.<precoderef prefix="attr">mediaKeys</precoderef>.<premethodref>createSession</premethodref>(event.<precoderef>type</precoderef>, event.<precoderef>initData</precoderef>);
     if (!keySession)
       throw "Could not create key session";