Skip to content

Commit 5373812

Browse files
author
Raphael Kubo da Costa
authored
Explicitly associate a Sensor and a sensor type (#467)
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.
1 parent 2ea4fef commit 5373812

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

index.bs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,9 @@ dictionary SensorOptions {
896896

897897
A {{Sensor}} object has an associated [=platform sensor=].
898898

899+
Concrete {{Sensor}} objects also have an associated [=sensor type=], which is the [=sensor type=]
900+
that has their [=interface=] among its [=extension sensor interfaces=].
901+
899902
The [=task source=] for the [=tasks=] mentioned in this specification is the <dfn>sensor task source</dfn>.
900903

901904
<div class="example">
@@ -1346,8 +1349,8 @@ to {{SensorErrorEventInit}}.
13461349

13471350
1. For each {{Sensor}} instance |sensor| in the [=current realm=]:
13481351
1. If |sensor|.{{[[state]]}} is "idle", then [=continue=].
1349-
1. If |sensor|'s associated [=platform sensor=]'s [=sensor type=]'s [=sensor permission
1350-
names=] [=set/contains=] |permissionName|:
1352+
1. If |sensor|'s [=sensor type=]'s [=sensor permission names=] [=set/contains=]
1353+
|permissionName|:
13511354
1. Invoke [=deactivate a sensor object=] with |sensor|.
13521355
1. Let |exception| be the result of [=exception/create|creating=]
13531356
a "{{NotAllowedError}}" {{DOMException}}.
@@ -1506,7 +1509,7 @@ to {{SensorErrorEventInit}}.
15061509

15071510
1. If |sensor_instance|.{{[[state]]}} is "activated",
15081511
1. Let |readings| be the [=latest reading=] of |sensor_instance|'s related [=platform sensor=].
1509-
1. Let |type| be |sensor_instance|'s associated [=platform sensor=]'s associated [=sensor type=].
1512+
1. Let |type| be |sensor_instance|'s associated [=sensor type=].
15101513
1. If |type|'s [=reading quantization algorithm=] is defined, then:
15111514
1. Set |readings| to the result of invoking |type|'s [=reading quantization algorithm=] with |readings|.
15121515
1. If the [=extension specification=] defines a [=local coordinate system=] for |sensor_instance|,

0 commit comments

Comments
 (0)