@@ -40,8 +40,9 @@ urlPrefix: https://html.spec.whatwg.org/multipage/; spec: HTML
40
40
text: task queue
41
41
text: spin the event loop; url: spin-the-event-loop
42
42
urlPrefix: interaction.html
43
+ text: DOM anchor; url: dom-anchor
43
44
text: gains focus; url: gains-focus
44
- text: currently focused area; url: currently-focused-area-of-a-top-level-browsing-context
45
+ text: currently focused area; url: currently-focused-area-of-a-top-level-traversable
45
46
urlPrefix: https://w3ctag.github.io/security-questionnaire/; spec: SECURITY-PRIVACY-QUESTIONNAIRE
46
47
type: dfn
47
48
text: same-origin policy violations; url: sop-violations
@@ -405,12 +406,11 @@ the given [=sensor type=]. See [[PERMISSIONS-POLICY]] for more details.
405
406
406
407
<h4 id="focused-area" oldids="losing-focus">Focused Area</h4>
407
408
408
- [=Sensor readings=] are only available for [=active documents=] whose
409
- origin is [=same origin-domain=] with the [=currently focused area=]
410
- document.
409
+ [=Sensor readings=] are only available for an [=navigable/active document=] if
410
+ the [=focus and origin check=] on it returns true.
411
411
412
412
This is done in order to mitigate the risk of a skimming attack against the
413
- [=browsing context =] containing an element which has [=gains focus|gained focus=] ,
413
+ [=/navigable =] containing an element which has [=gains focus|gained focus=] ,
414
414
for example when the user carries out an in-game purchase using a third party
415
415
payment service from within an iframe.
416
416
@@ -749,12 +749,11 @@ The [=reporting frequency=] differs from the {{Sensor}}'s {{Sensor/[[frequency]]
749
749
750
750
## Conditions to expose sensor readings ## {#concepts-can-expose-sensor-readings}
751
751
752
- The user agent <dfn>can expose sensor readings</dfn> to a given |document| if and only if
753
- all of the following are true:
752
+ The user agent <dfn>can expose sensor readings</dfn> to a {{Document}}
753
+ |document| if and only if all of the following are true:
754
754
- |document|'s [=relevant settings object=] is a [=secure context=] .
755
755
- |document|'s [=visibility state=] is "visible".
756
- - The [=currently focused area=] belongs to a document whose origin is [=same
757
- origin-domain=] with |document|'s origin.
756
+ - The [=focus and origin check=] on |document| returns true.
758
757
- <dfn export>Specific conditions</dfn> : [=Extension specifications=] may add new
759
758
conditions to this list to have stricter requirements for their sensor types.
760
759
@@ -814,7 +813,7 @@ the [=activated sensor objects=] [=ordered set|set=] between different
814
813
are [=same origin-domain=] .
815
814
816
815
Any time a new [=sensor reading=] for a [=platform sensor=] is obtained and if the user agent
817
- [=can expose sensor readings=] to the current [=browsing context =] 's [=active document=] ,
816
+ [=can expose sensor readings=] to the current [=/navigable =] 's [=navigable/ active document=] ,
818
817
the user agent invokes [=update latest reading=] with the [=platform sensor=] and
819
818
the [=sensor reading=] as arguments.
820
819
@@ -1565,6 +1564,23 @@ to {{SensorErrorEventInit}}.
1565
1564
1. Return "granted".
1566
1565
</div>
1567
1566
1567
+ <h3 dfn export>Focus and origin check</h3>
1568
+
1569
+ <div algorithm="focus and origin check">
1570
+
1571
+ : input
1572
+ :: |document|, a {{Document}} .
1573
+ : output
1574
+ :: A boolean.
1575
+
1576
+ 1. Let |origin| be |document|'s [=relevant settings object=]' s [=environment settings object/origin=] .
1577
+ 1. Let |focusedDocument| be |document|'s [=node navigable=]' s [=navigable/top-level traversable=] 's
1578
+ [=currently focused area=] 's [=DOM anchor=]' s [=node document=] .
1579
+ 1. Let |focusedOrigin| be |focusedDocument|'s [=relevant settings object=]' s [=environment settings
1580
+ object/origin=] .
1581
+ 1. Return true if |origin| and |focusedOrigin| are [=same origin-domain=] , and false otherwise.
1582
+ </div>
1583
+
1568
1584
<h2 id="automation">Automation</h2>
1569
1585
1570
1586
The Generic Sensor API and its [=extension specifications=] pose a challenge
0 commit comments