From acf6a1f3dafc1e2a8f95f5d3bc89fdae60619b35 Mon Sep 17 00:00:00 2001 From: Raphael Kubo da Costa Date: Mon, 24 Jul 2023 14:03:02 +0200 Subject: [PATCH] Explicitly associate a Sensor and a sensor type The association was implicit so far: in some abstract operations we retrieved a Sensor instance's "associated sensor type" without ever specifying what it actually meant. Doing this also simplifies algorithms that retrieved a sensor type via a Sensor instance's platform sensor. Related to #463. --- index.bs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/index.bs b/index.bs index b21fbc6..28a11c1 100644 --- a/index.bs +++ b/index.bs @@ -896,6 +896,9 @@ dictionary SensorOptions { A {{Sensor}} object has an associated [=platform sensor=]. +Concrete {{Sensor}} objects also have an associated [=sensor type=], which is the [=sensor type=] +that has their [=interface=] among its [=extension sensor interfaces=]. + The [=task source=] for the [=tasks=] mentioned in this specification is the sensor task source.
@@ -1345,8 +1348,8 @@ to {{SensorErrorEventInit}}. :: None 1. For each {{Sensor}} instance |sensor| in the [=current realm=]: - 1. If |sensor|'s associated [=platform sensor=]'s [=sensor type=]'s [=sensor permission - names=] [=set/contains=] |permissionName|: + 1. If |sensor|'s [=sensor type=]'s [=sensor permission names=] [=set/contains=] + |permissionName|: 1. Invoke [=deactivate a sensor object=] with |sensor|. 1. Let |exception| be the result of [=exception/create|creating=] a "{{NotAllowedError}}" {{DOMException}}. @@ -1505,7 +1508,7 @@ to {{SensorErrorEventInit}}. 1. If |sensor_instance|.{{[[state]]}} is "activated", 1. Let |readings| be the [=latest reading=] of |sensor_instance|'s related [=platform sensor=]. - 1. Let |type| be |sensor_instance|'s associated [=platform sensor=]'s associated [=sensor type=]. + 1. Let |type| be |sensor_instance|'s associated [=sensor type=]. 1. If |type|'s [=reading quantization algorithm=] is defined, then: 1. Set |readings| to the result of invoking |type|'s [=reading quantization algorithm=] with |readings|. 1. If the [=extension specification=] defines a [=local coordinate system=] for |sensor_instance|,