Re: [whatwg] Device proximity and light events

Scott González wrote:
> On Tuesday, May 8, 2012, Doug Turner wrote:
>
>> You don't.  This API doesn't have device detection.  Don't assume that
>> onXXX means that the UA supports an event.
>>
>
> I thought this was the preferred way to check. I seem to recall a
> discussion about this and agreement that this was the best way to detect
> events.

The WHATWG spec [1] itself says the following:

"When support for a feature is disabled (e.g. as an emergency measure to 
mitigate a security problem, or to aid in development, or for 
performance reasons), user agents must act as if they had no support for 
the feature whatsoever, and as if the feature was not mentioned in this 
specification. For example, if a particular feature is accessed via an 
attribute in a Web IDL interface, the attribute itself would be omitted 
from the objects that implement that interface — leaving the attribute 
on the object but making it return null or throw an exception is 
insufficient."

If the feature is not yet implemented then the same principle should 
apply IMO (if that's not implicit in the above).

- Rich

[1] 
http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#extensibility

Received on Wednesday, 9 May 2012 10:41:28 UTC