Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[giow] (0) Update the controller state when the current media control…
…ler changes.

Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=12547
Affected topics: Video and Audio

git-svn-id: http://svn.whatwg.org/webapps@7115 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jun 4, 2012
1 parent d71dca8 commit 6afc42a
Show file tree
Hide file tree
Showing 3 changed files with 216 additions and 31 deletions.
81 changes: 70 additions & 11 deletions complete.html
Expand Up @@ -240,7 +240,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 1 June 2012</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 4 June 2012</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
Expand Down Expand Up @@ -29440,6 +29440,8 @@ <h5 id=loading-the-media-resource><span class=secno>4.8.10.5 </span>Loading the
start time, you'll jump the media controller to that time if
it's not already past it. (So if there are several, you'll jump
the media controller to the furthest one in the timeline.) -->
<!-- note that this can also trigger "report the controller
state" since it can change the element's readyState -->

</ol><p>Once the <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute
reaches <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code>,
Expand Down Expand Up @@ -31946,14 +31948,49 @@ <h6 id=media-controllers><span class=secno>4.8.10.11.2 </span>Media controllers<
<hr><p>The <dfn id=dom-media-controller title=dom-media-controller><code>controller</code></dfn> attribute
on a <a href=#media-element>media element</a>, on getting, must return the
element's <a href=#current-media-controller>current media controller</a>, if any, or null
otherwise. On setting, it must first remove the element's <code title=attr-media-mediagroup><a href=#attr-media-mediagroup>mediagroup</a></code> attribute, if any,
and then set the <a href=#current-media-controller>current media controller</a> to the given
value. If the given value is null, the element no longer has a
<a href=#current-media-controller>current media controller</a>; if it is not null, then the
user agent must <a href=#bring-the-media-element-up-to-speed-with-its-new-media-controller>bring the media element up to speed with its
new media controller</a>.</p>

<hr><p>The <dfn id=dom-mediacontroller title=dom-MediaController><code>MediaController()</code></dfn>
otherwise. On setting, the user agent must run the following
steps:</p>

<ol><!-- very similar to the algorithm below for setting the content attribute --><li><p>Let <var title="">m</var> be the <a href=#media-element>media element</a>
in question.</li>

<li><p>Let <var title="">old controller</var> be <var title="">m</var>'s <a href=#current-media-controller>current media controller</a>, if it
currently has one, and null otherwise.</li>

<li><p>Let <var title="">new controller</var> be null.</li>

<li><p>Let <var title="">m</var> have no <a href=#current-media-controller>current
media controller</a>, if it currently has one.</li>

<li><p>Remove the element's <code title=attr-media-mediagroup><a href=#attr-media-mediagroup>mediagroup</a></code> content attribute,
if any.</li>

<li><p>If the new value is null, then jump to the <i>update
controllers</i> step below.</li>

<li><p>Let <var title="">m</var>'s <a href=#current-media-controller>current media
controller</a> be the new value.</li>

<li><p>Let <var title="">new controller</var> be <var title="">m</var>'s <a href=#current-media-controller>current media controller</a>.</li>

<li><p><a href=#bring-the-media-element-up-to-speed-with-its-new-media-controller>Bring the media element up to speed with its new media
controller</a>.</li>

<li><p><i>Update controllers</i>: If <var title="">old
controller</var> and <var title="">new controller</var> are the
same (whether both null or both the same controller) then abort
these steps.</li>

<li><p>If <var title="">old controller</var> is not null and still
has one or more <a href=#slaved-media-elements>slaved media elements</a>, then
<a href=#report-the-controller-state>report the controller state</a> for <var title="">old
controller</var>.</li>

<li><p>If <var title="">new controller</var> is not null, then
<a href=#report-the-controller-state>report the controller state</a> for <var title="">new
controller</var>.</li>

</ol><hr><p>The <dfn id=dom-mediacontroller title=dom-MediaController><code>MediaController()</code></dfn>
constructor, when invoked, must return a newly created
<code><a href=#mediacontroller>MediaController</a></code> object.</p>

Expand Down Expand Up @@ -32385,14 +32422,20 @@ <h6 id=assigning-a-media-controller-declaratively><span class=secno>4.8.10.11.3
changed, or removed, the user agent must run the following
steps:</p>

