From c0f629e841ef788cda818d17a1d8671b23e87ca3 Mon Sep 17 00:00:00 2001 From: Raphael Kubo da Costa Date: Wed, 14 Feb 2024 18:12:27 +0100 Subject: [PATCH] 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. --- index.bs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/index.bs b/index.bs index e7f0dce..5d2622b 100644 --- a/index.bs +++ b/index.bs @@ -389,10 +389,9 @@ Whenever a significant change in orientation occurs, the user agent must -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. +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.

deviceorientationabsolute Event

@@ -419,10 +418,9 @@ Whenever a significant change in orientation occurs, the user agent must -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. +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.

devicemotion Event