On Battery API

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

Doug

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