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

Re: ISSUE-7: FrameRequestCallback interface should be designated as Callback=FunctionOnly [Request Animation Frame]

From: Olli Pettay <Olli.Pettay@helsinki.fi>
Date: Thu, 02 Jun 2011 01:12:32 +0300
Message-ID: <4DE6B950.70408@helsinki.fi>
To: Web Performance Working Group WG <public-web-perf@w3.org>
On 06/01/2011 07:24 PM, Web Performance Working Group Issue Tracker wrote:
>
> ISSUE-7: FrameRequestCallback interface should be designated as
> Callback=FunctionOnly [Request Animation Frame]
>
> http://www.w3.org/2010/webperf/track/issues/7
>
> Raised by: Jatinder Mann On product: Request Animation Frame
>
> 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
It is not. In event handling
foo.addEventListener("bar_event", { handleEvent: function(e) {}}, true);
has proved to be useful.


-Olli


  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); };
>
>
>
>
>
Received on Wednesday, 1 June 2011 22:13:00 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 1 June 2011 22:13:01 GMT