[Sugar-devel] Web activity example that uses html5 canvas

Manuel Quiñones manuq at laptop.org
Mon Apr 29 21:42:40 EDT 2013


2013/4/29 James Cameron <quozl at laptop.org>:
> On Mon, Apr 29, 2013 at 04:23:24PM -0300, Manuel Qui?ones wrote:
>> And here a live demo:
>>
>> http://manuq.github.io/clockjs/activity.html
>
> Should this work if opened on Firefox 20.0 on Ubuntu 12.10?
>
> (It shows a clock face, but no arms.)

It is because of requestAnimationFrame.  To make it compatible with
all current browsers , I could do:

var requestAnimationFrame = window.requestAnimationFrame ||
window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame
|| window.msRequestAnimationFrame;

I certeanly dislike doing such things for compatibility :)  If we are
targetting webkit for now, and webkit has the generic one, I suppose
I'll go with that.  It is just time for the other browsers to get it.
What do you think?

Here are links for the mozilla page of the feature, and w3 the specification:

https://developer.mozilla.org/en/docs/DOM/window.requestAnimationFrame
http://www.w3.org/TR/animation-timing/#requestAnimationFrame

--
.. manuq ..


More information about the Sugar-devel mailing list