W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2012

Re: [Public WebGL] Should WebGLContextAttributes be a callback interface?

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Sun, 08 Apr 2012 22:51:55 -0400
Message-ID: <4F824ECB.9010708@mit.edu>
To: Cameron McCormack <cam@mcc.id.au>
CC: Kenneth Russell <kbr@google.com>, Glenn Maynard <glenn@zewt.org>, public_webgl@khronos.org, "public-script-coord@w3.org" <public-script-coord@w3.org>
On 4/8/12 10:49 PM, Cameron McCormack wrote:
> Any JS non-platform object can serve as a callback interface object.

Sure, but even then the "non-platform" restriction is kinda arbitrary.

> callback interface A {
> attribute long x;
> attribute long y;
> void f();
> };
>
> interface B {
> A g();
> };
>
> calling B.g() could return a new JS native object with "x", "y" and "f"
> properties.

Yep.  That's what it would do for a dictionary, right?  Or would it not?

> The same question arises with callback functions. If you defined
>
> callback SomeCallback = void ();
>
> interface C {
> attribute SomeCallback handler;
> };
>
> should C.handler be allowed to return a Function object that script
> didn't create? Maybe.

I wouldn't have a problem with that personally.

-Boris
Received on Monday, 9 April 2012 02:52:27 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:06 UTC