- From: François Daoust <fd@w3.org>
- Date: Thu, 21 Jul 2011 13:41:26 +0200
- To: <public-device-apis@w3.org>
Hi dap-ers,
I said I'd come up with some text to address ISSUE-114 during the F2F:
"Battery spec should note relative ordering of battery low versus
battery critical in terms of criticality". Further discussions during
the F2F concluded that we'd drop batterylow and batterycritical events
and add something like a "status" attribute that can take the values
"ok", "low", or "critical".
With the new approach, it seems pretty obvious what the relationship
between "ok", "low" and "critical" is. I propose to follow the same
construction as for the level attribute, leading to the following
changes:
- In current section 3, adding a "status" attribute:
[[
interface BatteryStatusEvent: Event {
readonly attribute boolean isPlugged;
readonly attribute float? level;
readonly attribute string? status;
void initBatteryStatusEvent (DOMString type, boolean bubbles, boolean
cancelable, boolean isPlugged, float? level);
};
]]
- In current section 3.1, adding the "status" attribute definition
("scaled from critical to ok"):
[[
status of type string, readonly, nullable
One of ok, low, critical or null.
Represents how much of the internal power source remains, scaled from
critical to ok. The definitions of a low battery and of a critically low
battery conditions are left to the implementation. If the implementation
is unable to report battery's level, then status MUST be set to null.
No exceptions.
]]
- In current section 3.3, adding status change as a condition to
dispatch the event:
[[
The user agent MUST dispatch this event type on the Window [HTML5] and
WorkerGlobalScope [WEBWORKERS] objects when a change in the battery
status of the hosting device occurs as follows:
- isPlugged changes its value, or
- status changes its value, or
- level changes by at least 1%
]]
Francois.
Received on Thursday, 21 July 2011 11:41:56 UTC