Skip to content

Commit 5f78434

Browse files
author
Raphael Kubo da Costa
committed
Use "local camera source" instead of "local video source".
This avoids ambiguity, including the fact that a screen capture session could qualify as a "local video source". We really want to tie this API's permission model to the presence of an active camera specifically.
1 parent 084c6b9 commit 5f78434

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

index.bs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ To mitigate these threats specific to Ambient Light Sensor, user agents must:
207207
- [=Reduce accuracy=] of sensor readings. See [[#reduce-sensor-accuracy]].
208208
- Obtain user consent before providing sensor readings. This is done by
209209
integrating with the [[MEDIACAPTURE-STREAMS]] specification. See
210-
[[#local-video-source-requirement]].
210+
[[#local-camera-source-requirement]].
211211

212212
User agents may also <a>limit maximum sampling frequency</a>.
213213

@@ -253,7 +253,7 @@ experience. <a href="https://crbug.com/1332536">Chromium bug 1332536</a> and <a
253253
href="https://crrev.com/c/3666917">Chromium review 3666917</a> contain more
254254
information about this.
255255

256-
Active local video source requirement {#local-video-source-requirement}
256+
Active local camera source requirement {#local-camera-source-requirement}
257257
-----
258258

259259
Many of the attacks on Ambient Light sensors referenced above rely on being
@@ -268,16 +268,16 @@ grant or deny access to it.
268268

269269
What this specification does instead is consider an Ambient Light Sensor to be
270270
a 1x1 grayscale camera, integrate with the [[MEDIACAPTURE-STREAMS]]
271-
specification and require there to be at least one local video [=source=] that
271+
specification and require there to be at least one local camera [=source=] that
272272
is not [=muted=] or [=stopped=] in order for illuminance readouts to be
273273
provided. In other words, an Ambient Light Sensor only provides readings if a
274-
local video source (such as a camera) is currently active and being used in the
275-
same window as the {{AmbientLightSensor}} instance.
274+
local video camera is currently active and being used in the same window as the
275+
{{AmbientLightSensor}} instance.
276276

277277
Per the [[MEDIACAPTURE-STREAMS]] specification, this is only possible if script
278278
has called {{MediaDevices/getUserMedia()}} and granted the <a
279279
permission>"camera"</a> permission. This also means the User Agent has at least
280-
indicated to the user that a local video source has started being used as per
280+
indicated to the user that a local camera source has started being used as per
281281
[[MEDIACAPTURE-STREAMS#privacy-indicator-requirements]].
282282

283283
The goal of this model is to treat an Ambient Light Sensor as potentially as
@@ -298,7 +298,7 @@ which is the device's main light detector.
298298
The <a>Ambient Light Sensor</a>'s [=sensor permission names=] is an
299299
[=set/empty=] [=ordered set|set=].
300300

301-
Note: See [[#local-video-source-requirement]]. This specification relies on the
301+
Note: See [[#local-camera-source-requirement]]. This specification relies on the
302302
permission model specified in the [[MEDIACAPTURE-STREAMS]] specification
303303
instead.
304304

@@ -350,9 +350,9 @@ The {{AmbientLightSensor/illuminance}} getter steps are:
350350

351351
### Media Capture and Streams integration ### {#media-capture-and-streams-integration}
352352

353-
As discussed in [[#local-video-source-requirement]], illuminance readouts are
353+
As discussed in [[#local-camera-source-requirement]], illuminance readouts are
354354
provided only if the same {{Window}} with an {{AmbientLightSensor}} object has
355-
at least one local video [=source=] that is not [=muted=] or [=stopped=].
355+
at least one local camera [=source=] that is not [=muted=] or [=stopped=].
356356

357357
The [=ambient light pre-activation checks algorithm=] is invoked by
358358
{{Sensor/start()}} as specified in [[GENERIC-SENSOR]].
@@ -364,7 +364,7 @@ run the following steps:
364364
<div algorithm="deactivate sensors if necessary">
365365
1. Let |global| be the {{Window}} object of the affected \[[devicesLiveMap]]
366366
internal slot.
367-
1. Let |result| be the result of invoking [=check for active local video sources=] with |global|.
367+
1. Let |result| be the result of invoking [=check for active local camera sources=] with |global|.
368368
1. If |result| is true, return.
369369
1. For each {{AmbientLightSensor}} object |sensor| whose [=relevant global
370370
object=] is |global|:
@@ -455,23 +455,23 @@ quantization algorithm=]:
455455
The [=Ambient Light Sensor=] [=sensor type=] defines the following
456456
[=pre-activation checks algorithm=]:
457457

458-
<div algorithm="check active local video source">
458+
<div algorithm="check active local camera source">
459459
: input
460460
:: |sensor|, an {{AmbientLightSensor}} object
461461
: output
462462
:: A [=boolean=] indicating whether the checks have passed and sensor activation may proceed.
463463

464464
1. Let |global| be |sensor|'s [=relevant global object=].
465-
1. Return the result of invoking [=check for active local video sources=] with |global|.
465+
1. Return the result of invoking [=check for active local camera sources=] with |global|.
466466
</div>
467467

468-
<h3 dfn>Check for active local video source</h3>
468+
<h3 dfn>Check for active local camera source</h3>
469469

470-
<div algorithm="check for active local video sources">
470+
<div algorithm="check for active local camera sources">
471471
: input
472472
:: |global|, an {{Window}} object
473473
: output
474-
:: A [=boolean=] indicating whether there are active local video sources.
474+
:: A [=boolean=] indicating whether there are active local camera sources.
475475

476476
1. If |global| does not have a \[[mediaStreamTrackSources]] internal slot, return false.
477477
1. For each |source| in |global|'s \[[mediaStreamTrackSources]] internal slot:

0 commit comments

Comments
 (0)