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

[RequestAnimationFrame] FrameRequestCallback interface should be designated as Callback=FunctionOnly

From: Jatinder Mann <jmann@microsoft.com>
Date: Wed, 1 Jun 2011 16:25:13 +0000
To: "public-web-perf@w3.org" <public-web-perf@w3.org>
Message-ID: <EE4C13A1D11CFA49A58343DE361B0B0406859DFE@TK5EX14MBXC254.redmond.corp.microsoft.com>
Unless explicitly specified with a Callback=FunctionOnly statement in the IDL, we will be allowing objects to be registered as callbacks, like so:

E.g.
                var obj = new Object();
                obj.handleEvent = function (event) { alert ('hello, world!'); }
                window.requestAnimationFrame(obj);

Registering objects as callbacks is somewhat uncommon and may not be what we want. The Geolocation PositionCallback function, http://dev.w3.org/geo/api/spec-source.html, also explicitly calls out that the callback be a function only.

The change would look like so:

[Callback=FunctionOnly, NoInterfaceObject]
interface FrameRequestCallback {
  void sample(in DOMTimeStamp time);
};

I have raised ISSUE 7 - FrameRequestCallback interface should be designated as Callback=FunctionOnly [RequestAnimationFrame].

Thanks,
Jatinder
Received on Wednesday, 1 June 2011 16:25:41 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 1 June 2011 16:25:57 GMT