From 06cbad3cd6d46f2764e0426deaf9d3aa836115ac Mon Sep 17 00:00:00 2001 From: Raphael Kubo da Costa Date: Tue, 13 Feb 2024 13:22:55 +0100 Subject: [PATCH 1/2] DeviceOrientationEvent: Define absolute's value on error 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 6b349a2..5d309ec 100644 --- a/index.bs +++ b/index.bs @@ -388,10 +388,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/absoltue}} set to false.

deviceorientationabsolute Event

@@ -418,10 +417,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/absoltue}} set to true.

devicemotion Event

From 1607c065746593c7c1f639c4689bac7cba224f14 Mon Sep 17 00:00:00 2001 From: Raphael Kubo da Costa Date: Wed, 14 Feb 2024 09:01:39 +0100 Subject: [PATCH 2/2] Fix typos --- index.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index 5d309ec..278b524 100644 --- a/index.bs +++ b/index.bs @@ -390,7 +390,7 @@ Whenever a significant change in orientation occurs, the user agent must * https://github.com/w3c/deviceorientation/issues/118: Does this mean a single event should be fired? * Should this be a proper in an algorithm? --> -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/absoltue}} set to false. +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,7 +419,7 @@ Whenever a significant change in orientation occurs, the user agent must * https://github.com/w3c/deviceorientation/issues/118: Does this mean a single event should be fired? * Should this be a proper in an algorithm? --> -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/absoltue}} set to true. +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