From 7652ec6f54b7551cf0a7a06552b98892dca53481 Mon Sep 17 00:00:00 2001 From: Marcos Caceres Date: Wed, 8 May 2024 11:32:04 +1000 Subject: [PATCH 1/6] Editorial: use bikeshed shorthands for devicemotion firing steps --- index.bs | 110 +++++++++++++++++++++++++++---------------------------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/index.bs b/index.bs index 33b41cc..5fadad4 100644 --- a/index.bs +++ b/index.bs @@ -540,65 +540,65 @@ The requestPermission() method steps a
-At an implementation-defined interval interval, the user agent must execute the following steps on a navigable's active window window: +At an [=implementation-defined=] interval |interval|, the user agent must execute the following steps on a [=/navigable=]'s [=navigable/active window=] |window|: - 1. Let document be window's associated Document. - 1. If document's visibility state is not "visible", return. - 1. For each policy of « "accelerometer", "gyroscope" »: - 1. If document is not allowed to use the policy-controlled feature named policy, return. - 1. Let topLevelTraversable be window's navigable's top-level traversable. - 1. Let platformLinearAcceleration be null. - 1. If topLevelTraversable's virtual sensor mapping contains "linear-acceleration": - 1. Let virtualSensor be topLevelTraversable's virtual sensor mapping["linear-acceleration"]. - 1. If virtualSensor's can provide readings flag is true, then set platformLinearAcceleration to the latest readings provided to virtualSensor. + 1. Let |document| be |window|'s [=associated Document=]. + 1. If |document|'s [=Document/visibility state=] is not "visible", return. + 1. [=list/For each=] |policy| of « ""accelerometer"", "gyroscope" »: + 1. If |document| is not [=allowed to use=] the [=policy-controlled feature=] named |policy|, return. + 1. Let |topLevelTraversable| be |window|'s [=Window/navigable=]'s [=navigable/top-level traversable=]. + 1. Let |platformLinearAcceleration| be null. + 1. If |topLevelTraversable|'s virtual sensor mapping contains "linear-acceleration": + 1. Let |virtualSensor| be |topLevelTraversable|'s virtual sensor mapping["linear-acceleration"]. + 1. If |virtualSensor|'s can provide readings flag is true, then set |platformLinearAcceleration| to the latest readings provided to |virtualSensor|. 1. Otherwise, if the implementation is able to provide linear acceleration: - 1. Set platformLinearAcceleration to the device's linear acceleration along the X, Y and Z axes. - 1. Let acceleration be null. - 1. If platformLinearAcceleration is not null: - 1. Set acceleration to a new {{DeviceMotionEventAcceleration}} created in window's realm. - 1. Set acceleration's x axis acceleration to platformLinearAcceleration's value along the X axis, or null if it cannot be provided. - 1. If acceleration's x axis acceleration is not null, limit its precision to no more than 0.1 m/s2. - 1. Set acceleration's y axis acceleration to platformLinearAcceleration's value along the Y axis, or null if it cannot be provided. - 1. If acceleration's y axis acceleration is not null, limit its precision to no more than 0.1 m/s2. - 1. Set acceleration's z axis acceleration to platformLinearAcceleration's value along the Z axis, or null if it cannot be provided. - 1. If acceleration's z axis acceleration is not null, limit its precision to no more than 0.1 m/s2. - 1. Let platformAccelerationIncludingGravity be null. - 1. If topLevelTraversable's virtual sensor mapping contains "accelerometer": - 1. Let virtualSensor be topLevelTraversable's virtual sensor mapping["accelerometer"]. - 1. If virtualSensor's can provide readings flag is true, then set platformAccelerationIncludingGravity to the latest readings provided to virtualSensor. + 1. Set |platformLinearAcceleration| to the device's linear acceleration along the X, Y and Z axes. + 1. Let |acceleration| be null. + 1. If |platformLinearAcceleration| is not null: + 1. Set |acceleration| to a new {{DeviceMotionEventAcceleration}} created in |window|'s realm. + 1. Set |acceleration|'s [=DeviceMotionEventAcceleration/x axis acceleration=] to |platformLinearAcceleration|'s value along the X axis, or null if it cannot be provided. + 1. If |acceleration|'s [=DeviceMotionEventAcceleration/x axis acceleration=] is not null, limit its precision to no more than 0.1 m/s2. + 1. Set |acceleration|'s [=DeviceMotionEventAcceleration/y axis acceleration=] to |platformLinearAcceleration|'s value along the Y axis, or null if it cannot be provided. + 1. If |acceleration|'s [=DeviceMotionEventAcceleration/y axis acceleration=] is not null, limit its precision to no more than 0.1 m/s2. + 1. Set |acceleration|'s [=DeviceMotionEventAcceleration/z axis acceleration=] to |platformLinearAcceleration|'s value along the Z axis, or null if it cannot be provided. + 1. If |acceleration|'s [=DeviceMotionEventAcceleration/z axis acceleration=] is not null, limit its precision to no more than 0.1 m/s2. + 1. Let |platformAccelerationIncludingGravity| be null. + 1. If |topLevelTraversable|'s virtual sensor mapping contains "accelerometer": + 1. Let |virtualSensor| be |topLevelTraversable|'s virtual sensor mapping["accelerometer"]. + 1. If |virtualSensor|'s can provide readings flag is true, then set |platformAccelerationIncludingGravity| to the latest readings provided to |virtualSensor|. 1. Otherwise, if the implementation is able to provide acceleration with gravity: - 1. Set platformAccelerationIncludingGravity to the device's linear acceleration along the X, Y and Z axes. - 1. Let accelerationIncludingGravity be null. - 1. If platformAccelerationIncludingGravity is not null: - 1. Set accelerationIncludingGravity to a new {{DeviceMotionEventAcceleration}} created in window's realm. - 1. Set accelerationIncludingGravity's x axis acceleration to platformAccelerationIncludingGravity's value along the X axis, or null if it cannot be provided. - 1. If accelerationIncludingGravity's x axis acceleration is not null, limit its precision to no more than 0.1 m/s2. - 1. Set accelerationIncludingGravity's y axis acceleration to platformAccelerationIncludingGravity's value along the Y axis, or null if it cannot be provided. - 1. If accelerationIncludingGravity's y axis acceleration is not null, limit its precision to no more than 0.1 m/s2. - 1. Set accelerationIncludingGravity's z axis acceleration to platformAccelerationIncludingGravity's value along the Z axis, or null if it cannot be provided. - 1. If accelerationIncludingGravity's z axis acceleration is not null, limit its precision to no more than 0.1 m/s2. - 1. Let platformRotationRate be null. - 1. If topLevelTraversable's virtual sensor mapping contains "gyroscope": - 1. Let virtualSensor be topLevelTraversable's virtual sensor mapping["gyroscope"]. - 1. If virtualSensor's can provide readings flag is true, then set platformRotationRate to the latest readings provided to virtualSensor. - 1. Otherwise, if the implementation is able to provide rotation rate: - 1. Set platformRotationRate to the device's rotation rate about the X, Y and Z axes. - 1. Let rotationRate be null. - 1. If platformRotationRate is not null: - 1. Set rotationRate to a new {{DeviceMotionEventRotationRate}} created in window's realm. - 1. Set rotationRate's x axis rotation rate to platformRotationRate's value about the X axis, or null if it cannot be provided. - 1. If rotationRate's x axis rotation rate is not null, limit its precision to no more than 0.1 deg/s. - 1. Set rotationRate's y axis rotation rate to platformRotationRate's value about the Y axis, or null if it cannot be provided. - 1. If rotationRate's y axis rotation rate is not null, limit its precision to no more than 0.1 deg/s. - 1. Set rotationRate's z axis rotation rate to platformRotationRate's value about the Z axis, or null if it cannot be provided. - 1. If rotationRate's z axis rotation rate is not null, limit its precision to no more than 0.1 deg/s. - 1. Let environment be window's relevant settings object. + 1. Set |platformAccelerationIncludingGravity| to the device's linear acceleration along the X, Y and Z axes. + 1. Let |accelerationIncludingGravity| be null. + 1. If |platformAccelerationIncludingGravity| is not null: + 1. Set |accelerationIncludingGravity| to a new {{DeviceMotionEventAcceleration}} created in |window|'s realm. + 1. Set |accelerationIncludingGravity|'s [=DeviceMotionEventAcceleration/x axis acceleration=] to |platformAccelerationIncludingGravity|'s value along the X axis, or null if it cannot be provided. + 1. If |accelerationIncludingGravity|'s [=DeviceMotionEventAcceleration/x axis acceleration=] is not null, limit its precision to no more than 0.1 m/s2. + 1. Set |accelerationIncludingGravity|'s [=DeviceMotionEventAcceleration/y axis acceleration=] to |platformAccelerationIncludingGravity|'s value along the Y axis, or null if it cannot be provided. + 1. If |accelerationIncludingGravity|'s [=DeviceMotionEventAcceleration/y axis acceleration=] is not null, limit its precision to no more than 0.1 m/s2. + 1. Set |accelerationIncludingGravity|'s [=DeviceMotionEventAcceleration/z axis acceleration=] to |platformAccelerationIncludingGravity|'s value along the Z axis, or null if it cannot be provided. + 1. If |accelerationIncludingGravity|'s [=DeviceMotionEventAcceleration/z axis acceleration=] is not null, limit its precision to no more than 0.1 m/s2. + 1. Let |platformRotationRate| be null. + 1. If |topLevelTraversable|'s virtual sensor mapping contains "gyroscope": + 1. Let |virtualSensor| be |topLevelTraversable|'s virtual sensor mapping["gyroscope"]. + 1. If |virtualSensor|'s can provide readings flag is true, then set |platformRotationRate| to the latest readings provided to |virtualSensor|. + 1. Otherwise, if the implementation is able to provide [=rotation rate=]: + 1. Set |platformRotationRate| to the device's [=rotation rate=] about the X, Y and Z axes. + 1. Let |rotationRate| be null. + 1. If |platformRotationRate| is not null: + 1. Set |rotationRate| to a new {{DeviceMotionEventRotationRate}} created in |window|'s realm. + 1. Set |rotationRate|'s x axis rotation rate to |platformRotationRate|'s value about the X axis, or null if it cannot be provided. + 1. If |rotationRate|'s x axis rotation rate is not null, limit its precision to no more than 0.1 deg/s. + 1. Set |rotationRate|'s y axis rotation rate to |platformRotationRate|'s value about the Y axis, or null if it cannot be provided. + 1. If |rotationRate|'s y axis rotation rate is not null, limit its precision to no more than 0.1 deg/s. + 1. Set |rotationRate|'s z axis rotation rate to |platformRotationRate|'s value about the Z axis, or null if it cannot be provided. + 1. If |rotationRate|'s z axis rotation rate is not null, limit its precision to no more than 0.1 deg/s. + 1. Let |environment| be |window|'s relevant settings object. 1. Run these steps in parallel: - 1. For each permission name in « "accelerometer", "gyroscope" »: - 1. Let state be the result of getting the current permission state with permission name and environment. - 1. If state is not "{{PermissionState/granted}}", return. - 1. Queue a global task on the device motion and orientation task source given window to run the following steps: - 1. Fire an event named devicemotion at window, using {{DeviceMotionEvent}}, with the {{DeviceMotionEvent/acceleration}} attribute initialized to acceleration, the {{DeviceMotionEvent/accelerationIncludingGravity}} attribute initialized to accelerationIncludingGravity, the {{DeviceMotionEvent/rotationRate}} attribute initialized to rotationRate, and the {{DeviceMotionEvent/interval}} attribute initialized to interval. + 1. [=list/For each=] |permission| in « "accelerometer", "gyroscope" »: + 1. Let |state| be the result of getting the current permission state with |permission| and |environment|. + 1. If |state| is not "{{PermissionState/granted}}", return. + 1. [=Queue a global task=] on the [=device motion and orientation task source=] given |window| to run the following steps: + 1. [=Fire an event=] named "devicemotion" at |window|, using {{DeviceMotionEvent}}, with the {{DeviceMotionEvent/acceleration}} attribute initialized to |acceleration|, the {{DeviceMotionEvent/accelerationIncludingGravity}} attribute initialized to |accelerationIncludingGravity|, the {{DeviceMotionEvent/rotationRate}} attribute initialized to |rotationRate|, and the {{DeviceMotionEvent/interval}} attribute initialized to |interval|.
From be71063218c0b150a7e74ed111d706d8875cf5ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Fri, 10 May 2024 01:02:49 +1000 Subject: [PATCH 2/6] Update index.bs Co-authored-by: Reilly Grant --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index 1173414..13930cd 100644 --- a/index.bs +++ b/index.bs @@ -544,7 +544,7 @@ At an [=implementation-defined=] interval |interval|, the user agent must execut 1. Let |document| be |window|'s [=associated Document=]. 1. If |document|'s [=Document/visibility state=] is not "visible", return. - 1. [=list/For each=] |policy| of « ""accelerometer"", "gyroscope" »: + 1. [=list/For each=] |policy| of « "accelerometer", "gyroscope" »: 1. If |document| is not [=allowed to use=] the [=policy-controlled feature=] named |policy|, return. 1. Let |topLevelTraversable| be |window|'s [=Window/navigable=]'s [=navigable/top-level traversable=]. 1. Let |platformLinearAcceleration| be null. From cd5002f986b7451f9c6d59695ef9ea33e86edc8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Tue, 14 May 2024 15:12:09 +1000 Subject: [PATCH 3/6] Update index.bs --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index 13930cd..c182ccd 100644 --- a/index.bs +++ b/index.bs @@ -586,7 +586,7 @@ At an [=implementation-defined=] interval |interval|, the user agent must execut 1. Let |rotationRate| be null. 1. If |platformRotationRate| is not null: 1. Set |rotationRate| to a new {{DeviceMotionEventRotationRate}} created in |window|'s realm. - 1. Set |rotationRate|'s x axis rotation rate to |platformRotationRate|'s value about the X axis, or null if it cannot be provided. + 1. Set |rotationRate|'s [=DeviceMotionEventRotationRate/x axis rotation rate=] to |platformRotationRate|'s value about the X axis, or null if it cannot be provided. 1. If |rotationRate|'s x axis rotation rate is not null, limit its precision to no more than 0.1 deg/s. 1. Set |rotationRate|'s y axis rotation rate to |platformRotationRate|'s value about the Y axis, or null if it cannot be provided. 1. If |rotationRate|'s y axis rotation rate is not null, limit its precision to no more than 0.1 deg/s. From 80f3a6bfa12f4ec88f98f6f5aa728fa8bc98d16c Mon Sep 17 00:00:00 2001 From: Marcos Caceres Date: Tue, 14 May 2024 15:18:29 +1000 Subject: [PATCH 4/6] review feedback, more shorthands --- index.bs | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/index.bs b/index.bs index c182ccd..0205c28 100644 --- a/index.bs +++ b/index.bs @@ -543,19 +543,19 @@ The requestPermission() method steps a At an [=implementation-defined=] interval |interval|, the user agent must execute the following steps on a [=/navigable=]'s [=navigable/active window=] |window|: 1. Let |document| be |window|'s [=associated Document=]. - 1. If |document|'s [=Document/visibility state=] is not "visible", return. + 1. If |document|'s [=Document/visibility state=] is not "`visible`", return. 1. [=list/For each=] |policy| of « "accelerometer", "gyroscope" »: 1. If |document| is not [=allowed to use=] the [=policy-controlled feature=] named |policy|, return. 1. Let |topLevelTraversable| be |window|'s [=Window/navigable=]'s [=navigable/top-level traversable=]. 1. Let |platformLinearAcceleration| be null. - 1. If |topLevelTraversable|'s virtual sensor mapping contains "linear-acceleration": - 1. Let |virtualSensor| be |topLevelTraversable|'s virtual sensor mapping["linear-acceleration"]. - 1. If |virtualSensor|'s can provide readings flag is true, then set |platformLinearAcceleration| to the latest readings provided to |virtualSensor|. - 1. Otherwise, if the implementation is able to provide linear acceleration: - 1. Set |platformLinearAcceleration| to the device's linear acceleration along the X, Y and Z axes. + 1. If |topLevelTraversable|'s [=virtual sensor mapping=] [=map/contains=] "`linear`e>": + 1. Let |virtualSensor| be |topLevelTraversable|'s [=virtual sensor mapping=]["`linear`e>"]. + 1. If |virtualSensor|'s [=can provide readings flag=] is true, then set |platformLinearAcceleration| to the latest readings provided to |virtualSensor|. + 1. Otherwise, if the implementation is able to provide [=linear acceleration=]: + 1. Set |platformLinearAcceleration| to the device's [=linear acceleration=] along the X, Y and Z axes. 1. Let |acceleration| be null. 1. If |platformLinearAcceleration| is not null: - 1. Set |acceleration| to a new {{DeviceMotionEventAcceleration}} created in |window|'s realm. + 1. Set |acceleration| to a [=new=] {{DeviceMotionEventAcceleration}} created in |window|'s [=global object/realm=]. 1. Set |acceleration|'s [=DeviceMotionEventAcceleration/x axis acceleration=] to |platformLinearAcceleration|'s value along the X axis, or null if it cannot be provided. 1. If |acceleration|'s [=DeviceMotionEventAcceleration/x axis acceleration=] is not null, limit its precision to no more than 0.1 m/s2. 1. Set |acceleration|'s [=DeviceMotionEventAcceleration/y axis acceleration=] to |platformLinearAcceleration|'s value along the Y axis, or null if it cannot be provided. @@ -563,14 +563,14 @@ At an [=implementation-defined=] interval |interval|, the user agent must execut 1. Set |acceleration|'s [=DeviceMotionEventAcceleration/z axis acceleration=] to |platformLinearAcceleration|'s value along the Z axis, or null if it cannot be provided. 1. If |acceleration|'s [=DeviceMotionEventAcceleration/z axis acceleration=] is not null, limit its precision to no more than 0.1 m/s2. 1. Let |platformAccelerationIncludingGravity| be null. - 1. If |topLevelTraversable|'s virtual sensor mapping contains "accelerometer": - 1. Let |virtualSensor| be |topLevelTraversable|'s virtual sensor mapping["accelerometer"]. - 1. If |virtualSensor|'s can provide readings flag is true, then set |platformAccelerationIncludingGravity| to the latest readings provided to |virtualSensor|. - 1. Otherwise, if the implementation is able to provide acceleration with gravity: - 1. Set |platformAccelerationIncludingGravity| to the device's linear acceleration along the X, Y and Z axes. + 1. If |topLevelTraversable|'s [=virtual sensor mapping=] [=map/contains=] "`accelerometer`": + 1. Let |virtualSensor| be |topLevelTraversable|'s [=virtual sensor mapping=]["`accelerometer`"]. + 1. If |virtualSensor|'s [=can provide readings flag=] is true, then set |platformAccelerationIncludingGravity| to the latest readings provided to |virtualSensor|. + 1. Otherwise, if the implementation is able to provide [=acceleration with gravity=]: + 1. Set |platformAccelerationIncludingGravity| to the device's [=linear acceleration=] along the X, Y and Z axes. 1. Let |accelerationIncludingGravity| be null. 1. If |platformAccelerationIncludingGravity| is not null: - 1. Set |accelerationIncludingGravity| to a new {{DeviceMotionEventAcceleration}} created in |window|'s realm. + 1. Set |accelerationIncludingGravity| to a [=new=] {{DeviceMotionEventAcceleration}} created in |window|'s [=global object/realm=]. 1. Set |accelerationIncludingGravity|'s [=DeviceMotionEventAcceleration/x axis acceleration=] to |platformAccelerationIncludingGravity|'s value along the X axis, or null if it cannot be provided. 1. If |accelerationIncludingGravity|'s [=DeviceMotionEventAcceleration/x axis acceleration=] is not null, limit its precision to no more than 0.1 m/s2. 1. Set |accelerationIncludingGravity|'s [=DeviceMotionEventAcceleration/y axis acceleration=] to |platformAccelerationIncludingGravity|'s value along the Y axis, or null if it cannot be provided. @@ -578,24 +578,24 @@ At an [=implementation-defined=] interval |interval|, the user agent must execut 1. Set |accelerationIncludingGravity|'s [=DeviceMotionEventAcceleration/z axis acceleration=] to |platformAccelerationIncludingGravity|'s value along the Z axis, or null if it cannot be provided. 1. If |accelerationIncludingGravity|'s [=DeviceMotionEventAcceleration/z axis acceleration=] is not null, limit its precision to no more than 0.1 m/s2. 1. Let |platformRotationRate| be null. - 1. If |topLevelTraversable|'s virtual sensor mapping contains "gyroscope": - 1. Let |virtualSensor| be |topLevelTraversable|'s virtual sensor mapping["gyroscope"]. - 1. If |virtualSensor|'s can provide readings flag is true, then set |platformRotationRate| to the latest readings provided to |virtualSensor|. + 1. If |topLevelTraversable|'s [=virtual sensor mapping=] [=map/contains=] "`gyroscope`": + 1. Let |virtualSensor| be |topLevelTraversable|'s [=virtual sensor mapping=]["`gyroscope`"]. + 1. If |virtualSensor|'s [=can provide readings flag=] is true, then set |platformRotationRate| to the latest readings provided to |virtualSensor|. 1. Otherwise, if the implementation is able to provide [=rotation rate=]: 1. Set |platformRotationRate| to the device's [=rotation rate=] about the X, Y and Z axes. 1. Let |rotationRate| be null. 1. If |platformRotationRate| is not null: - 1. Set |rotationRate| to a new {{DeviceMotionEventRotationRate}} created in |window|'s realm. + 1. Set |rotationRate| to a [=new=] {{DeviceMotionEventRotationRate}} created in |window|'s [=global object/realm=]. 1. Set |rotationRate|'s [=DeviceMotionEventRotationRate/x axis rotation rate=] to |platformRotationRate|'s value about the X axis, or null if it cannot be provided. - 1. If |rotationRate|'s x axis rotation rate is not null, limit its precision to no more than 0.1 deg/s. - 1. Set |rotationRate|'s y axis rotation rate to |platformRotationRate|'s value about the Y axis, or null if it cannot be provided. - 1. If |rotationRate|'s y axis rotation rate is not null, limit its precision to no more than 0.1 deg/s. - 1. Set |rotationRate|'s z axis rotation rate to |platformRotationRate|'s value about the Z axis, or null if it cannot be provided. - 1. If |rotationRate|'s z axis rotation rate is not null, limit its precision to no more than 0.1 deg/s. - 1. Let |environment| be |window|'s relevant settings object. - 1. Run these steps in parallel: + 1. If |rotationRate|'s [=DeviceMotionEventRotationRate/x axis rotation rate=] is not null, limit its precision to no more than 0.1 deg/s. + 1. Set |rotationRate|'s [=DeviceMotionEventRotationRate/y axis rotation rate=] to |platformRotationRate|'s value about the Y axis, or null if it cannot be provided. + 1. If |rotationRate|'s [=DeviceMotionEventRotationRate/y axis rotation rate=] is not null, limit its precision to no more than 0.1 deg/s. + 1. Set |rotationRate|'s [=DeviceMotionEventRotationRate/z axis rotation rate=] to |platformRotationRate|'s value about the Z axis, or null if it cannot be provided. + 1. If |rotationRate|'s [=DeviceMotionEventRotationRate/z axis rotation rate=] is not null, limit its precision to no more than 0.1 deg/s. + 1. Let |environment| be |window|'s [=relevant settings object=]. + 1. Run these steps [=in parallel=]: 1. [=list/For each=] |permission| in « "accelerometer", "gyroscope" »: - 1. Let |state| be the result of getting the current permission state with |permission| and |environment|. + 1. Let |state| be the result of [=getting the current permission state=] with |permission| and |environment|. 1. If |state| is not "{{PermissionState/granted}}", return. 1. [=Queue a global task=] on the [=device motion and orientation task source=] given |window| to run the following steps: 1. [=Fire an event=] named "devicemotion" at |window|, using {{DeviceMotionEvent}}, with the {{DeviceMotionEvent/acceleration}} attribute initialized to |acceleration|, the {{DeviceMotionEvent/accelerationIncludingGravity}} attribute initialized to |accelerationIncludingGravity|, the {{DeviceMotionEvent/rotationRate}} attribute initialized to |rotationRate|, and the {{DeviceMotionEvent/interval}} attribute initialized to |interval|. From 9fe2eed1fc5ca631517088ba8b5f807dd8acf287 Mon Sep 17 00:00:00 2001 From: Marcos Caceres Date: Tue, 14 May 2024 15:21:01 +1000 Subject: [PATCH 5/6] xref event devicemotion --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index 0205c28..d23ec3d 100644 --- a/index.bs +++ b/index.bs @@ -598,7 +598,7 @@ At an [=implementation-defined=] interval |interval|, the user agent must execut 1. Let |state| be the result of [=getting the current permission state=] with |permission| and |environment|. 1. If |state| is not "{{PermissionState/granted}}", return. 1. [=Queue a global task=] on the [=device motion and orientation task source=] given |window| to run the following steps: - 1. [=Fire an event=] named "devicemotion" at |window|, using {{DeviceMotionEvent}}, with the {{DeviceMotionEvent/acceleration}} attribute initialized to |acceleration|, the {{DeviceMotionEvent/accelerationIncludingGravity}} attribute initialized to |accelerationIncludingGravity|, the {{DeviceMotionEvent/rotationRate}} attribute initialized to |rotationRate|, and the {{DeviceMotionEvent/interval}} attribute initialized to |interval|. + 1. [=Fire an event=] named "devicemotion" at |window|, using {{DeviceMotionEvent}}, with the {{DeviceMotionEvent/acceleration}} attribute initialized to |acceleration|, the {{DeviceMotionEvent/accelerationIncludingGravity}} attribute initialized to |accelerationIncludingGravity|, the {{DeviceMotionEvent/rotationRate}} attribute initialized to |rotationRate|, and the {{DeviceMotionEvent/interval}} attribute initialized to |interval|. From 29c2bb21744f6d17b35fa47388192571ae2bbb4e Mon Sep 17 00:00:00 2001 From: Reilly Grant Date: Mon, 20 May 2024 17:43:35 -0700 Subject: [PATCH 6/6] Fix find-and-replace errors on virtual sensor types --- index.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index d4bf531..50465ba 100644 --- a/index.bs +++ b/index.bs @@ -547,8 +547,8 @@ At an [=implementation-defined=] interval |interval|, the user agent must execut 1. If |document| is not [=allowed to use=] the [=policy-controlled feature=] named |policy|, return. 1. Let |topLevelTraversable| be |window|'s [=Window/navigable=]'s [=navigable/top-level traversable=]. 1. Let |platformLinearAcceleration| be null. - 1. If |topLevelTraversable|'s [=virtual sensor mapping=] [=map/contains=] "`linear`e>": - 1. Let |virtualSensor| be |topLevelTraversable|'s [=virtual sensor mapping=]["`linear`e>"]. + 1. If |topLevelTraversable|'s [=virtual sensor mapping=] [=map/contains=] "`linear-acceleration`": + 1. Let |virtualSensor| be |topLevelTraversable|'s [=virtual sensor mapping=]["`linear-acceleration`"]. 1. If |virtualSensor|'s [=can provide readings flag=] is true, then set |platformLinearAcceleration| to the latest readings provided to |virtualSensor|. 1. Otherwise, if the implementation is able to provide [=linear acceleration=]: 1. Set |platformLinearAcceleration| to the device's [=linear acceleration=] along the X, Y and Z axes.