You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>Common use cases relying on a small set of illuminance values, such as styling
1545
1545
webpages according to ambient light levels are best served by the the <code>light-level</code> CSS media feature <adata-link-type="biblio" href="#biblio-mediaqueries-5">[MEDIAQUERIES-5]</a> and its accompanying <code>matchMedia</code> API <adata-link-type="biblio" href="#biblio-cssom">[CSSOM]</a> and are out of scope of this API.</p>
1546
-
<pclass="note" role="note"><span>Note:</span> it might be worthwhile to provide a <adata-link-type="dfn" href="https://w3c.github.io/sensors#high-level" id="ref-for-high-level">high-level</a> Light Level Sensor
1546
+
<pclass="note" role="note"><span>Note:</span> it might be worthwhile to provide a <adata-link-type="dfn" href="https://w3c.github.io/sensors/#high-level" id="ref-for-high-level">high-level</a> Light Level Sensor
1547
1547
which would mirror the <code>light-level</code> media feature, but in JavaScript.
1548
1548
This sensor would <em>not require additional user permission to be activated</em> in user agents that exposed the <code>light-level</code> media feature.</p>
<aclass="self-link" href="#example-67e29d5f"></a> In this simple example, ambient light sensor is created with
1552
-
default configuration. Whenever new <adata-link-type="dfn" href="https://w3c.github.io/sensors#sensor-readings" id="ref-for-sensor-readings">reading</a> is available,
1552
+
default configuration. Whenever new <adata-link-type="dfn" href="https://w3c.github.io/sensors/#sensor-reading" id="ref-for-sensor-reading">reading</a> is available,
<aclass="self-link" href="#example-ae3465bd"></a> In this example, exposure value (EV) at ISO 100 is calculated from
1562
-
the ambient light <adata-link-type="dfn" href="https://w3c.github.io/sensors#sensor-readings" id="ref-for-sensor-readings①">sensor readings</a>. Initially, we check that the user
1563
-
agent has permissions to access ambient light <adata-link-type="dfn" href="https://w3c.github.io/sensors#sensor-readings" id="ref-for-sensor-readings②">sensor readings</a>. Then, <codeclass="idl"><aclass="idl-code" data-link-type="attribute" href="#dom-ambientlightsensor-illuminance" id="ref-for-dom-ambientlightsensor-illuminance">illuminance</a></code> value is converted to the
1562
+
the ambient light <adata-link-type="dfn" href="https://w3c.github.io/sensors/#sensor-reading" id="ref-for-sensor-reading①">sensor readings</a>. Initially, we check that the user
1563
+
agent has permissions to access ambient light <adata-link-type="dfn" href="https://w3c.github.io/sensors/#sensor-reading" id="ref-for-sensor-reading②">sensor readings</a>. Then, <codeclass="idl"><aclass="idl-code" data-link-type="attribute" href="#dom-ambientlightsensor-illuminance" id="ref-for-dom-ambientlightsensor-illuminance">illuminance</a></code> value is converted to the
<aclass="self-link" href="#example-67979230"></a> This example demonstrates how ambient light <adata-link-type="dfn" href="https://w3c.github.io/sensors#sensor-readings" id="ref-for-sensor-readings③">sensor readings</a> can be mapped
1589
+
<aclass="self-link" href="#example-67979230"></a> This example demonstrates how ambient light <adata-link-type="dfn" href="https://w3c.github.io/sensors/#sensor-reading" id="ref-for-sensor-reading③">sensor readings</a> can be mapped
1590
1590
to recommended workplace light levels.
1591
1591
<preclass="highlight"><spanclass="kr">const</span> als <spanclass="o">=</span><spanclass="k">new</span> AmbientLightSensor<spanclass="p">();</span>
1592
1592
@@ -1647,16 +1647,16 @@ <h2 class="heading settled" data-level="3" id="security-and-privacy"><span class
1647
1647
use one or both of the following mitigation strategies:</p>
1648
1648
<ul>
1649
1649
<lidata-md="">
1650
-
<p><adata-link-type="dfn" href="https://w3c.github.io/sensors#limit-max-frequency" id="ref-for-limit-max-frequency">limit maximum sampling frequency</a></p>
1650
+
<p><adata-link-type="dfn" href="https://w3c.github.io/sensors/#limit-max-frequency" id="ref-for-limit-max-frequency">limit maximum sampling frequency</a></p>
1651
1651
<lidata-md="">
1652
-
<p><adata-link-type="dfn" href="https://w3c.github.io/sensors#reduce-accuracy" id="ref-for-reduce-accuracy">reduce accuracy</a> of sensor readings</p>
1652
+
<p><adata-link-type="dfn" href="https://w3c.github.io/sensors/#reduce-accuracy" id="ref-for-reduce-accuracy">reduce accuracy</a> of sensor readings</p>
1653
1653
</ul>
1654
-
<p>These mitigation strategies complement the <adata-link-type="dfn" href="https://w3c.github.io/sensors#mitigation-strategies" id="ref-for-mitigation-strategies">generic mitigations</a> defined in the Generic Sensor API <adata-link-type="biblio" href="#biblio-generic-sensor">[GENERIC-SENSOR]</a>.</p>
1654
+
<p>These mitigation strategies complement the <adata-link-type="dfn" href="https://w3c.github.io/sensors/#mitigation-strategies" id="ref-for-mitigation-strategies">generic mitigations</a> defined in the Generic Sensor API <adata-link-type="biblio" href="#biblio-generic-sensor">[GENERIC-SENSOR]</a>.</p>
<p>The <adata-link-type="dfn" href="#ambient-light-sensor" id="ref-for-ambient-light-sensor">Ambient Light Sensor</a> has a <adata-link-type="dfn" href="https://w3c.github.io/sensors/#default-sensor" id="ref-for-default-sensor">default sensor</a>,
1658
1658
which is the device’s main light detector.</p>
1659
-
<p>The <adata-link-type="dfn" href="#ambient-light-sensor" id="ref-for-ambient-light-sensor①">Ambient Light Sensor</a> has an associated <adata-link-type="dfn" href="https://w3c.github.io/sensors#sensor-permission-names" id="ref-for-sensor-permission-names">sensor permission name</a> which is <aclass="idl-code" data-link-type="enum-value" href="https://w3c.github.io/permissions/#dom-permissionname-ambient-light-sensor" id="ref-for-dom-permissionname-ambient-light-sensor">"ambient-light-sensor"</a>.</p>
1659
+
<p>The <adata-link-type="dfn" href="#ambient-light-sensor" id="ref-for-ambient-light-sensor①">Ambient Light Sensor</a> has an associated <adata-link-type="dfn" href="https://w3c.github.io/sensors/#sensor-permission-names" id="ref-for-sensor-permission-names">sensor permission name</a> which is <aclass="idl-code" data-link-type="enum-value" href="https://w3c.github.io/permissions/#dom-permissionname-ambient-light-sensor" id="ref-for-dom-permissionname-ambient-light-sensor">"ambient-light-sensor"</a>.</p>
1660
1660
<p>The <dfnclass="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="current-light-level">current light level</dfn> or <dfndata-dfn-type="dfn" data-noexport="" id="illuminance">illuminance<aclass="self-link" href="#illuminance"></a></dfn> is a value that represents the ambient light level
1661
1661
around the hosting device. Its unit is the lux (lx) <adata-link-type="biblio" href="#biblio-si">[SI]</a>.</p>
1662
1662
<pclass="note" role="note"><span>Note:</span> The precise lux value reported by
<p>Let <var>allowed</var> be the result of invoking <adata-link-type="dfn" href="https://w3c.github.io/sensors#check-sensor-policy-controlled-features" id="ref-for-check-sensor-policy-controlled-features">check sensor policy-controlled features</a> with <codeclass="idl"><adata-link-type="idl" href="#ambientlightsensor" id="ref-for-ambientlightsensor④">AmbientLightSensor</a></code>.</p>
1688
+
<p>Let <var>allowed</var> be the result of invoking <adata-link-type="dfn" href="https://w3c.github.io/sensors/#check-sensor-policy-controlled-features" id="ref-for-check-sensor-policy-controlled-features">check sensor policy-controlled features</a> with <codeclass="idl"><adata-link-type="idl" href="#ambientlightsensor" id="ref-for-ambientlightsensor④">AmbientLightSensor</a></code>.</p>
<p>Let <var>ambient_light_sensor</var> be the new <codeclass="idl"><adata-link-type="idl" href="#ambientlightsensor" id="ref-for-ambientlightsensor⑤">AmbientLightSensor</a></code> object.</p>
1697
1697
<lidata-md="">
1698
-
<p>Invoke <adata-link-type="dfn" href="https://w3c.github.io/sensors#initialize-a-sensor-object" id="ref-for-initialize-a-sensor-object">initialize a sensor object</a> with <var>ambient_light_sensor</var> and <var>options</var>.</p>
1698
+
<p>Invoke <adata-link-type="dfn" href="https://w3c.github.io/sensors/#initialize-a-sensor-object" id="ref-for-initialize-a-sensor-object">initialize a sensor object</a> with <var>ambient_light_sensor</var> and <var>options</var>.</p>
0 commit comments