<ol><li><p>Let <var title="">m</var> be the <a href=#media-element>media element</a>
<ol><!-- very similar to the algorithm above for setting the IDL attribute --><li><p>Let <var title="">m</var> be the <a href=#media-element>media element</a>
in question.</li>

<li><p>Let <var title="">old controller</var> be <var title="">m</var>'s <a href=#current-media-controller>current media controller</a>, if it
currently has one, and null otherwise.</li>

<li><p>Let <var title="">new controller</var> be null.</li>

<li><p>Let <var title="">m</var> have no <a href=#current-media-controller>current
media controller</a>, if it currently has one.</li>

<li><p>If <var title="">m</var>'s <code title=attr-media-mediagroup><a href=#attr-media-mediagroup>mediagroup</a></code> attribute is being
removed, then abort these steps.</li>
removed, then jump to the <i>update controllers</i> step
below.</li>

<li>

Expand All @@ -32414,9 +32457,25 @@ <h6 id=assigning-a-media-controller-declaratively><span class=secno>4.8.10.11.3
<li><p>Let <var title="">m</var>'s <a href=#current-media-controller>current media
controller</a> be <var title="">controller</var>.</li>

<li><p>Let <var title="">new controller</var> be <var title="">m</var>'s <a href=#current-media-controller>current media controller</a>.</li>

<li><p><a href=#bring-the-media-element-up-to-speed-with-its-new-media-controller>Bring the media element up to speed with its new media
controller</a>.</li>

<li><p><i>Update controllers</i>: If <var title="">old
controller</var> and <var title="">new controller</var> are the
same (whether both null or both the same controller) then abort
these steps.</li>

<li><p>If <var title="">old controller</var> is not null and still
has one or more <a href=#slaved-media-elements>slaved media elements</a>, then
<a href=#report-the-controller-state>report the controller state</a> for <var title="">old
controller</var>.</li>

<li><p>If <var title="">new controller</var> is not null, then
<a href=#report-the-controller-state>report the controller state</a> for <var title="">new
controller</var>.</li>

</ol><p>The <dfn id=dom-media-mediagroup title=dom-media-mediaGroup><code>mediaGroup</code></dfn> IDL
attribute on <a href=#media-element title="media element">media elements</a> must
<a href=#reflect>reflect</a> the <code title=attr-media-mediagroup><a href=#attr-media-mediagroup>mediagroup</a></code> content
Expand Down
81 changes: 70 additions & 11 deletions index
Expand Up @@ -240,7 +240,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 1 June 2012</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 4 June 2012</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
Expand Down Expand Up @@ -29440,6 +29440,8 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael
start time, you'll jump the media controller to that time if
it's not already past it. (So if there are several, you'll jump
the media controller to the furthest one in the timeline.) -->
<!-- note that this can also trigger "report the controller
state" since it can change the element's readyState -->

