W3C home > Mailing lists > Public > public-web-perf@w3.org > June 2014

[RequestAnimationFrame]: thrown exceptions and user experience

From: Jake Verbaten <raynos2@gmail.com>
Date: Mon, 23 Jun 2014 10:22:17 -0700
Message-ID: <CAMCMjp1_7dpJ62ZyPsPtDYbd2pzqTOgM+YO6fFVbd0tLdg0-UA@mail.gmail.com>
To: public-web-perf@w3.org
When implementing / contributing to a requestAnimationFrame polyfill I
found this part of the specification.

> If calling the operation resulted in an exception being thrown, then
catch that exception and ignore it.

The way I use `requestAnimationFrame` is to invoke my rendering engine
every frame. (specifically it's a React-like virtual-dom rendering engine).

I spend a few hours debugging why there was a rendering artifact on my web
page and released there was a bug in my rendering engine that was being
swallowed by the `requestAnimationFrame` polyfill I was using.

My first gut reaction was to remove the painpoint that hid a useful
exception from my code ( https://github.com/chrisdickinson/raf/pull/20 ).

It seems incredibly unintuitive for a core timing primitive to swallow and
ignore exceptions, this makes debugging incredibly difficult and painful.

For reference point, reading the `setTimeout` specification (
http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html )
it sounds like it doesn't do any special exception handling.
Received on Monday, 23 June 2014 17:22:47 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:04:38 UTC