[whatwg] Question on HTML5 media element, the seeking algorithm and the seeked event

Silvia Pfeiffer silviapfeiffer1 at gmail.com
Sun Dec 15 19:38:29 PST 2013

On Sat, Dec 7, 2013 at 6:31 AM, Ian Hickson <ian at hixie.ch> wrote:
> On Fri, 8 Nov 2013, Andres Gomez wrote:
>> because of my recent work related to a bug and test in WebKit, I've
>> gotten to deal with the HTML5 media element's "seeking" algorithm and
>> "seeked" event.
>> During my analysis I was unable, following the specs preview, to
>> determine whether on specific conditions, after a "seek" request a
>> "seeked" event would be received.
>> The cases could be more complicated but, trying to put it simple, in the
>> "seeking" algorithm of the specs:
>> http://dev.w3.org/html5/spec-preview/media-elements.html#seeking
> I recommend using the WHATWG version of the spec, since that's the version
> that I edit in response to comments here. While the W3C version does
> subsequently adopt many of those changes as well, the two versions are
> unfortunately not identical.
> In the WHATWG version of the HTML standard, the algorithm you cite above
> is found here:
>    http://whatwg.org/html#dom-media-seek
> I mention this because this is in fact one of the algorithms that, for
> reasons I am not familiar with, is in fact different in the W3C version.

That would be because Andres was looking at the HTML5.0 version of
22nd August rather than the more up-to-date HTML5.1 version:

FAICT these are identical.

This is just a note of clarification to assure that the W3C version
has the same algorithm - I don't want to go into why there are several
versions of the HTML spec around.

>> We can read on the step 7, that, on certain conditions:
>> "... If there are no ranges given in the seekable attribute then set the
>> seeking IDL attribute to false and abort these steps."
> (In the WHATWG version today, this is step 8.)
>> Hence, we won't walk the following steps, including the last ones, 13
>> and 14, which would fire the "timeupdate" and "seeked" events.
>> However, reading the events summary for the "seeked" one:
>> http://dev.w3.org/html5/spec-preview/media-elements.html#event-media-seeked
>    http://whatwg.org/html#event-media-seeked
>> We can read that it is "Fired when...":
>> "The seeking IDL attribute changed to false."
>> ... which is what happens in the mentioned step 7 of the "seeking"
>> algorithm.
> Hm, yes, the non-normative text in the event summary table here was a bit
> overly simplistic.
> I've tried to make the summary table more precise for this event. Let me
> know if you think it's still not clear enough!

HTML5.1 at W3C will pick up this change, too.


>> Because of this, I'm unsure whether a "seeked" (and "timeupdate" ?)
>> event should be fired when the conditions in step 7 happen.
> Per the spec, no. The section with the event summary table explicitly says
> "This section is non-normative", and, even ignoring that, none of the
> statements in that section are normative -- none of them use the word
> "must". Contrast this to the algorithm, which is introduced by the
> requirement that says "the user agent must run the following steps".
> See also:
>    http://whatwg.org/html#conformance-requirements
> Thanks,
> --
> Ian Hickson               U+1047E                )\._.,--....,'``.    fL
> http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
> Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

More information about the whatwg mailing list