W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2012

[whatwg] Device proximity and light events

From: Doug Turner <dougt@mozilla.com>
Date: Tue, 8 May 2012 15:33:56 -0700
Message-ID: <2AD682D0-E6F1-4F6A-9861-D6FA5D48C412@mozilla.com>

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.

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

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:42 UTC