The AmbientHumidityEvent interface provides web developers information about the ambient humidity levels near the hosting device.
This is achieved by interrogating a humidistat or similar detectors of a device.
TBW
This specification defines conformance criteria that apply to a single product: the user agent that implements the interfaces that it contains.
The
EventHandler
interface represents a callback function used for event
handlers as defined in [[!HTML5]].
The concepts queue a task and fires a simple event are defined in [[!HTML5]].
The terms event handlers and event handler event types are defined in [[!HTML5]].
The concepts create an event and fire an event are defined in [[!DOM4]].
The current humidity is a value that represents the ralative humidity expressed as a value between 0 and 1 (e.g., 0.533, which equates to 53.3% humidity).
The HTML5 specification [[!HTML5]] defines a Window interface, which this specification extends:
The onhumidity
event handler and its corresponding
event handler event type ambienthumidity
MUST be supported
as an IDL attribute by all objects implementing the Window
interface.
When a user agent is required to fire an ambient humidity event, the user agent MUST run the following steps:
ambienthumidity
, which
bubbles, is not cancelable, and has no default action, that also
meets the following conditions:
value
attribute to positive Infinity, otherwise initialize the
attribute to the current ambient humidity.
When the current humidity changes, the user agent MUST fire a ambient humidity event.
The following are the event handlers (and their corresponding
event handler event types) that MUST be supported as
attributes by the Window
object:
event handler | event handler event type |
---|---|
onhumidity |
ambienthumidity |