Re: Battery Status API Last Call Feedback (LC-2574)

Hi Anne, All,

On 1.12.2011, at 15.26, ext Anne van Kesteren wrote:

> On Thu, 01 Dec 2011 12:21:00 +0100, Anssi Kostiainen <anssi.kostiainen@nokia.com> wrote:
>> When the battery charging state is updated, the user agent must queue a task which sets the charging attribute's value and fires a simple event [HTML5] named chargingchange at the BatteryManager object.
>> 
>> When the battery charging time is updated, the user agent must queue a task which sets the chargingTime attribute's value and fires a simple event [HTML5] named chargingtimechange at the BatteryManager object.
>> 
>> When the battery discharging time is updated, the user agent must queue a task which sets the dischargingTime attribute's value and fires a simple event [HTML5] nameddischargingtimechange at the BatteryManager object.
>> 
>> When the battery level is updated, the user agent must queue a task which sets the level attribute's value and fires a simple event [HTML5] named levelchange at the BatteryManager object.
> 
> This looks good. You might want state in the terminology section that "queue a task" and "fire a simple event" are defined elsewhere rather than repeat it, but that's up to you.

Added a Terminology section with the following (moved also the Function definition and event related terminology into it):

[[

3. Terminology

The Function interface represents a function in the scripting language being used 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].

]]

Linked each occurrence of a concept or a term back to this section.

>>>>> You also need to actually define the various on* attributes as being event handlers and update their IDL to match the latest crazy IDL syntax (which might be simplified, so maybe you want to wait for that).
>> 
>> I added the following to the Conformance section:
>> 
>> [[
>> 
>> The Function interface represents a function in the scripting language being used as defined in [HTML5].
>> 
>> ]]
>> 
>> Would that do the trick? I'm looking for the path of least resistance here :)
> 
> To define an event handler you need to have a little more language. See http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#event-handlers for instance. And until we have the fancier lowercase function keyword you need this in your IDL:
> 
>  [TreatNonCallableAsNull] attribute Function? onXXX;

Added the [TreatNonCallableAsNull] extended attribute to event handler IDL attributes.

Added the following section:

[[

6.2 Event handlers

The following are the event handlers (and their corresponding event handler event types) that must be supported as attributes by the BatteryManager object:

event handler         event handler event type
----------------------------------------------
 onchargingchange      chargingchange
 onchargingtimechange  chargingtimechange
 ondischargingchange   dischargingchange
 onlevelchange         levelchange

]]

Let me know if there's still something wonky or something to be improved.

The ED is updated with these changes:

  http://dev.w3.org/2009/dap/system-info/battery-status.html

Many thanks!

-Anssi

Received on Friday, 2 December 2011 09:43:47 UTC