12191219 background-attachment : fixed;
12201220 }
12211221 </ style >
1222- < meta content ="Bikeshed version eee3e9e7543e2188fb60d183a6cf3fe3a7d971c1 " name ="generator ">
1222+ < meta content ="Bikeshed version 0da7328bb90ef81993146377e4e0fed236969c4c " name ="generator ">
12231223 < link href ="https://www.w3.org/TR/orientation-sensor/ " rel ="canonical ">
1224- < meta content ="03a4b0804a001e76b542b3894d9e1802363b8b98 " name ="document-revision ">
1224+ < meta content ="5fc45fd5efc8e7115eef19845c7a30c118acbc78 " name ="document-revision ">
12251225< style > /* style-md-lists */
12261226
12271227/* This is a weird hack for me not yet following the commonmark spec
14791479 < div class ="head ">
14801480 < p data-fill-with ="logo "> < a class ="logo " href ="https://www.w3.org/ "> < img alt ="W3C " height ="48 " src ="https://www.w3.org/StyleSheets/TR/2016/logos/W3C " width ="72 "> </ a > </ p >
14811481 < h1 class ="p-name no-ref " id ="title "> Orientation Sensor</ h1 >
1482- < h2 class ="no-num no-toc no-ref heading settled " id ="subtitle "> < span class ="content "> Editor’s Draft, < time class ="dt-updated " datetime ="2019-01-29 " > 29 January 2019</ time > </ span > </ h2 >
1482+ < h2 class ="no-num no-toc no-ref heading settled " id ="subtitle "> < span class ="content "> Editor’s Draft, < time class ="dt-updated " datetime ="2019-02-21 " > 21 February 2019</ time > </ span > </ h2 >
14831483 < div data-fill-with ="spec-metadata ">
14841484 < dl >
14851485 < dt > This version:
14861486 < dd > < a class ="u-url " href ="https://w3c.github.io/orientation-sensor/ "> https://w3c.github.io/orientation-sensor/</ a >
14871487 < dt > Latest published version:
14881488 < dd > < a href ="https://www.w3.org/TR/orientation-sensor/ "> https://www.w3.org/TR/orientation-sensor/</ a >
14891489 < dt > Previous Versions:
1490- < dd > < a href ="https://www.w3.org/TR/2017/WD -orientation-sensor-20170814 / " rel
10BC0
span>="prev "> https://www.w3.org/TR/2017/WD -orientation-sensor-20170814 /</ a >
1490+ < dd > < a href ="https://www.w3.org/TR/2018/CR -orientation-sensor-20180320 / " rel ="prev "> https://www.w3.org/TR/2018/CR -orientation-sensor-20180320 /</ a >
14911491 < dt > Version History:
14921492 < dd > < a href ="https://github.com/w3c/orientation-sensor/commits/gh-pages/index.bs "> https://github.com/w3c/orientation-sensor/commits/gh-pages/index.bs</ a >
14931493 < dt > Feedback:
@@ -1618,9 +1618,9 @@ <h2 class="heading settled" data-level="3" id="examples"><span class="secno">3.
16181618< pre class ="highlight "> < c- kr > const</ c- > sensor < c- o > =</ c- > < c- k > new</ c- > AbsoluteOrientationSensor< c- p > ();</ c- >
16191619< c- kr > const</ c- > mat4 < c- o > =</ c- > < c- k > new</ c- > Float32Array< c- p > (</ c- > < c- mi > 16</ c- > < c- p > );</ c- >
16201620sensor< c- p > .</ c- > start< c- p > ();</ c- >
1621- sensor< c- p > .</ c- > onerror < c- o > =</ c- > event < c- o > => </ c- > console< c- p > .</ c- > log< c- p > (</ c- > event< c- p > .</ c- > error< c- p > .</ c- > name< c- p > ,</ c- > event< c- p > .</ c- > error< c- p > .</ c- > message< c- p > );</ c- >
1621+ sensor< c- p > .</ c- > onerror < c- o > =</ c- > event < c- p > => </ c- > console< c- p > .</ c- > log< c- p > (</ c- > event< c- p > .</ c- > error< c- p > .</ c- > name< c- p > ,</ c- > event< c- p > .</ c- > error< c- p > .</ c- > message< c- p > );</ c- >
16221622
1623- sensor< c- p > .</ c- > onreading < c- o > =</ c- > < c- p > ()</ c- > < c- o > => </ c- > < c- p > {</ c- >
1623+ sensor< c- p > .</ c- > onreading < c- o > =</ c- > < c- p > ()</ c- > < c- p > => </ c- > < c- p > {</ c- >
16241624 sensor< c- p > .</ c- > populateMatrix< c- p > (</ c- > mat4< c- p > );</ c- >
16251625< c- p > };</ c- >
16261626</ pre >
@@ -1630,7 +1630,7 @@ <h2 class="heading settled" data-level="3" id="examples"><span class="secno">3.
16301630< pre class ="highlight "> < c- kr > const</ c- > sensor < c- o > =</ c- > < c- k > new</ c- > AbsoluteOrientationSensor< c- p > ({</ c- > frequency< c- o > :</ c- > < c- mi > 60</ c- > < c- p > });</ c- >
16311631< c- kr > const</ c- > mat4 < c- o > =</ c- > < c- k > new</ c- > Float32Array< c- p > (</ c- > < c- mi > 16</ c- > < c- p > );</ c- >
16321632sensor< c- p > .</ c- > start< c- p > ();</ c- >
1633- sensor< c- p > .</ c- > onerror < c- o > =</ c- > event < c- o > => </ c- > console< c- p > .</ c- > log< c- p > (</ c- > event< c- p > .</ c- > error< c- p > .</ c- > name< c- p > ,</ c- > event< c- p > .</ c- > error< c- p > .</ c- > message< c- p > );</ c- >
1633+ sensor< c- p > .</ c- > onerror < c- o > =</ c- > event < c- p > => </ c- > console< c- p > .</ c- > log< c- p > (</ c- > event< c- p > .</ c- > error< c- p > .</ c- > name< c- p > ,</ c- > event< c- p > .</ c- > error< c- p > .</ c- > message< c- p > );</ c- >
16341634
16351635< c- a > function</ c- > draw< c- p > (</ c- > timestamp< c- p > )</ c- > < c- p > {</ c- >
16361636 window< c- p > .</ c- > requestAnimationFrame< c- p > (</ c- > draw< c- p > );</ c- >
@@ -1698,8 +1698,8 @@ <h2 class="heading settled" data-level="5" id="model"><span class="secno">5. </s
16981698Promise< c- p > .</ c- > all< c- p > ([</ c- > navigator< c- p > .</ c- > permissions< c- p > .</ c- > query< c- p > ({</ c- > name< c- o > :</ c- > < c- u > "accelerometer"</ c- > < c- p > }),</ c- >
16991699 navigator< c- p > .</ c- > permissions< c- p > .</ c- > query< c- p > ({</ c- > name< c- o > :</ c- > < c- u > "magnetometer"</ c- > < c- p > }),</ c- >
17001700 navigator< c- p > .</ c- > permissions< c- p > .</ c- > query< c- p > ({</ c- > name< c- o > :</ c- > < c- u > "gyroscope"</ c- > < c- p > })])</ c- >
1701- < c- p > .</ c- > then< c- p > (</ c- > results < c- o > => </ c- > < c- p > {</ c- >
1702- < c- k > if</ c- > < c- p > (</ c- > results< c- p > .</ c- > every< c- p > (</ c- > result < c- o > => </ c- > result< c- p > .</ c- > state < c- o > ===</ c- > < c- u > "granted"</ c- > < c- p > ))</ c- > < c- p > {</ c- >
1701+ < c- p > .</ c- > then< c- p > (</ c- > results < c- p > => </ c- > < c- p > {</ c- >
1702+ < c- k > if</ c- > < c- p > (</ c- > results< c- p > .</ c- > every< c- p > (</ c- > result < c- p > => </ c- > result< c- p > .</ c- > state < c- o > ===</ c- > < c- u > "granted"</ c- > < c- p > ))</ c- > < c- p > {</ c- >
17031703 sensor< c- p > .</ c- > start< c- p > ();</ c- >
17041704 < c- p > ...</ c- >
17051705 < c- p > }</ c- > < c- k > else</ c- > < c- p > {</ c- >
@@ -1710,7 +1710,7 @@ <h2 class="heading settled" data-level="5" id="model"><span class="secno">5. </s
17101710 < p > Another approach is to simply call < code class ="idl "> < a data-link-type ="idl " href ="https://w3c.github.io/sensors/#dom-sensor-start " id ="ref-for-dom-sensor-start① "> start()</ a > </ code > and subscribe to < code class ="idl "> < a data-link-type ="idl " href ="https://w3c.github.io/sensors/#dom-sensor-onerror " id ="ref-for-dom-sensor-onerror "> onerror</ a > </ code > < a data-link-type ="dfn " href ="https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers " id ="ref-for-event-handlers "> event handler</ a > .</ p >
17111711< pre class ="highlight "> < c- kr > const</ c- > sensor < c- o > =</ c- > < c- k > new</ c- > AbsoluteOrientationSensor< c- p > ();</ c- >
17121712sensor< c- p > .</ c- > start< c- p > ();</ c- >
1713- sensor< c- p > .</ c- > onerror < c- o > =</ c- > event < c- o > => </ c- > < c- p > {</ c- >
1713+ sensor< c- p > .</ c- > onerror < c- o > =</ c- > event < c- p > => </ c- > < c- p > {</ c- >
17141714 < c- k > if</ c- > < c- p > (</ c- > event< c- p > .</ c- > error< c- p > .</ c- > name < c- o > ===</ c- > < c- t > 'SecurityError'</ c- > < c- p > )</ c- >
17151715 console< c- p > .</ c- > log< c- p > (</ c- > < c- u > "No permissions to use AbsoluteOrientationSensor."</ c- > < c- p > );</ c- >
17161716< c- p > };</ c- >
0 commit comments