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
@@ -959,6 +962,35 @@ and it cannot be scrolled at the same time.
959
962
</div>
960
963
</div>
961
964
965
+
<h2 id=policy-feature>
966
+
The <a>navigation-override</a> [=policy-controlled feature=]</h2>
967
+
968
+
The <dfn>navigation-override</dfn>[=policy-controlled feature=] controls
969
+
the availability of mechanisms that enables page authors
970
+
to take control over the behavior of spatial navigation,
971
+
or to cancel it outright.
972
+
973
+
* The feature name is "<code>navigation-override</code>"
974
+
* The [=default allowlist=] for <a>navigation-override</a> is "<code>self</code>"
975
+
976
+
As defined in further details in [[#nav]],
977
+
if <a>navigation-override</a> is disabled in a document,
978
+
the navigation events (see [[#events-navigationevent]]) will not be fired.
979
+
980
+
Note: This is to prevent a hostile iframe from using these events
981
+
in order to highjack the focus.
982
+
We recognize that there exists other mechanisms predating spatial navigation
983
+
that malicious authors could use
984
+
to interfere with the user's ability to control where the focus goes.
985
+
Despite that, it seems worthwile to attempt not to increase this attack surface,
986
+
although it is possible that such attacks are already sufficiently easy to perform
987
+
that this is a lost cause.
988
+
Further feedback on this topic,
989
+
based on experience with implementation or with mitigating such attacks,
990
+
is very welcome.
991
+
992
+
993
+
962
994
<h2 id=processing-model>
963
995
Processing Model</h2>
964
996
@@ -1044,13 +1076,15 @@ To run the <dfn>spatial navigation steps</dfn> in <var>direction</var>, do the f
1044
1076
* If <var>candidates</var> contains at least 1 item:
1045
1077
1. Let <var>bestCandidate</var> be the result of <a>selecting the best candidate</a>
1046
1078
within <var>candidates</var> in <var>direction</var> starting from <var>searchOrigin</var>
1047
-
2. <span class=api><a>Fire an event</a> named <a event>navbeforefocus</a> at <var>eventTarget</var> using {{NavigationEvent}}
1079
+
2. If <a>navigation-override</a><a>is enabled</a> in the [=node document=] of <var>eventTarget</var> for the <a spec=html for="/">origin</a> of the [=active document=] of the [=top-level browsing context=], then
1080
+
<span class=api><a>fire an event</a> named <a event>navbeforefocus</a> at <var>eventTarget</var> using {{NavigationEvent}}
1048
1081
with its {{NavigationEvent/dir}} set to <var>direction</var> and {{NavigationEvent/relatedTarget}} set to <var>bestCandidate</var>
1049
1082
and with it's <code>bubbles</code> and <code>cancelable</code> attributes set to <code>true</code>,
1050
1083
and return if the result is <code>false</code></span>
1051
1084
3. Run the <a>focusing steps</a> for <var>bestCandidate</var> and return
1052
1085
* Else if <var>eventTarget</var><a>can be manually scrolled</a>:
1053
-
1. <span class=api><a>Fire an event</a> named <a event>navbeforescroll</a> at <var>eventTarget</var> using {{NavigationEvent}}
1086
+
1. If <a>navigation-override</a><a>is enabled</a> in the [=node document=] of <var>eventTarget</var> for the <a spec=html for="/">origin</a> of the [=active document=] of the [=top-level browsing context=], then
1087
+
<span class=api><a>fire an event</a> named <a event>navbeforescroll</a> at <var>eventTarget</var> using {{NavigationEvent}}
1054
1088
with its {{NavigationEvent/dir}} set to <var>direction</var>
1055
1089
and {{NavigationEvent/relatedTarget}} set to <var>eventTarget</var>
1056
1090
and with it's <code>bubbles</code> and <code>cancelable</code> attributes set to <code>true</code>,
@@ -1062,14 +1096,16 @@ To run the <dfn>spatial navigation steps</dfn> in <var>direction</var>, do the f
1062
1096
within <var>container</var>, excluding <var>searchOrigin</var>
1063
1097
8. If <var>candidates</var> is empty:
1064
1098
* If <var>container</var> is a <a>scroll container</a> that <a>can be manually scrolled</a>:
1065
-
1. <span class=api><a>Fire an event</a> named <a event>navbeforescroll</a> at <var>eventTarget</var> using {{NavigationEvent}}
1099
+
1. If <a>navigation-override</a><a>is enabled</a> in the [=node document=] of <var>eventTarget</var> for the <a spec=html for="/">origin</a> of the [=active document=] of the [=top-level browsing context=], then
1100
+
<span class=api><a>fire an event</a> named <a event>navbeforescroll</a> at <var>eventTarget</var> using {{NavigationEvent}}
1066
1101
with its {{NavigationEvent/dir}} set to <var>direction</var>
1067
1102
and {{NavigationEvent/relatedTarget}} set to <var>container</var>
1068
1103
and with it's <code>bubbles</code> and <code>cancelable</code> attributes set to <code>true</code>,
1069
1104
and return if the result is <code>false</code></span>
1070
1105
2. <a>Directionally scroll the element</a><var>container</var> in <var>direction</var> and return.
1071
1106
* Else,
1072
-
1. <span class=api><a>Fire an event</a> named <a event>navnotarget</a> at <var>eventTarget</var> using {{NavigationEvent}}
1107
+
1. If <a>navigation-override</a><a>is enabled</a> in the [=node document=] of <var>eventTarget</var> for the <a spec=html for="/">origin</a> of the [=active document=] of the [=top-level browsing context=], then
1108
+
<span class=api><a>fire an event</a> named <a event>navnotarget</a> at <var>eventTarget</var> using {{NavigationEvent}}
1073
1109
with its {{NavigationEvent/dir}} set to <var>direction</var> and {{NavigationEvent/relatedTarget}} set to <var>container</var>
1074
1110
and with it's <code>bubbles</code> and <code>cancelable</code> attributes set to <code>true</code>,
1075
1111
and return if the result is <code>false</code>.</span>
@@ -1088,7 +1124,8 @@ To run the <dfn>spatial navigation steps</dfn> in <var>direction</var>, do the f
1088
1124
and return to the step labeled <i>loop</i>.
1089
1125
9. Let <var>bestCandidate</var> be the result of <a>selecting the best candidate</a>
1090
1126
within <var>candidates</var> in <var>direction</var> starting from <var>searchOrigin</var>
1091
-
10. <span class=api><a>Fire an event</a> named <a event>navbeforefocus</a> at <var>eventTarget</var> using {{NavigationEvent}}
1127
+
10. If <a>navigation-override</a><a>is enabled</a> in the [=node document=] of <var>eventTarget</var> for the <a spec=html for="/">origin</a> of the [=active document=] of the [=top-level browsing context=], then
1128
+
<span class=api><a>fire an event</a> named <a event>navbeforefocus</a> at <var>eventTarget</var> using {{NavigationEvent}}
1092
1129
with its {{NavigationEvent/dir}} set to <var>direction</var> and {{NavigationEvent/relatedTarget}} set to <var>bestCandidate</var>
1093
1130
and with it's <code>bubbles</code> and <code>cancelable</code> attributes set to <code>true</code>,
1094
1131
and return if the result is <code>false</code></span>
@@ -1398,6 +1435,93 @@ To <dfn lt="directionally scroll an element | directionally scroll the element">
1398
1435
1399
1436
</div>
1400
1437
1438
+
<h2 class=no-num id=privsec>
1439
+
Appendix B. Privacy and Security Considerations</h2>
1440
+
1441
+
The specification contributors believe that
1442
+
all known potential security risks associated with this specification
1443
+
have been adequately addressed.
1444
+
Further details are provided below.
1445
+
1446
+
The TAG has developed a self-review questionaire
1447
+
to help editors and Working Groups evaluate the risks introduced by their specifications.
1448
+
Answers are provided below.
1449
+
1450
+
<dl>
1451
+
<dt>Does this specification deal with personally-identifiable information?
1452
+
<dd>No.
1453
+
1454
+
<dt>Does this specification deal with high-value data?
1455
+
<dd>No.
1456
+
1457
+
<dt>Does this specification introduce new state for an origin that persists across browsing sessions?
1458
+
<dd>No.
1459
+
1460
+
<dt>Does this specification expose persistent, cross-origin state to the web?
1461
+
<dd>No.
1462
+
1463
+
<dt>Does this specification expose any other data to an origin that it doesn’t currently have access to?
1464
+
<dd>
1465
+
Mostly, no.
1466
+
1467
+
The one exception identified would be in the following scenario:
1468
+
if the author uses `window.navigate` while the focus is in a cross origin iframe,
1469
+
if they don't get an event at all it means that either there was something scrollable or focusable within the iframe,
1470
+
as the only case where they'd get an event is when the search didn't find anything at all goes up the tree.
1471
+
1472
+
This is so limited information that it does not seem it would introduces real a security risk,
1473
+
but it is as far as the editors can tell information that the author could not get could not get otherwise.
1474
+
1475
+
<dt>Does this specification enable new script execution/loading mechanisms?
1476
+
<dd>No.
1477
+
1478
+
<dt>Does this specification allow an origin access to a user’s location?
1479
+
<dd>No.
1480
+
1481
+
<dt>Does this specification allow an origin access to sensors on a user’s device?
1482
+
<dd>No.
1483
+
1484
+
<dt>Does this specification allow an origin access to aspects of a user’s local computing environment?
1485
+
<dd>No.
1486
+
1487
+
<dt>Does this specification allow an origin access to other devices?
1488
+
<dd>No.
1489
+
1490
+
<dt>Does this specification allow an origin some measure of control over a user agent’s native UI?
1491
+
<dd>
1492
+
No control is given over the appearance of the User Agent's UI.
1493
+
Some control is given over how the User Agent performs spatial navigation,
1494
+
which may be considered part of its user interface.
1495
+
This is intentional, to let authors tailor the behavior of spatial navigation to their pages.
1496
+
To prevent malicious authors to interefere with the users' desire to control focus and navigate the document,
1497
+
this overriding mechanism is disabled by default for cross-origin iframes.
1498
+
See [[#policy-feature]].
1499
+
1500
+
<dt>Does this specification expose temporary identifiers to the web?
1501
+
<dd>No.
1502
+
1503
+
<dt>Does this specification distinguish between behavior in first-party and third-party contexts?
1504
+
<dd>No.
1505
+
1506
+
<dt>How should this specification work in the context of a user agent’s "incognito" mode?
1507
+
<dd>No Difference is expected.
1508
+
1509
+
<dt>Does this specification persist data to a user’s local device?<Paste>
1510
+
<dd>No.
1511
+
1512
+
<dt>Does this specification have a "Security Considerations" and "Privacy Considerations" section?
1513
+
<dd>Yes, this is the section you are reading now.
1514
+
1515
+
<dt>Does this specification allow downgrading default security characteristics?
1516
+
<dd>
1517
+
It does not allow downgrading any unrelated security mechanism.
1518
+
1519
+
It **does** allow authors to opt into allowing
1520
+
the events needed to override the default behavior of spatial navigation
0 commit comments