There should probably be a way to poll the current state. Much as you can poll the document.readyState and respond to progress events, it would seem to make sense to have a way to poll the battery state as well as respond to battery state change events.
-Darin On Wed, Jun 15, 2011 at 10:25 AM, Greg Simon <gregsi...@chromium.org> wrote: > From what I can tell the spec offers no way for the web application to > initialize any algorithm based on the battery/power state because there is > no guarantee of "minimum time" when a new document is created and the first > battery event arrives. Ideally there would be a way to "kick" the UA into > sending the battery event on demand. > > Otherwise the web application starts at full-throttle (burning battery) on > a device with 10% battery left until it *drains* enough to get a > batteryEvent. > > > > > On Wed, Jun 15, 2011 at 10:08 AM, Alexis Menard < > alexis.men...@openbossa.org> wrote: > >> On Wed, Jun 15, 2011 at 2:02 PM, Andrei Popescu <andr...@google.com> >> wrote: >> > On Wed, Jun 15, 2011 at 5:58 PM, Brett Wilson <bre...@chromium.org> >> wrote: >> >> On Wed, Jun 15, 2011 at 9:30 AM, Holger Freyther <ze...@selfish.org> >> wrote: >> >>> On 06/15/2011 06:11 PM, laszlo.1.gom...@nokia.com wrote: >> >>>> Hi, >> >>>> >> >>> >> >>>> >> >>>> The use-case for us is to enable content developers to implement >> rudimentary power management (e.g. to stop "expensive" operations on the >> page, perhaps save state). I'm not sure if this API is really meant for >> accurately reporting all the possible power management states of the system >> as Anssi pointed out. >> >>> >> >>> Okay, point on complexity taken. My question is what if you want to >> add >> >>> complexity, is there something in the event that prevents that (I have >> no idea >> >>> about DOM compatibility issues)? Don't get me wrong I think having >> more device >> >>> support is great. >> >>> >> >>> My other complain was, it is too simple. E.g. 'isPlugged' has no >> guarantee >> >>> that the battery is getting charged. Is this a problem? >> >> >> >> Why would a web page care about whether the battery is being charged >> >> when the device is plugged in? >> >> >> > >> > Because it would know not to start doing things that drain the >> > battery. For instance, powering up a 3G antenna to download your >> > latest emails could be annoying to users if the battery level is too >> > low. 3G takes quite a bit of power and the device would be in danger >> > of powering down. >> >> But if the phone is plugged in it can't power down. Most of modern >> phones don't switch off anymore even if you have the battery low and >> you play games, surf WiFi, go 3G as soon as you plugged it in. What >> Brett meant is that it's useless to know that the battery is charging >> while the phone is plugged in, you just want to know that it will not >> switch off in any case so you can do whatever you want. >> >> > >> > Thanks, >> > Andrei >> > _______________________________________________ >> > webkit-dev mailing list >> > webkit-dev@lists.webkit.org >> > http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev >> > >> >> >> >> -- >> Alexis Menard >> Software Engineer >> INdT Recife Brazil >> _______________________________________________ >> webkit-dev mailing list >> webkit-dev@lists.webkit.org >> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev >> > > > _______________________________________________ > webkit-dev mailing list > webkit-dev@lists.webkit.org > http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev > >
_______________________________________________ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev