W3C home > Mailing lists > Public > public-webtiming@w3.org > June 2015

Re: Specifying the association with an online timing service

From: Ingar Mæhlum Arntzen <ingar.arntzen@gmail.com>
Date: Wed, 10 Jun 2015 12:14:03 +0200
Message-ID: <CAOFBLLq8VOamO7=kKAY4SDNLfsB+qv505wsHhN7d7YAD_PLMyQ@mail.gmail.com>
To: Dominique Hazael-Massieux <dom@w3.org>
Cc: Njaal Borch <njaal.borch@norut.no>, Francois Daoust <fd@w3.org>, public-webtiming@w3.org
The issues I alluded to about reordering and duplication of events are not
necessarily the same as Njål's, but tied to the use of setTimeout(action,
0) for throwing actions on the event queue, and then getting intermediary
actions that make wrong decisions because it doesn't know that a related
action is already pending on the event queue. This of course can be avoided
by correct bookkeeping, but that is also the main point; It is much better
to do this correct in the interface instead of offloading this
responsibility to programmers with a deadline to meet.

Ingar

2015-06-10 12:05 GMT+02:00 Dominique Hazael-Massieux <dom@w3.org>:

> On 10/06/2015 12:00, Njaal Borch wrote:
>
>> On 10 June 2015 at 11:46, Dominique Hazael-Massieux <dom@w3.org
>> <mailto:dom@w3.org>> wrote:
>>
>>     On 10/06/2015 08:32, Njaal Borch wrote:
>>
>>         there's even the rather horrible race condition in all the
>> two-step
>>         versions:
>>
>>         if somestate execute func1;
>>                                     <---  somestate changes
>>         somestate.on("change", func1);
>>
>>
>>     I don't think that ("somestate changes") can happen within the
>>     semantics of JavaScript — i.e. no state can be changed "in the
>>     background" beore the current function stack is fully run through.
>>
>>
>> Can not somestate change if that is for example the readiness of a video
>> element?  Presumably things can happen in the browser in parallel even
>> if the JS engine does not?
>>
>
> Nope (or rather, that change is not reflected to the engine until the
> current stack is done).
>
>
>> You'd think so, right?  I'm not sure why FF doesn't actually do this,
>> but I was assuming it to be because "canplay" has gone from false to
>> true before I register the event listener.
>>
>
> It doesn't behave this way for me - the attached test run in Firefox
> displays "ready to play" as expected.
>
> Dom
>
Received on Wednesday, 10 June 2015 10:14:32 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:25:14 UTC