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

W dniu 2011-07-12 16:13, Bjoern Hoehrmann pisze:
> * wmaslowski@opera.com wrote:
>> Tbh I wouldn't be that religious about it. Requiring browser to fire an
>> event after registering a handler solves the problem of registering a
>> handler to a non-moving device and doesn't have any specific negative
>> implications. Any other solution would mean complicating the API by
>> adding some method to force firing of orientation event or in other way
>> getting current orientation. From developer point of view it is also
>> simpler this way because any other solution forces him to treat initial
>> position as a special case.
> Invoking a listener for "significant change in orientation" when there
> was no "significant change in orientation" seems like something that can
> easily lead to subtle bugs and glitches. You would do this whenever you
> add an additional listener for the event if that triggers the event.
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.

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

Received on Tuesday, 12 July 2011 14:59:24 UTC