W3C home > Mailing lists > Public > public-device-apis@w3.org > June 2011

On Battery API

From: Doug Turner <doug.turner@gmail.com>
Date: Wed, 15 Jun 2011 09:48:22 -0700
Message-ID: <BANLkTi=Bbeg0LgQdirFPQ=t3U=YCR9tCbg@mail.gmail.com>
To: public-device-apis@w3.org
There are a few concerns/ideas I have about the Battery API.

1) I do not think we want handlers to hang off of the window object.

window.onbatterystatus is bad.  we have addEventHandler()

2) I'd like two new events -- BatteryLow and BatteryCriticallyLow.
Other than people implementing battery widgets, I am not sure that
|battery.level| means anything -- not all batteries are created equal,
they have different decay rates, and I am not sure we want web
developers having to calculate when the battery is actually "low".

3) We can factor out |battery.plugged| into a new separate event that
can fire when there is a change in state.  People may want just this
information and not the |battery.level|.

Received on Wednesday, 15 June 2011 16:48:49 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:46:04 UTC