W3C home > Mailing lists > Public > public-geolocation@w3.org > July 2011

Re: Spec update: deviceorientation event should fire when listener is first registered

From: Anne van Kesteren <annevk@opera.com>
Date: Tue, 12 Jul 2011 13:50:46 +0200
To: "Andrei Popescu" <andreip@google.com>
Cc: "Doug Turner" <doug.turner@gmail.com>, "Steve Block" <steveblock@google.com>, public-geolocation <public-geolocation@w3.org>
Message-ID: <op.vyh8iwyk64w2qv@annevk-macbookpro.local>
On Tue, 12 Jul 2011 13:42:36 +0200, Andrei Popescu <andreip@google.com>  
wrote:
> On Tue, Jul 12, 2011 at 12:41 PM, Anne van Kesteren <annevk@opera.com>  
> wrote:
>> I think firing when a new listener registers for the event is wrong.  
>> Tying that together goes against the event model. addEventListener()  
>> has no such side effects.
>
> What exactly is it wrong with it? And what alternative would you
> suggest to solve the given problem?

You could follow a similar design to http://www.whatwg.org/C#messageport  
that does have special handling for onmessage (or here  
ondeviceorientation), but not for addEventListener(). If you want to use  
addEventListener() you would have to invoke start().

The problem is that addEventListener() is supposed to be orthogonal to all  
this. We could change that, but I am not convinced it is a good idea.


-- 
Anne van Kesteren
http://annevankesteren.nl/
Received on Tuesday, 12 July 2011 11:51:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 22 March 2012 18:13:56 GMT