<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>26873</bug_id>
          
          <creation_ts>2014-09-21 00:56:42 +0000</creation_ts>
          <short_desc>MediaController: emptied event</short_desc>
          <delta_ts>2016-02-01 02:52:28 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>blocked awaiting response from Silvia to comment 3 (please remove this when replying)	</status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Silvia Pfeiffer">silviapfeiffer1</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>annevk</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>philipj</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>111891</commentid>
    <comment_count>0</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2014-09-21 00:56:42 +0000</bug_when>
    <thetext>https://html.spec.whatwg.org/#event-mediacontroller-emptied

The following events fire on MediaController objects:
...
emptied -
	All the slaved media elements newly have readyState set to HAVE_NOTHING or greater, or there are no longer any slaved media elements.
...

Seems out of whack with the same named event on MediaElement objects:
...
emptied -
	A media element whose networkState was previously not in the NETWORK_EMPTY state has just switched to that state (either because of a fatal error during load that&apos;s about to be reported, or because the load() method was invoked while the resource selection algorithm was already running).
	networkState is NETWORK_EMPTY; all the IDL attributes are in their initial states.
...

Shouldn&apos;t emptied be about NETWORK_EMPTY? At least it should not include any readyState greater than HAVE_NOTHING.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111923</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-09-22 16:39:27 +0000</bug_when>
    <thetext>Are you asking if the non-normative text you quote is accurate, or are you asking if the normative text corresponding to the non-normative text you quote should be changed?

If the former, it seems accurate to me.

If the latter, what proposed changes to the normative text did you have in mind?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111980</commentid>
    <comment_count>2</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2014-09-22 22:13:53 +0000</bug_when>
    <thetext>The former - the latter is accurate FAIK.

I think that at least one media element needs to newly have a readyState set to HAVE_NOTHING to raise this event.

Instead, the current description implies to raise a emptied event also every time all slaved media elements newly have a readyState set to something greater than HAVE_NOTHING.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112039</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-09-23 18:24:42 +0000</bug_when>
    <thetext>Can you walk me through your reading of the spec that leads you to conclude that the HAVE_* states are relevant to when a MediaController fires &apos;emptied&apos;?

Or are you the description of the event as a description of the proximate cause of the event firing? It&apos;s not a description of the cause of it firing, it&apos;s a description of the state of the world when it fires. &quot;When the engine light comes on, the engine needs examining&quot; doesn&apos;t mean &quot;when the engine needs examining, the engine light comes on&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114425</commentid>
    <comment_count>4</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2014-11-03 10:19:22 +0000</bug_when>
    <thetext>Here&apos;s what I think the MediaController&apos;s &quot;emptied&quot; event description at https://html.spec.whatwg.org/#event-mediacontroller-emptied should say:
...
emptied -
	At least one of the slaved media elements newly has readyState set to HAVE_NOTHING, or there are no longer any slaved media elements.
...

Alternatively, it could also be defined as:
...
emptied -
	At least one of the slaved media elements whose networkState was previously not in the NETWORK_EMPTY state has just switched to that state, or there are no longer any slaved media elements.
...


Here&apos;s my reading of the spec that confirms this:
https://html.spec.whatwg.org/#most-recently-reported-readiness-state

Let all slaved media elements have a readyState of &quot;HAVE_METADATA&quot;.
Call load() on one slaved media element (https://html.spec.whatwg.org/#dom-media-load), which raises an emptied event and sets the element&apos;s readyState to &quot;HAVE_NOTHING&quot;.
This in turn requires reporting the controller state for the media element&apos;s current media controller (https://html.spec.whatwg.org/#ready-states).

Calculating the new readiness state of the MediaController (https://html.spec.whatwg.org/#report-the-controller-state) says to take &quot;the lowest value of the readyState IDL attributes of all of its slaved media elements&quot;, which is 0.

And further: &quot;if the MediaController&apos;s most recently reported readiness state is greater than new readiness state then queue a task to fire a simple event at the MediaController object, whose name is the event name corresponding to the value of new readiness state given in the table below.&quot;

Thus: a emptied event is raised at the MediaController.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123011</commentid>
    <comment_count>5</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-09-02 08:16:07 +0000</bug_when>
    <thetext>Silvia, would you be interested in providing a PR at https://github.com/whatwg/html for this improvement?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124782</commentid>
    <comment_count>6</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2016-02-01 02:52:28 +0000</bug_when>
    <thetext>Won&apos;t fix, see https://github.com/whatwg/html/issues/192</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>