W3C home > Mailing lists > Public > www-style@w3.org > May 2010

Re: [cssom-view] addMediumListener / removeMediumListener

From: Simon Fraser <smfr@me.com>
Date: Thu, 27 May 2010 12:22:51 -0700
Cc: Anne van Kesteren <annevk@opera.com>, www-style@w3.org, marcosc@opera.com
Message-id: <F33DB726-1E83-4A24-819C-BB7A6A6FB50F@me.com>
To: Luiz Agostini <luiz.agostini@openbossa.org>
On May 27, 2010, at 10:58 AM, Luiz Agostini wrote:

> 2010/5/27 Simon Fraser <smfr@me.com>
> On May 27, 2010, at 1:33 AM, Anne van Kesteren wrote:
> 
> I'm  a little concerned about using a BooleanCallback here. I agree that there's an issue where the serialized query may not match what was originally used to add the listener, but I think having some context in the callback is necessary. This allows people writing OOP JS to have a single object with a handleEvent() function which can act as a listener for multiple queries. This would be slightly easier if there were an easy way to re-serialize a query (i.e. to convert it to its canonical form) via some API.
> 
> I think that it can be done using JC closures.

JS is not the only programming language that will be using this APIs. Browser vendors often also compile DOM bindings for native code.

> 
> 
> A slightly hacky alternative would be for addMediumListener() to return a token (like setTimeout()) that can be used to identify which listener is it, and gets passed to the callback.
> 
> And maybe could be passed to removeQueryListener().

Indeed.

Simon
Received on Thursday, 27 May 2010 19:23:28 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:27 GMT