W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2011

[whatwg] <video> ... <script> race condition

From: Philip Jägenstedt <philipj@opera.com>
Date: Tue, 17 May 2011 11:09:21 +0200
Message-ID: <op.vvmbpvlksr6mfa@kirk>
On Tue, 17 May 2011 10:47:02 +0200, Remy Sharp <remy at leftlogic.com> wrote:

> On 17 May 2011, at 09:04, Philip J?genstedt wrote:
>
>> Or do you mean a spec bug?
>
> I meant a spec bug :)

http://www.w3.org/Bugs/Public/show_bug.cgi?id=12664

Still, I don't think just advocacy is any kind of solution. Given that you  
(the co-author of an HTML5 book) make certain assumptions about the  
outcome of this race condition, it's safe to assume that hoards of web  
developers will do the same.

To target this specific pattern, one hypothetical solution would be to  
special-case the first script that attaches event handlers to a <video>  
element. After it has run, all events that were already fired before the  
script are fired again. However, this seems awfully messy if the script  
also observes readyState or networkState. It might also interfere with  
browsers that use scripts behind the scenes to implement the native  
controls.

Although a kludge, another solution might be to block events from being  
fired until x more bytes of the document have been parsed or it has  
finished loading.

Any other bad ideas?

-- 
Philip J?genstedt
Core Developer
Opera Software
Received on Tuesday, 17 May 2011 02:09:21 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:06 UTC