[whatwg] Device proximity and light events

On May 8, 2012, at 3:26 PM, Jonas Sicking wrote:

> The reason that I'm not really happy with this API is the fact that it
> forces pages to remove all event listeners in order to shut down a
> sensor.

True.  I haven't heard of anyone actually worrying about this. 

> It seems more author friendly to me to allow pages to keep
> event listeners registered but to have an "on/off" switch which they
> can use to control if they want the sensor to be enabled. (Setting it
> to "off" would of course only affect if events are delivered to that
> page. If another page set it to "on" the UA would still fire the
> events to the second page, and that page only).

I do not think we have similar on/off switch APIs for other DOM apis?. Do we?

> Technically we could add such a switch later if the switch's default
> value is "on".

Yup, if there is a demand for it, it is easy to add such a feature.  I want to keep these APIs as damn simple as possible.

Doug

Received on Tuesday, 8 May 2012 15:33:56 UTC