W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2009

[whatwg] What is the purpose of timeupdate?

From: Robert O'Callahan <robert@ocallahan.org>
Date: Sat, 7 Nov 2009 09:31:17 +1300
Message-ID: <11e306600911061231n68d1fb88scc3800ed70fd4812@mail.gmail.com>
On Sat, Nov 7, 2009 at 12:16 AM, Simon Pieters <simonp at opera.com> wrote:

> On Fri, 06 Nov 2009 11:05:03 +0100, Robert O'Callahan <
> robert at ocallahan.org> wrote:
>
>  On Fri, Nov 6, 2009 at 10:44 PM, Philip J?genstedt <philipj at opera.com
>> >wrote:
>>
>>  We've considered firing it for each frame, but there is one problem. If
>>> people expect that it fires once per frame they will probably write
>>> scripts
>>> which do frame-based animations by moving things n pixels per frame or
>>> similar. Some animations are just easier to do this way, so there's no
>>> reason to think that people won't do it. This will break horribly if a
>>> browser is ever forced to drop a frame, which is going to happen on
>>> slower
>>> machines. In balance this may or may not be a risk worth taking.
>>>
>>>
>> That's possible, but we haven't noticed authors doing that yet.
>>
>
> http://people.mozilla.com/~prouget/demos/round/index.xhtml<http://people.mozilla.com/%7Eprouget/demos/round/index.xhtml>
>

Aha, good catch.

But I agree with Brian. These people are just as likely to use
setTimeout(0), and that's broken too. Users of scripted animation APIs who
advance their animations by a fixed amount per callback are guaranteed to
lose no matter what period the callback nominally has. The only thing we
could do is require callback intervals to be highly random so authors notice
jerkiness and fix their code :-).

Rob
-- 
"He was pierced for our transgressions, he was crushed for our iniquities;
the punishment that brought us peace was upon him, and by his wounds we are
healed. We all, like sheep, have gone astray, each of us has turned to his
own way; and the LORD has laid on him the iniquity of us all." [Isaiah
53:5-6]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20091107/214a8c19/attachment.htm>
Received on Friday, 6 November 2009 12:31:17 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:18 UTC