[whatwg] Race condition in media load algorithm

Boris Zbarsky bzbarsky at MIT.EDU
Wed Aug 4 10:19:35 PDT 2010


On 8/4/10 6:56 AM, Philip Jägenstedt wrote:
> On Wed, 04 Aug 2010 11:32:51 +0200, Boris Zbarsky <bzbarsky at mit.edu> wrote:
>
>> On 8/4/10 4:29 AM, Philip Jägenstedt wrote:
>>> That could be, but is this behavior actually useful for anything? It's
>>> certainly simpler to implement and more predictable for authors to
>>> always wait until the current script has finished executing.
>>
>> 1) That requires defining "current script".
>
> OK, but that's just a spec problem. It's trivial in implementation
> because when the resource selection algorithm was is triggered by a
> script, you can just pass along a reference to that very script.

It's not, in fact, trivial in implementation.  You're making assumptions 
about how implementations work that don't seem warranted (e.g. the 
concept of "reference to that very script" is not well-defined in some 
implementations).  In particular, what you're proposing is not at all 
trivial in Gecko.

>> 2) Who said it will ever finish executing?
>
> If it doesn't, just don't ever continue with the synchronous section.

I don't think that's reasonable.

> Is there any valid case for a script never finishing?

Yes, it could showModalDialog and the user could spend several hours 
interacting with it.

> It would block all event handlers from running too

I believe this is false in the case of showModalDialog.

-Boris



More information about the whatwg mailing list