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

W dniu 2011-07-12 17:10, Anne van Kesteren pisze:
> On Tue, 12 Jul 2011 16:58:46 +0200, Wojciech Masłowski 
> <wmaslowski@opera.com> wrote:
>> Theoretically yes. In practice I don't think this is a problem. 
>> Unless your application does something like counting how many times 
>> the orientation event fired this shouldn't really change the way your 
>> application works. Note that significant change is vague enough so 
>> that the applications should not make any assumptions about timing at 
>> which they receive event therefore it is reasonable to assume that 
>> receiving one additional event should not cause the application to 
>> behave any different.
>
> Theoretically yes. In practice one implementation (lets say the market 
> leader) will fire the event when the listener is registered and 
> everyone will be required to follow. Wishy-washy requirements do not 
> work on the web. If you want interoperability implementations will 
> have to do the same, pretty much always.
>
I think you misunderstood me - what I meant is not that it doesn't make 
a difference from compatibility point of view if a browser sends an 
event or not, but that that it only matters for the first event you 
receive and not really that much for later events unless you rely on 
something you really shouldn't anyway.
> Aside from that, I do not think this group should change the semantics 
> of addEventListener(). If you want to change the semantics of 
> addEventListener(), please bring it up on www-dom@w3.org.
>
>
If we are to be really picky then adding event listener for device 
orientation enables the device compass which is a side effect. Other 
would be sending an empty event to signal that the runtime cannot 
provide values. Do you suggest that orientation doesn't fit DOM Events 
model and it should something else, for example the same approach as 
geolocation?

PS: Can you point me to any point in the DOM Events spec that states 
that addEventListener cannot have any side effects?

-- 
Wojciech Masłowski
Engeneering CORE Wrocław
Opera Software ASA
http://www.opera.com

Received on Tuesday, 12 July 2011 16:44:01 UTC