[contacts] Proposed text to clarify the relationship between low and critical conditions (ISSUE-114)

 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 

 - 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%


Received on Thursday, 21 July 2011 11:41:56 UTC