[Sugar-devel] HTML activities
C. Scott Ananian
cscott at laptop.org
Wed Jan 30 12:41:31 EST 2013
On Wed, Jan 30, 2013 at 12:19 PM, Gonzalo Odiard <gonzalo at laptop.org> wrote:
> Any reason to prefer Firefox over Webkit?
Firefox/Android has made great strides recently, and is a much more
friendly environment for building add-ons. Chrome Web Apps are rather
limited in comparison (no full screen mode on Android), and AFAIK the
mobile version of chrome doesn't support extensions. Firefox/Android also
has much better WebGL and video support at the current time. Getting HTML5
video to play on Webkit/Android is a nightmare. The Chrome team doesn't
really want to compete with native apps, where the Firefox team is making
web apps (and boot2gecko) a priority.
But really, good modern web code should be browser-agnostic. It shouldn't
be hard to make a framework that runs under Firefox/Android on Android and
Webkit/Sugar when running on Sugar. From activity code, the Sugar API
ought to be made using the postMessage API, which is cross-browser. How
those messages are processed under the hood is much less important; you can
use different implementations for different platforms.
After playing around with canvas a lot, I'm not a huge fan of using it to
implement UIs. You give up much of the i18n, accessibility, and
introspection support one you start playing with canvases. It's fine to
use under-the-covers to draw backgrounds, etc, but it's better to use real
HTML/CSS widgets whenever possible. There's also a big API change coming
up with respect to retina-displays and canvases. (It's also suprisingly
difficult to get animations on canvases to display smoothly across
browsers; you end up depending on a lot of details in your browser's
graphic acceleration and context invalidation stack.
http://cscott.net/Projects/TurtleScript/canvastest.html has a simple test
case which I had a lot of difficultly getting to perform well on the XO and
Android. Generally speaking, animating widgets and using CSS animations
are much easier to get to work with good performance.)
That said, canvas is fine it you want to implement a paint program or logo
or a pippy environment that lets you draw pictures. paper.js is one
library which people seem to like for that purpose. processing is another.
( http://cscott.net )
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Sugar-devel