Skip to content

Commit c0f629e

Browse files
author
Raphael Kubo da Costa
authored
DeviceOrientationEvent: Define absolute's value on error (#139)
We were only requiring alpha, beta, and gamma to be null. It makes sense to also require implementations to set absolute to the same value as well. At the time of writing, this is done for completeness' sake though: - Blink implements this behavior and sets absolute to false when a deviceorientation cannot be provided, and to true for deviceorientationabsolute events. - Gecko does not send any events if it cannot provide readings (e.g. when there are no sensors available). - WebKit only ships an iOS implementation, whose IDL does not even have an absolute attribute. Fixes #119.
1 parent 39442a2 commit c0f629e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

index.bs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,10 +389,9 @@ Whenever a <a>significant change in orientation</a> occurs, the user agent must
389389

390390
<!--
391391
* https://github.com/w3c/deviceorientation/issues/118: Does this mean a single event should be fired?
392-
* https://github.com/w3c/deviceorientation/issues/119: Should absolute's value be set here too?
393392
* Should this be a proper <dfn> in an algorithm?
394393
-->
395-
If an implementation can never provide orientation information, the event should be fired with the {{DeviceOrientationEvent/alpha}}, {{DeviceOrientationEvent/beta}} and {{DeviceOrientationEvent/gamma}} attributes set to null.
394+
If an implementation can never provide orientation information, the event should be fired with the {{DeviceOrientationEvent/alpha}}, {{DeviceOrientationEvent/beta}} and {{DeviceOrientationEvent/gamma}} attributes set to null, and the {{DeviceOrientationEvent/absolute}} attribute set to false.
396395
397396
<h3 id="deviceorientationabsolute">deviceorientationabsolute Event</h3>
398397
@@ -419,10 +418,9 @@ Whenever a <a>significant change in orientation</a> occurs, the user agent must
419418

420419
<!--
421420
* https://github.com/w3c/deviceorientation/issues/118: Does this mean a single event should be fired?
422-
* https://github.com/w3c/deviceorientation/issues/119: Should absolute's value be set here too?
423421
* Should this be a proper <dfn> in an algorithm?
424422
-->
425-
If an implementation can never provide absolute orientation information, the event should be fired with the {{DeviceOrientationEvent/alpha}}, {{DeviceOrientationEvent/beta}} and {{DeviceOrientationEvent/gamma}} attributes set to null.
423+
If an implementation can never provide absolute orientation information, the event should be fired with the {{DeviceOrientationEvent/alpha}}, {{DeviceOrientationEvent/beta}} and {{DeviceOrientationEvent/gamma}} attributes set to null, and the {{DeviceOrientationEvent/absolute}} attribute set to true.
426424
427425
<h3 id="devicemotion">devicemotion Event</h3>
428426

0 commit comments

Comments
 (0)