Skip to content

Commit 022c90e

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 2ba647c commit 022c90e

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
@@ -246,7 +246,7 @@ To mitigate these threats specific to Ambient Light Sensor, user agents must:
246246
- [=Reduce accuracy=] of sensor readings. See [[#reduce-sensor-accuracy]].
247247
- Obtain user consent before providing sensor readings. This is done by
248248
integrating with the [[MEDIACAPTURE-STREAMS]] specification. See
249-
[[#local-video-source-requirement]].
249+
[[#local-camera-source-requirement]].
250250

251251
User agents may also <a>limit maximum sampling frequency</a>.
252252

@@ -292,7 +292,7 @@ experience. <a href="https://crbug.com/1332536">Chromium bug 1332536</a> and <a
292292
href="https://crrev.com/c/3666917">Chromium review 3666917</a> contain more
293293
information about this.
294294

295-
Active local video source requirement {#local-video-source-requirement}
295+
Active local camera source requirement {#local-camera-source-requirement}
296296
-----
297297

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

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

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

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

340-
Note: See [[#local-video-source-requirement]]. This specification relies on the
340+
Note: See [[#local-camera-source-requirement]]. This specification relies on the
341341
permission model specified in the [[MEDIACAPTURE-STREAMS]] specification
342342
instead.
343343

@@ -389,9 +389,9 @@ The {{AmbientLightSensor/illuminance}} getter steps are:
389389

390390
### Media Capture and Streams integration ### {#media-capture-and-streams-integration}
391391

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

396396
The [=ambient light pre-activation checks algorithm=] is invoked by
397397
{{Sensor/start()}} as specified in [[GENERIC-SENSOR]].
@@ -403,7 +403,7 @@ run the following steps:
403403
<div algorithm="deactivate sensors if necessary">
404404
1. Let |global| be the {{Window}} object of the affected \[[devicesLiveMap]]
405405
internal slot.
406-
1. Let |result| be the result of invoking [=check for active local video sources=] with |global|.
406+
1. Let |result| be the result of invoking [=check for active local camera sources=] with |global|.
407407
1. If |result| is true, return.
408408
1. For each {{AmbientLightSensor}} object |sensor| whose [=relevant global
409409
object=] is |global|:
@@ -494,23 +494,23 @@ quantization algorithm=]:
494494
The [=Ambient Light Sensor=] [=sensor type=] defines the following
495495
[=pre-activation checks algorithm=]:
496496

497-
<div algorithm="check active local video source">
497+
<div algorithm="check active local camera source">
498498
: input
499499
:: |sensor|, an {{AmbientLightSensor}} object
500500
: output
501501
:: A [=boolean=] indicating whether the checks have passed and sensor activation may proceed.
502502

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

507-
<h3 dfn>Check for active local video source</h3>
507+
<h3 dfn>Check for active local camera source</h3>
508508

509-
<div algorithm="check for active local video sources">
509+
<div algorithm="check for active local camera sources">
510510
: input
511511
:: |global|, an {{Window}} object
512512
: output
513-
:: A [=boolean=] indicating whether there are active local video sources.
513+
:: A [=boolean=] indicating whether there are active local camera sources.
514514

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

0 commit comments

Comments
 (0)