- From: Mercurial notifier <cvsmail@w3.org>
- Date: Mon, 28 Apr 2014 11:08:48 +0000
- To: public-dap-commits@w3.org
changeset: 512:6c40e085fb2c user: Anssi Kostiainen <anssi.kostiainen@intel.com> date: Mon Apr 28 13:56:41 2014 +0300 files: battery/Overview.html battery/Overview.src.html description: fix testSuiteURI; address ReSpec warnings; update Mounir's affiliation diff -r 5425473c2f75 -r 6c40e085fb2c battery/Overview.html --- a/battery/Overview.html Mon Apr 07 13:25:32 2014 -0400 +++ b/battery/Overview.html Mon Apr 28 13:56:41 2014 +0300 @@ -1,5 +1,5 @@ <!DOCTYPE html> -<html lang="en" dir="ltr"> +<html lang="en" dir="ltr" typeof="bibo:Document " about="" property="dcterms:language" content="en"> <head> <title>Battery Status API</title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> @@ -114,6 +114,12 @@ .section dl.attrs dd, .section dl.eldef dd { margin-bottom: 0; } + +@media print { + .removeOnSave { + display: none; + } +} </style><style>/* --- EXAMPLES --- */ div.example-title { min-width: 7.5em; @@ -421,20 +427,20 @@ border-collapse: collapse; width: 100%; } -</style><link rel="stylesheet" href="//www.w3.org/StyleSheets/TR/W3C-ED"><!--[if lt IE 9]><script src='https://www.w3.org/2008/site/js/html5shiv.js'></script><![endif]--></head> - <body><div class="head"> +</style><link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/W3C-ED"><!--[if lt IE 9]><script src='https://www.w3.org/2008/site/js/html5shiv.js'></script><![endif]--></head> + <body class="h-entry" role="document" id="respecDocument"><div class="head" role="contentinfo" id="respecHeader"> <p> <a href="http://www.w3.org/"><img width="72" height="48" src="https://www.w3.org/Icons/w3c_home" alt="W3C"></a> </p> - <h1 class="title" id="title">Battery Status API</h1> + <h1 class="title p-name" id="title" property="dcterms:title">Battery Status API</h1> - <h2 id="w3c-editor-s-draft-19-april-2013"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft 19 April 2013</h2> + <h2 property="dcterms:issued" datatype="xsd:dateTime" content="2014-04-28T07:51:48.000Z" id="w3c-editor-s-draft-28-april-2014"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft <time class="dt-published" datetime="2014-04-28">28 April 2014</time></h2> <dl> <dt>This version:</dt> - <dd><a href="http://dvcs.w3.org/hg/dap/raw-file/default/battery/Overview.html">http://dvcs.w3.org/hg/dap/raw-file/default/battery/Overview.html</a></dd> + <dd><a class="u-url" href="http://dvcs.w3.org/hg/dap/raw-file/default/battery/Overview.html">http://dvcs.w3.org/hg/dap/raw-file/default/battery/Overview.html</a></dd> <dt>Latest published version:</dt> <dd><a href="http://www.w3.org/TR/battery-status/">http://www.w3.org/TR/battery-status/</a></dd> @@ -444,7 +450,8 @@ <dt>Test suite:</dt> - <dd><a href="http://w3c-test.org/dap/battery/tests/">http://w3c-test.org/dap/battery/tests/</a></dd> + <dd><a href="http://w3c-test.org/battery-status/">http://w3c-test.org/battery-status/</a></dd> + @@ -453,10 +460,13 @@ <dt>Editors:</dt> - <dd><span>Anssi Kostiainen</span>, <a href="http://intel.com/">Intel</a></dd> -<dd><span>Mounir Lamouri</span>, <a href="http://mozilla.org/">Mozilla</a></dd> + <dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><span property="foaf:name" class="p-name fn">Anssi Kostiainen</span>, <a rel="foaf:workplaceHomepage" class="p-org org h-org h-card" href="http://intel.com/">Intel</a></span> +</dd> +<dd class="p-author h-card vcard" rel="bibo:editor" inlist=""><span typeof="foaf:Person"><span property="foaf:name" class="p-name fn">Mounir Lamouri</span>, <a rel="foaf:workplaceHomepage" class="p-org org h-org h-card" href="http://google.com/">Google Inc.</a> (previously Mozilla)</span> +</dd> + </dl> @@ -464,33 +474,39 @@ <p class="copyright"> - <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © - 2013 + <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © + 2014 - <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> + <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, - <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. + <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>), + + All Rights Reserved. + <abbr title="World Wide Web Consortium">W3C</abbr> <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and - <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply. + + <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> + + rules apply. </p> <hr> </div> - <section id="abstract" class="introductory"><h2>Abstract</h2><p> + <section id="abstract" class="introductory" property="dcterms:abstract" datatype="" typeof="bibo:Chapter" resource="#abstract" rel="bibo:Chapter"><h2 aria-level="1" role="heading" id="h2_abstract">Abstract</h2><p> This specification defines an API that provides information about the battery status of the hosting device. - </p></section><section id="sotd" class="introductory"><h2>Status of This Document</h2> + </p></section><section id="sotd" class="introductory" typeof="bibo:Chapter" resource="#sotd" rel="bibo:Chapter"><h2 aria-level="1" role="heading" id="h2_sotd">Status of This Document</h2> <p> - <em>This section describes the status of this document at the time of its publication. Other - documents may supersede this document. A list of current <abbr title="World Wide Web Consortium">W3C</abbr> publications and the latest revision - of this technical report can be found in the <a href="http://www.w3.org/TR/"><abbr title="World Wide Web Consortium">W3C</abbr> technical reports - index</a> at http://www.w3.org/TR/.</em> + <em>This section describes the status of this document at the time of its publication. + Other documents may supersede this document. A list of current <abbr title="World Wide Web Consortium">W3C</abbr> publications and the + latest revision of this technical report can be found in the <a href="http://www.w3.org/TR/"><abbr title="World Wide Web Consortium">W3C</abbr> technical reports index</a> at + http://www.w3.org/TR/.</em> </p> <p> @@ -507,38 +523,46 @@ This document was published by the <a href="http://www.w3.org/2009/dap/">Device APIs Working Group</a> as an Editor's Draft. - If you wish to make comments regarding this document, please send them to - <a href="mailto:public-device-apis@w3.org">public-device-apis@w3.org</a> - (<a href="mailto:public-device-apis-request@w3.org?subject=subscribe">subscribe</a>, - <a href="http://lists.w3.org/Archives/Public/public-device-apis/">archives</a>). + If you wish to make comments regarding this document, please send them to + <a href="mailto:public-device-apis@w3.org">public-device-apis@w3.org</a> + (<a href="mailto:public-device-apis-request@w3.org?subject=subscribe">subscribe</a>, + <a href="http://lists.w3.org/Archives/Public/public-device-apis/">archives</a>). - All comments are welcome. + All comments are welcome. + + </p> - </p><p> - Publication as an Editor's Draft does not imply endorsement by the <abbr title="World Wide Web Consortium">W3C</abbr> Membership. - This is a draft document and may be updated, replaced or obsoleted by other documents at - any time. It is inappropriate to cite this document as other than work in progress. + <p> + Publication as an Editor's Draft does not imply endorsement by the <abbr title="World Wide Web Consortium">W3C</abbr> + Membership. This is a draft document and may be updated, replaced or obsoleted by other + documents at any time. It is inappropriate to cite this document as other than work in + progress. </p> + <p> This document was produced by a group operating under the - <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>. + <a id="sotd_patent" about="" rel="w3p:patentRules" href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 <abbr title="World Wide Web Consortium">W3C</abbr> Patent + Policy</a>. - <abbr title="World Wide Web Consortium">W3C</abbr> maintains a <a href="http://www.w3.org/2004/01/pp-impl/43696/status" rel="disclosure">public list of any patent disclosures</a> + <abbr title="World Wide Web Consortium">W3C</abbr> maintains a <a href="http://www.w3.org/2004/01/pp-impl/43696/status" rel="disclosure">public list of any patent + disclosures</a> - made in connection with the deliverables of the group; that page also includes instructions for - disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains - <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the - information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section + made in connection with the deliverables of the group; that page also includes + instructions for disclosing a patent. An individual who has actual knowledge of a patent + which the individual believes contains + <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential + Claim(s)</a> must disclose the information in accordance with + <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>. @@ -547,12 +571,12 @@ -</section><section id="toc"><h2 class="introductory">Table of Contents</h2><ul class="toc"><li class="tocline"><a href="#introduction" class="tocxref"><span class="secno">1. </span>Introduction</a></li><li class="tocline"><a href="#conformance" class="tocxref"><span class="secno">2. </span>Conformance</a></li><li class="tocline"><a href="#terminology" class="tocxref"><span class="secno">3. </span>Terminology</a></li><li class="tocline"><a href="#security-and-privacy-considerations" class="tocxref"><span class="secno">4. </span>Security and privacy considerations</a></li><li class="tocline"><a href="#navigator-interface" class="tocxref"><span class="secno">5. </span><span class="formerLink"><code>Navigator</code></span> Interface</a></li><li class="tocline"><a href="#batterymanager-interface" class="tocxref"><span class="secno">6. </span><span class="formerLink"><code>BatteryManager</code></span> Interface</a><ul class="toc"><li class="tocline"><a href="#event-handlers" class="tocxref"><span class="secno">61 </span>Event handlers</a></li></ul></li><li class="tocline"><a href="#examples" class="tocxref"><span class="secno">7. </span>Examples</a></li><li class="tocline"><a href="#acknowledgements" class="tocxref"><span class="secno">A. </span>Acknowledgements</a></li><li class="tocline"><a href="#references" class="tocxref"><span class="secno">B. </span>References</a><ul class="toc"><li class="tocline"><a href="#normative-references" class="tocxref"><span class="secno">B.1 </span>Normative references</a></li></ul></li></ul></section> +</section><section id="toc"><h2 class="introductory" aria-level="1" role="heading" id="h2_toc">Table of Contents</h2><ul class="toc" role="directory" id="respecContents"><li class="tocline"><a href="#introduction" class="tocxref"><span class="secno">1. </span>Introduction</a></li><li class="tocline"><a href="#conformance" class="tocxref"><span class="secno">2. </span>Conformance</a></li><li class="tocline"><a href="#terminology" class="tocxref"><span class="secno">3. </span>Terminology</a></li><li class="tocline"><a href="#security-and-privacy-considerations" class="tocxref"><span class="secno">4. </span>Security and privacy considerations</a></li><li class="tocline"><a href="#navigator-interface" class="tocxref"><span class="secno">5. </span><span class="formerLink"><code>Navigator</code></span> Interface</a></li><li class="tocline"><a href="#batterymanager-interface" class="tocxref"><span class="secno">6. </span><span class="formerLink"><code>BatteryManager</code></span> Interface</a><ul class="toc"><li lass="tocline"><a href="#event-handlers" class="tocxref"><span class="secno">6.1 </span>Event handlers</a></li></ul></li><li class="tocline"><a href="#examples" class="tocxref"><span class="secno">7. </span>Examples</a></li><li class="tocline"><a href="#acknowledgements" class="tocxref"><span class="secno">A. </span>Acknowledgements</a></li><li class="tocline"><a href="#references" class="tocxref"><span class="secno">B. </span>References</a><ul class="toc"><li class="tocline"><a href="#normative-references" class="tocxref"><span class="secno">B.1 </span>Normative references</a></li></ul></li></ul></section> <section class="informative" id="introduction"> - <!--OddPage--><h2><span class="secno">1. </span>Introduction</h2><p><em>This section is non-normative.</em></p> + <!--OddPage--><h2 aria-level="1" role="heading" id="h2_introduction"><span class="secno">1. </span>Introduction</h2><p><em>This section is non-normative.</em></p> <p> The Battery Status API specification defines a means for web developers to programmatically determine the battery status of the @@ -580,7 +604,7 @@ for new emails every ten seconds without knowledge of the battery status: </p> - <div class="example"><div class="example-title"><span>Example 1</span></div><pre class="example highlight prettyprint"><span class="dec"><!DOCTYPE html></span><span class="pln"> + <div class="example"><div class="example-title"><span>Example 1</span></div><pre class="example highlight prettyprint prettyprinted"><span class="dec"><!DOCTYPE html></span><span class="pln"> </span><span class="tag"><html></span><span class="pln"> </span><span class="tag"><head></span><span class="pln"> </span><span class="tag"><title></span><span class="pln">Email Client</span><span class="tag"></title></span><span class="pln"> @@ -621,7 +645,7 @@ battery, stop checking for emails if the battery is critically low and resume normal operation when the battery is charging: </p> - <div class="example"><div class="example-title"><span>Example 2</span></div><pre class="example highlight prettyprint"><span class="dec"><!DOCTYPE html></span><span class="pln"> + <div class="example"><div class="example-title"><span>Example 2</span></div><pre class="example highlight prettyprint prettyprinted"><span class="dec"><!DOCTYPE html></span><span class="pln"> </span><span class="tag"><html></span><span class="pln"> </span><span class="tag"><head></span><span class="pln"> </span><span class="tag"><title></span><span class="pln">Battery-aware Email Client</span><span class="tag"></title></span><span class="pln"> @@ -673,7 +697,7 @@ </span><span class="tag"></html></span></pre></div> </section> - <section id="conformance"><!--OddPage--><h2><span class="secno">2. </span>Conformance</h2> + <section id="conformance" typeof="bibo:Chapter" resource="#conformance" rel="bibo:Chapter"><!--OddPage--><h2 aria-level="1" role="heading" id="h2_conformance"><span class="secno">2. </span>Conformance</h2> <p> As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is @@ -697,7 +721,7 @@ </p> </section> <section id="terminology"> - <!--OddPage--><h2><span class="secno">3. </span>Terminology</h2> + <!--OddPage--><h2 aria-level="1" role="heading" id="h2_terminology"><span class="secno">3. </span>Terminology</h2> <p> The <code><a href="http://www.w3.org/html/wg/drafts/html/master/webappapis.html#navigator"> Navigator</a></code> interface this specification extends is defined @@ -722,7 +746,7 @@ </p> </section> <section id="security-and-privacy-considerations"> - <!--OddPage--><h2><span class="secno">4. </span>Security and privacy considerations</h2> + <!--OddPage--><h2 aria-level="1" role="heading" id="h2_security-and-privacy-considerations"><span class="secno">4. </span>Security and privacy considerations</h2> <p> The API defined in this specification is used to determine the battery status of the hosting device. The information disclosed has minimal @@ -732,7 +756,7 @@ </p> </section> <section id="navigator-interface"> - <!--OddPage--><h2><span class="secno">5. </span><a href="#idl-def-Navigator" class="idlType"><code>Navigator</code></a> Interface</h2> + <!--OddPage--><h2 aria-level="1" role="heading" id="h2_navigator-interface"><span class="secno">5. </span><a href="#idl-def-Navigator" class="idlType"><code>Navigator</code></a> Interface</h2> <p> The <code>battery</code> attribute of the <a href="#idl-def-Navigator" class="idlType"><code>Navigator</code></a> interface <em class="rfc2119" title="MUST">MUST</em> return an instance of the <a href="#idl-def-BatteryManager" class="idlType"><code>BatteryManager</code></a> interface, which @@ -744,16 +768,16 @@ </section> <section id="batterymanager-interface"> - <!--OddPage--><h2><span class="secno">6. </span><a href="#idl-def-BatteryManager" class="idlType"><code>BatteryManager</code></a> Interface</h2> - <pre class="idl"><span class="idlInterface" id="idl-def-BatteryManager">interface <span class="idlInterfaceID">BatteryManager</span> : <span class="idlSuperclass"><a>EventTarget</a></span> { -<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a>boolean</a></span> <span class="idlAttrName"><a href="#widl-BatteryManager-charging">charging</a></span>;</span> -<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a>unrestricted double</a></span> <span class="idlAttrName"><a href="#widl-BatteryManager-chargingTime">chargingTime</a></span>;</span> -<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a>unrestricted double</a></span> <span class="idlAttrName"><a href="#widl-BatteryManager-dischargingTime">dischargingTime</a></span>;</span> -<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a>double</a></span> <span class="idlAttrName"><a href="#widl-BatteryManager-level">level</a></span>;</span> -<span class="idlAttribute"> attribute <span class="idlAttrType"><a>EventHandler</a></span> <span class="idlAttrName"><a href="#widl-BatteryManager-onchargingchange">onchargingchange</a></span>;</span> -<span class="idlAttribute"> attribute <span class="idlAttrType"><a>EventHandler</a></span> <span class="idlAttrName"><a href="#widl-BatteryManager-onchargingtimechange">onchargingtimechange</a></span>;</span> -<span class="idlAttribute"> attribute <span class="idlAttrType"><a>EventHandler</a></span> <span class="idlAttrName"><a href="#widl-BatteryManager-ondischargingtimechange">ondischargingtimechange</a></span>;</span> -<span class="idlAttribute"> attribute <span class="idlAttrType"><a>EventHandler</a></span> <span class="idlAttrName"><a href="#widl-BatteryManager-onlevelchange">onlevelchange</a></span>;</span> + <!--OddPage--><h2 aria-level="1" role="heading" id="h2_batterymanager-interface"><span class="secno">6. </span><a href="#idl-def-BatteryManager" class="idlType"><code>BatteryManager</code></a> Interface</h2> + <pre class="idl"><span class="idlInterface" id="idl-def-BatteryManager">interface <span class="idlInterfaceID">BatteryManager</span> : <span class="idlSuperclass">EventTarget</span> { +<span class="idlAttribute"> readonly attribute <span class="idlAttrType">boolean</span> <span class="idlAttrName"><a href="#widl-BatteryManager-charging">charging</a></span>;</span> +<span class="idlAttribute"> readonly attribute <span class="idlAttrType">unrestricted double</span> <span class="idlAttrName"><a href="#widl-BatteryManager-chargingTime">chargingTime</a></span>;</span> +<span class="idlAttribute"> readonly attribute <span class="idlAttrType">unrestricted double</span> <span class="idlAttrName"><a href="#widl-BatteryManager-dischargingTime">dischargingTime</a></span>;</span> +<span class="idlAttribute"> readonly attribute <span class="idlAttrType">double</span> <span class="idlAttrName"><a href="#widl-BatteryManager-level">level</a></span>;</span> +<span class="idlAttribute"> attribute <span class="idlAttrType">EventHandler</span> <span class="idlAttrName"><a href="#widl-BatteryManager-onchargingchange">onchargingchange</a></span>;</span> +<span class="idlAttribute"> attribute <span class="idlAttrType">EventHandler</span> <span class="idlAttrName"><a href="#widl-BatteryManager-onchargingtimechange">onchargingtimechange</a></span>;</span> +<span class="idlAttribute"> attribute <span class="idlAttrType">EventHandler</span> <span class="idlAttrName"><a href="#widl-BatteryManager-ondischargingtimechange">ondischargingtimechange</a></span>;</span> +<span class="idlAttribute"> attribute <span class="idlAttrType">EventHandler</span> <span class="idlAttrName"><a href="#widl-BatteryManager-onlevelchange">onlevelchange</a></span>;</span> };</span></pre> <p> When a <a href="#idl-def-BatteryManager" class="idlType"><code>BatteryManager</code></a> object is created, @@ -809,13 +833,13 @@ the <a href="#idl-def-BatteryManager" class="idlType"><code>BatteryManager</code></a> object. It represents the level of the system's battery. </p> - <div class="note"><div class="note-title" role="heading" aria-level="3"><span>Note</span></div><div class=""> + <div class="note"><div class="note-title" aria-level="2" role="heading" id="h_note_1"><span>Note</span></div><div class=""> The definition of how often the <code><a href="#dfn-chargingtimechange" class="internalDFN">chargingtimechange</a></code>, <code><a href="#dfn-dischargingtimechange" class="internalDFN">dischargingtimechange</a></code>, and <code><a href="#dfn-levelchange" class="internalDFN">levelchange</a> </code> events are fired is left to the implementation. </div></div> <section id="event-handlers"> - <h3><span class="secno">6.1 </span>Event handlers</h3> + <h3 aria-level="2" role="heading" id="h3_event-handlers"><span class="secno">6.1 </span>Event handlers</h3> <p> The following are the <a href="#dfn-event-handlers" class="internalDFN">event handlers</a> (and their corresponding <a href="#dfn-event-handler-event-types" class="internalDFN">event handler event types</a>) that <em class="rfc2119" title="MUST">MUST</em> be supported as @@ -851,26 +875,26 @@ </section> <section class="informative" id="examples"> - <!--OddPage--><h2><span class="secno">7. </span>Examples</h2><p><em>This section is non-normative.</em></p> + <!--OddPage--><h2 aria-level="1" role="heading" id="h2_examples"><span class="secno">7. </span>Examples</h2><p><em>This section is non-normative.</em></p> <p> This trivial example writes the battery level to the console each time the level changes: </p> - <div class="example"><div class="example-title"><span>Example 3</span></div><pre class="example highlight prettyprint"><span class="pln">navigator</span><span class="pun">.</span><span class="pln">battery</span><span class="pun">.</span><span class="pln">onlevelchange </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">function</span><span class="pln"> </span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> + <div class="example"><div class="example-title"><span>Example 3</span></div><pre class="example highlight prettyprint prettyprinted"><span class="pln">navigator</span><span class="pun">.</span><span class="pln">battery</span><span class="pun">.</span><span class="pln">onlevelchange </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">function</span><span class="pln"> </span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">navigator</span><span class="pun">.</span><span class="pln">battery</span><span class="pun">.</span><span class="pln">level</span><span class="pun">);</span><span class="pln"> </span><span class="pun">};</span></pre></div> <p> Alternatively, the same using the <code>addEventListener()</code> method: </p> - <div class="example"><div class="example-title"><span>Example 4</span></div><pre class="example highlight prettyprint"><span class="pln">navigator</span><span class="pun">.</span><span class="pln">battery</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">'levelchange'</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">function</span><span class="pln"> </span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> + <div class="example"><div class="example-title"><span>Example 4</span></div><pre class="example highlight prettyprint prettyprinted"><span class="pln">navigator</span><span class="pun">.</span><span class="pln">battery</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">'levelchange'</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">function</span><span class="pln"> </span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln">navigator</span><span class="pun">.</span><span class="pln">battery</span><span class="pun">.</span><span class="pln">level</span><span class="pun">);</span><span class="pln"> </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span></pre></div> <p> The following example updates the indicators to show the charging state, level and time remaining in minutes: </p> - <div class="example"><div class="example-title"><span>Example 5</span></div><pre class="example highlight prettyprint"><span class="dec"><!DOCTYPE html></span><span class="pln"> + <div class="example"><div class="example-title"><span>Example 5</span></div><pre class="example highlight prettyprint prettyprinted"><span class="dec"><!DOCTYPE html></span><span class="pln"> </span><span class="tag"><html></span><span class="pln"> </span><span class="tag"><head></span><span class="pln"> </span><span class="tag"><title></span><span class="pln">Battery Status API Example</span><span class="tag"></title></span><span class="pln"> @@ -898,7 +922,7 @@ </span><span class="tag"></html></span></pre></div> </section> <section class="appendix" id="acknowledgements"> - <!--OddPage--><h2><span class="secno">A. </span>Acknowledgements</h2> + <!--OddPage--><h2 aria-level="1" role="heading" id="h2_acknowledgements"><span class="secno">A. </span>Acknowledgements</h2> <p> The group is deeply indebted to Mounir Lamouri, Jonas Sicking, and the Mozilla WebAPI team in general for their invaluable feedback @@ -916,7 +940,7 @@ </section> -<section id="references" class="appendix"><!--OddPage--><h2><span class="secno">B. </span>References</h2><section id="normative-references"><h3><span class="secno">B.1 </span>Normative references</h3><dl class="bibliography"><dt id="bib-HTML5">[HTML5]</dt><dd>Robin Berjon et al. <a href="http://www.w3.org/TR/html5/"><cite>HTML5</cite></a>. 17 December 2012. W3C Candidate Recommendation. URL: <a href="http://www.w3.org/TR/html5/">http://www.w3.org/TR/html5/</a> -</dd><dt id="bib-RFC2119">[RFC2119]</dt><dd>S. Bradner. <a href="http://www.ietf.org/rfc/rfc2119.txt"><cite>Key words for use in RFCs to Indicate Requirement Levels.</cite></a> March 1997. Internet RFC 2119. URL: <a href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a> -</dd><dt id="bib-WEBIDL">[WEBIDL]</dt><dd>Cameron McCormack. <a href="http://www.w3.org/TR/2012/CR-WebIDL-20120419/"><cite>Web IDL</cite></a>. 19 April 2012. W3C Candidate Recommendation. URL: <a href="http://www.w3.org/TR/2012/CR-WebIDL-20120419/">http://www.w3.org/TR/2012/CR-WebIDL-20120419/</a> +<section id="references" class="appendix" typeof="bibo:Chapter" resource="#references" rel="bibo:Chapter"><!--OddPage--><h2 aria-level="1" role="heading" id="h2_references"><span class="secno">B. </span>References</h2><section id="normative-references" typeof="bibo:Chapter" resource="#normative-references" rel="bibo:Chapter"><h3 aria-level="2" role="heading" id="h3_normative-references"><span class="secno">B.1 </span>Normative references</h3><dl class="bibliography" about=""><dt id="bib-HTML5">[HTML5]</dt><dd rel="dcterms:requires">Robin Berjon; Steve Faulkner; Travis Leithead; Erika Doyle Navara; Edward O'Connor; Silvia Pfeiffer. <a href="http://www.w3.org/TR/html5/"><cite>HTML5</cite></a>. 4 February 2014. W3C Candidate Recommendation. URL: <a href="http://www.w3.org/TR/html5/">http://www.w3.org/TR/html5/</a> +</dd><dt id="bib-RFC2119">[RFC2119]</dt><dd rel="dcterms:requires">S. Bradner. <a href="http://www.ietf.org/rfc/rfc2119.txt"><cite>Key words for use in RFCs to Indicate Requirement Levels.</cite></a> March 1997. Internet RFC 2119. URL: <a href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a> +</dd><dt id="bib-WEBIDL">[WEBIDL]</dt><dd rel="dcterms:requires">Cameron McCormack. <a href="http://www.w3.org/TR/WebIDL/"><cite>Web IDL</cite></a>. 19 April 2012. W3C Candidate Recommendation. URL: <a href="http://www.w3.org/TR/WebIDL/">http://www.w3.org/TR/WebIDL/</a> </dd></dl></section></section></body></html> \ No newline at end of file diff -r 5425473c2f75 -r 6c40e085fb2c battery/Overview.src.html --- a/battery/Overview.src.html Mon Apr 07 13:25:32 2014 -0400 +++ b/battery/Overview.src.html Mon Apr 28 13:56:41 2014 +0300 @@ -16,17 +16,16 @@ crEnd: "2012-07-01", editors: [ { name: "Anssi Kostiainen", company: "Intel", companyURL: "http://intel.com/" }, - { name: "Mounir Lamouri", company: "Mozilla", companyURL: "http://mozilla.org/" } + { name: "Mounir Lamouri", company: "Google Inc.", companyURL: "http://google.com/", note: "previously Mozilla" } ], inlineCSS: true, noIDLIn: true, noLegacyStyle: true, - extraCSS: ["../ReSpec.js/css/respec.css"], wg: "Device APIs Working Group", wgURI: "http://www.w3.org/2009/dap/", wgPublicList: "public-device-apis", wgPatentURI: "http://www.w3.org/2004/01/pp-impl/43696/status", - testSuiteURI: "http://w3c-test.org/dap/battery/tests/", + testSuiteURI: "http://w3c-test.org/battery-status/", scheme: "https" }; </script> @@ -78,7 +77,7 @@ for new emails every ten seconds without knowledge of the battery status: </p> - <pre class="example sh_javascript"> + <pre class="example highlight"> <!DOCTYPE html> <html> <head> @@ -122,7 +121,7 @@ battery, stop checking for emails if the battery is critically low and resume normal operation when the battery is charging: </p> - <pre class="example sh_javascript"> + <pre class="example highlight"> <!DOCTYPE html> <html> <head> @@ -367,7 +366,7 @@ This trivial example writes the battery level to the console each time the level changes: </p> - <pre class="example sh_javascript"> + <pre class="example highlight"> navigator.battery.onlevelchange = function () { console.log(navigator.battery.level); }; @@ -376,7 +375,7 @@ Alternatively, the same using the <code>addEventListener()</code> method: </p> - <pre class="example sh_javascript"> + <pre class="example highlight"> navigator.battery.addEventListener('levelchange', function () { console.log(navigator.battery.level); }, false); @@ -385,7 +384,7 @@ The following example updates the indicators to show the charging state, level and time remaining in minutes: </p> - <pre class="example sh_javascript"> + <pre class="example highlight"> <!DOCTYPE html> <html> <head>
Received on Monday, 28 April 2014 11:08:51 UTC