</ol><p>Once the <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute
reaches <code title=dom-media-HAVE_CURRENT_DATA><a href=#dom-media-have_current_data>HAVE_CURRENT_DATA</a></code>,
Expand Down Expand Up @@ -31946,14 +31948,49 @@ interface <dfn id=mediacontroller>MediaController</dfn> {
<hr><p>The <dfn id=dom-media-controller title=dom-media-controller><code>controller</code></dfn> attribute
on a <a href=#media-element>media element</a>, on getting, must return the
element's <a href=#current-media-controller>current media controller</a>, if any, or null
otherwise. On setting, it must first remove the element's <code title=attr-media-mediagroup><a href=#attr-media-mediagroup>mediagroup</a></code> attribute, if any,
and then set the <a href=#current-media-controller>current media controller</a> to the given
value. If the given value is null, the element no longer has a
<a href=#current-media-controller>current media controller</a>; if it is not null, then the
user agent must <a href=#bring-the-media-element-up-to-speed-with-its-new-media-controller>bring the media element up to speed with its
new media controller</a>.</p>

<hr><p>The <dfn id=dom-mediacontroller title=dom-MediaController><code>MediaController()</code></dfn>
otherwise. On setting, the user agent must run the following
steps:</p>

<ol><!-- very similar to the algorithm below for setting the content attribute --><li><p>Let <var title="">m</var> be the <a href=#media-element>media element</a>
in question.</li>

<li><p>Let <var title="">old controller</var> be <var title="">m</var>'s <a href=#current-media-controller>current media controller</a>, if it
currently has one, and null otherwise.</li>

<li><p>Let <var title="">new controller</var> be null.</li>

<li><p>Let <var title="">m</var> have no <a href=#current-media-controller>current
media controller</a>, if it currently has one.</li>

<li><p>Remove the element's <code title=attr-media-mediagroup><a href=#attr-media-mediagroup>mediagroup</a></code> content attribute,
if any.</li>

<li><p>If the new value is null, then jump to the <i>update
controllers</i> step below.</li>

<li><p>Let <var title="">m</var>'s <a href=#current-media-controller>current media
controller</a> be the new value.</li>

<li><p>Let <var title="">new controller</var> be <var title="">m</var>'s <a href=#current-media-controller>current media controller</a>.</li>

<li><p><a href=#bring-the-media-element-up-to-speed-with-its-new-media-controller>Bring the media element up to speed with its new media
controller</a>.</li>

<li><p><i>Update controllers</i>: If <var title="">old
controller</var> and <var title="">new controller</var> are the
same (whether both null or both the same controller) then abort
these steps.</li>

<li><p>If <var title="">old controller</var> is not null and still
has one or more <a href=#slaved-media-elements>slaved media elements</a>, then
<a href=#report-the-controller-state>report the controller state</a> for <var title="">old
controller</var>.</li>

<li><p>If <var title="">new controller</var> is not null, then
<a href=#report-the-controller-state>report the controller state</a> for <var title="">new
controller</var>.</li>

</ol><hr><p>The <dfn id=dom-mediacontroller title=dom-MediaController><code>MediaController()</code></dfn>
constructor, when invoked, must return a newly created
<code><a href=#mediacontroller>MediaController</a></code> object.</p>

Expand Down Expand Up @@ -32385,14 +32422,20 @@ interface <dfn id=mediacontroller>MediaController</dfn> {
changed, or removed, the user agent must run the following
steps:</p>

<ol><li><p>Let <var title="">m</var> be the <a href=#media-element>media element</a>
<ol><!-- very similar to the algorithm above for setting the IDL attribute --><li><p>Let <var title="">m</var> be the <a href=#media-element>media element</a>
in question.</li>

<li><p>Let <var title="">old controller</var> be <var title="">m</var>'s <a href=#current-media-controller>current media controller</a>, if it
currently has one, and null otherwise.</li>

<li><p>Let <var title="">new controller</var> be null.</li>

<li><p>Let <var title="">m</var> have no <a href=#current-media-controller>current
media controller</a>, if it currently has one.</li>

<li><p>If <var title="">m</var>'s <code title=attr-media-mediagroup><a href=#attr-media-mediagroup>mediagroup</a></code> attribute is being
removed, then abort these steps.</li>
removed, then jump to the <i>update controllers</i> step
below.</li>

<li>

Expand All @@ -32414,9 +32457,25 @@ interface <dfn id=mediacontroller>MediaController</dfn> {
<li><p>Let <var title="">m</var>'s <a href=#current-media-controller>current media
controller</a> be <var title="">controller</var>.</li>

<li><p>Let <var title="">new controller</var> be <var title="">m</var>'s <a href=#current-media-controller>current media controller</a>.</li>

<li><p><a href=#bring-the-media-element-up-to-speed-with-its-new-media-controller>Bring the media element up to speed with its new media
controller</a>.</li>

<li><p><i>Update controllers</i>: If <var title="">old
controller</var> and <var title="">new controller</var> are the
same (whether both null or both the same controller) then abort
these steps.</li>

<li><p>If <var title="">old controller</var> is not null and still
has one or more <a href=#slaved-media-elements>slaved media elements</a>, then
<a href=#report-the-controller-state>report the controller state</a> for <var title="">old
controller</var>.</li>

<li><p>If <var title="">new controller</var> is not null, then
<a href=#report-the-controller-state>report the controller state</a> for <var title="">new
controller</var>.</li>

</ol><p>The <dfn id=dom-media-mediagroup title=dom-media-mediaGroup><code>mediaGroup</code></dfn> IDL
attribute on <a href=#media-element title="media element">media elements</a> must
<a href=#reflect>reflect</a> the <code title=attr-media-mediagroup><a href=#attr-media-mediagroup>mediagroup</a></code> content
Expand Down
85 changes: 76 additions & 9 deletions source
Expand Up @@ -31936,6 +31936,8 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {};</pre>
start time, you'll jump the media controller to that time if
it's not already past it. (So if there are several, you'll jump
the media controller to the furthest one in the timeline.) -->
<!-- note that this can also trigger "report the controller
state" since it can change the element's readyState -->

</ol>

Expand Down Expand Up @@ -34867,13 +34869,54 @@ interface <dfn>MediaController</dfn> {
title="dom-media-controller"><code>controller</code></dfn> attribute
on a <span>media element</span>, on getting, must return the
element's <span>current media controller</span>, if any, or null
otherwise. On setting, it must first remove the element's <code
title="attr-media-mediagroup">mediagroup</code> attribute, if any,
and then set the <span>current media controller</span> to the given
value. If the given value is null, the element no longer has a
<span>current media controller</span>; if it is not null, then the
user agent must <span>bring the media element up to speed with its
new media controller</span>.</p>
otherwise. On setting, the user agent must run the following
steps:</p>

<ol> <!-- very similar to the algorithm below for setting the content attribute -->

<li><p>Let <var title="">m</var> be the <span>media element</span>
in question.</p></li>

<li><p>Let <var title="">old controller</var> be <var
title="">m</var>'s <span>current media controller</span>, if it
currently has one, and null otherwise.</p></li>

<li><p>Let <var title="">new controller</var> be null.</p></li>

<li><p>Let <var title="">m</var> have no <span>current
media controller</span>, if it currently has one.</p></li>

<li><p>Remove the element's <code
title="attr-media-mediagroup">mediagroup</code> content attribute,
if any.</p></li>

<li><p>If the new value is null, then jump to the <i>update
controllers</i> step below.</p></li>

<li><p>Let <var title="">m</var>'s <span>current media
controller</span> be the new value.</p></li>

<li><p>Let <var title="">new controller</var> be <var
title="">m</var>'s <span>current media controller</span>.</p></li>

<li><p><span>Bring the media element up to speed with its new media
controller</span>.</p></li>

<li><p><i>Update controllers</i>: If <var title="">old
controller</var> and <var title="">new controller</var> are the
same (whether both null or both the same controller) then abort
these steps.</p></li>

<li><p>If <var title="">old controller</var> is not null and still
has one or more <span>slaved media elements</span>, then
<span>report the controller state</span> for <var title="">old
controller</var>.</p></li>

<li><p>If <var title="">new controller</var> is not null, then
<span>report the controller state</span> for <var title="">new
controller</var>.</p></li>

</ol>

<hr>

Expand Down Expand Up @@ -35400,17 +35443,24 @@ interface <dfn>MediaController</dfn> {
changed, or removed, the user agent must run the following
steps:</p>

<ol>
<ol> <!-- very similar to the algorithm above for setting the IDL attribute -->

<li><p>Let <var title="">m</var> be the <span>media element</span>
in question.</p></li>

<li><p>Let <var title="">old controller</var> be <var
title="">m</var>'s <span>current media controller</span>, if it
currently has one, and null otherwise.</p></li>

<li><p>Let <var title="">new controller</var> be null.</p></li>

<li><p>Let <var title="">m</var> have no <span>current
media controller</span>, if it currently has one.</p></li>

<li><p>If <var title="">m</var>'s <code
title="attr-media-mediagroup">mediagroup</code> attribute is being
removed, then abort these steps.</p></li>
removed, then jump to the <i>update controllers</i> step
below.</p></li>

<li>

Expand All @@ -35435,9 +35485,26 @@ interface <dfn>MediaController</dfn> {
<li><p>Let <var title="">m</var>'s <span>current media
controller</span> be <var title="">controller</var>.</p></li>

<li><p>Let <var title="">new controller</var> be <var
title="">m</var>'s <span>current media controller</span>.</p></li>

<li><p><span>Bring the media element up to speed with its new media
controller</span>.</p></li>

<li><p><i>Update controllers</i>: If <var title="">old
controller</var> and <var title="">new controller</var> are the
same (whether both null or both the same controller) then abort
these steps.</p></li>

<li><p>If <var title="">old controller</var> is not null and still
has one or more <span>slaved media elements</span>, then
<span>report the controller state</span> for <var title="">old
controller</var>.</p></li>

<li><p>If <var title="">new controller</var> is not null, then
<span>report the controller state</span> for <var title="">new
controller</var>.</p></li>

</ol>

<p>The <dfn
Expand Down

0 comments on commit 6afc42a

Please sign in to comment.