W3C home > Mailing lists > Public > public-device-status@w3.org > October 2011

Re: Feedback about Battery Status Events

From: Anssi Kostiainen <anssi.kostiainen@nokia.com>
Date: Mon, 24 Oct 2011 10:18:04 +0300
Cc: ext Mounir Lamouri <mounir@lamouri.fr>, <public-device-status@w3.org>, ext Kihong Kwon <kihong.kwon@samsung.com>
Message-Id: <C298A88F-88C6-478E-BB41-419D45420D85@nokia.com>
To: ext Jonas Sicking <jonas@sicking.cc>
On 22.10.2011, at 5.11, ext Jonas Sicking wrote:

> Further, if we expose remaining time, the page would be able to notice
> that it's non-infinite (or whatever other value we use to signal that
> battery level won't run out).

The latest spec says:

[[

The [remaining] attribute must be set to the value positive Infinity, if the implementation is unable to report the time remaining, or there is no battery attached to the system."

]]

For example:

if (navigator.battery.remaining < Infinity) {
  // non-infinite time remaining
}

Let me know if there are concerns with this.

-Anssi
Received on Monday, 24 October 2011 07:18:35 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 24 October 2011 07:18:35 GMT