[whatwg] Device proximity and light events

Scott González scott.gonzalez at gmail.com
Wed May 9 08:31:29 PDT 2012


The original question was "How do you detect if the UA supports each of
these sensor?"

I don't think we're asking whether you'd get events, but whether you can
detect that the UA actually supports the event. I would think the UA should
expose support (via onxxx attributes) if the UA and device actually have
support, even if the sensor is turned off. There may be a separate API for
determining if the sensor is turned on, but I don't think that's what was
being asked.


On Wed, May 9, 2012 at 10:48 AM, Doug Turner <dougt at mozilla.com> wrote:

> That is different -- Hixie can chime in.
>
> I think the idea is that if you have and dom event handler, you should
> also have an onXXXX event handler attribute.  Its meaning is less defined.
>  I do not think it means that if ondevicemotion exists, that means you will
> always see device motion events.
>
> Doug
>
>
> On May 9, 2012, at 7:45 AM, Scott González wrote:
>
> > There was a related discussion on the mailing list:
> http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2010-November/029252.html
> >
> > I also found a message from Hixie to me, related to that thread: "I
> agree entirely that if an event has a use case, it makes sense for it to
> have an event handler attribute."
> >
> >
> > On Wed, May 9, 2012 at 10:31 AM, Doug Turner <dougt at mozilla.com> wrote:
> >
> > On May 9, 2012, at 3:14 AM, Anne van Kesteren wrote:
> >
> > > On Wed, May 9, 2012 at 5:59 AM, Doug Turner <dougt at mozilla.com> wrote:
> > >> Where was that discussion?
> > >
> > > This came up at the WebApps F2F and there was general agreement that
> > > if we added new events adding new event handler attributes would make
> > > sense.
> >
> > Was there any notes taken?
> >
> >
> > > Feature detection of some kind is useful as forcing people to
> > > do UA sniffing leads to badness.
> >
> > I am not arguing that it shouldn't be done.   I just don't think it as
> important as most people.  For example, even if the device is present, it
> may be off or not responding.  In that case, you'll have a feature that
> tests positive and never receive any events.
> >
>
>



More information about the whatwg mailing list