@@ -33,12 +33,14 @@ urlPrefix: https://w3c.github.io/sensors; spec: GENERIC-SENSOR
33
33
text: reporting mode; url: reporting-modes
34
34
text: auto
35
35
text: construct a sensor object; url: construct-sensor-object
36
+ text: initialize a sensor object; url: initialize-a-sensor-object
36
37
text: limit maximum sampling frequency; url: limit-max-frequency
37
38
text: reduce accuracy; url: reduce-accuracy
38
39
text: mitigation strategies; url: mitigation-strategies
39
40
text: sampling frequency
40
41
text: sensor type
41
42
text: sensor readings
43
+ text: check sensor policy-controlled features; url: check-sensor-policy-controlled-features
42
44
</pre>
43
45
<pre class=biblio>
44
46
{
@@ -230,15 +232,37 @@ The AmbientLightSensor Interface {#ambient-light-sensor-interface}
230
232
};
231
233
</pre>
232
234
233
- To <dfn>Construct an AmbientLightSensor Object</dfn> the user agent must invoke the
234
- <a> construct a Sensor object</a> abstract operation.
235
+ To construct an {{ AmbientLightSensor}} object the user agent must invoke the
236
+ [= construct an ambient light sensor object=] abstract operation.
235
237
236
238
### The illuminance attribute ### {#ambient-light-sensor-reading-attribute}
237
239
238
240
The <a attribute for="AmbientLightSensor">illuminance</a> attribute of the {{AmbientLightSensor}}
239
241
interface represents the [=current light level=] and returns the result of invoking
240
242
[=get value from latest reading=] with `this` and "illuminance" as arguments.
241
243
244
+ Abstract Operations {#abstract-operations}
245
+ ===================
246
+
247
+ <h3 dfn export>Construct an ambient light sensor object</h3>
248
+
249
+ <div algorithm="construct an ambient light sensor object">
250
+
251
+ : input
252
+ :: |options|, a {{SensorOptions}} object.
253
+ : output
254
+ :: An {{AmbientLightSensor}} object.
255
+
256
+ 1. Let |allowed| be the result of invoking [=check sensor policy-controlled features=]
257
+ with {{AmbientLightSensor}} .
258
+ 1. If |allowed| is false, then:
259
+ 1. [=Throw=] a {{SecurityError}} {{DOMException}} .
260
+ 1. Let |ambient_light_sensor| be the new {{AmbientLightSensor}} object.
261
+ 1. Invoke [=initialize a sensor object=] with |ambient_light_sensor| and |options|.
262
+ 1. Return |ambient_light_sensor|.
263
+ </div>
264
+
265
+
242
266
Use Cases and Requirements {#usecases-requirements}
243
267
=========
244
268
0 commit comments