From d5f3e962836cc9ea2718eb5aad88d9c2dcbb9a1b Mon Sep 17 00:00:00 2001
From: David Bokan
> If a navigation originates from browser UI, it's always ok to allow it
@@ -1184,25 +1191,24 @@ and initialize a Document object steps by adding the following steps before
> text snippet.
>
-> Note: Depending on the UA, there can be cases where the
-> incumbentNavigationOrigin parameter is null but
-> it's not clear that the navigation is to be considered as
-> initiated from browser UI. E.g. an "open in new window" context
-> menu item when right clicking on a link. The intent in this item
-> is to distinguish cases where the app/page is able to set the URL
-> from those that are fully under the user's control. In the former
-> we want to prevent activation of the text fragment unless the
-> destination is loaded in a separate browsing context group (so that
-> the source cannot both control the text snippet and observe
-> side-effects in the navigation).
+> Note: The intent in this item is to distinguish cases where the
+> app/page is able to control the URL from those that are fully
+> under the user's control. In the former we want to prevent
+> scrolling of the text fragment unless the destination is loaded
+> in a separate browsing context group (so that the source cannot
+> both control the text snippet and observe side-effects in the
+> navigation). There are some cases where "browser UI" may be a
+> grey area in this regard. E.g. an "open in new window" context
+> menu item when right clicking on a link.
>
> See
> sec-fetch-site
-> in [[FETCH-METADATA]] for a more detailed discussion of how this applies.
+> in [[FETCH-METADATA]] for a related discussion of how this applies.
> Amend the definition of navigation params to include a new field: Monkeypatching [HTML]: Initialize user involvement value everywhere a navigation params is created, in particular,
+amend the definition of attempt to populate the history entry’s document to take a user navigation involvement as a parameter, using it to populate the field when creating
+a new navigation params. Amend the create
and initialize a Document object steps by adding the following steps before returning document: Monkeypatching [HTML]: Set document’s text directive user activation by following these sub-steps: Set document’s text directive user activation to true if any of the following
+conditions hold, false otherwise: Let is user activated be true if the current navigation was initiated from
- a window that had a transient activation at the time the
- navigation was initiated, or the UA has reason to believe it comes from a
- direct user gesture (e.g. user typed into the address bar). navigationParams’s user involvement is " If browsing context is a top-level browsing context and if either of is
- user activated or the text directive user activation of navigationParam’s request object is true, set the document’s text directive user activation to true. Otherwise, set it to false. navigationParams’s user involvement is " navigationParams’s request’s text directive user activation is true. Set document’s allow text fragment scroll by following these sub-steps:
+>
+>
+>
+> Initialize [=user involvement=] value everywhere a navigation params is created, in particular,
+> amend the definition of
+> attempt to populate the history entry's document
+> to take a user navigation involvement as a parameter, using it to populate the field when creating
+> a new navigation params.
+
Amend the create
and initialize a Document object steps by adding the following steps before returning |document|:
> Monkeypatching [[HTML]]:
>
-> 15. Set |document|'s [=document/text directive user activation=] by following these sub-steps:
-> 1. Let |is user activated| be true if the current navigation was initiated from
-> a window that had a transient activation at the time the
-> navigation was initiated, or the UA has reason to believe it comes from a
-> direct user gesture (e.g. user typed into the address bar).
-> activation
";
+> * |navigationParams|'s [=user involvement=] is "browser UI
"; or
+> * |navigationParams|'s
+> request's
+> [=request/text directive user activation=] is true.
+> browser UI
", set
+> [=document/allow text fragment scroll=] to true and abort these sub-steps.
> TODO: This should really only prevent potentially observable side-effects like
automatic scrolling. Unobservable effects like a highlight could be safely
allowed in all cases.
+
+
+
+
+
+
+
activation
";browser UI
"; or
@@ -1979,25 +1988,25 @@
text directive user activation and set document’s text directive user activation to false.
If the navigationParam’s request has a sec-fetch-site header and its value is "none"
set allow text fragment scroll to true and abort these sub-steps.
If the navigationParam’s user involvement is "browser UI
", set allow text fragment scroll to true and abort these sub-steps.
If a navigation originates from browser UI, it’s always ok to allow it since it’ll be user triggered and the page/script isn’t providing the text snippet.
-Note: Depending on the UA, there can be cases where the incumbentNavigationOrigin parameter is null but - it’s not clear that the navigation is to be considered as - initiated from browser UI. E.g. an "open in new window" context - menu item when right clicking on a link. The intent in this item - is to distinguish cases where the app/page is able to set the URL - from those that are fully under the user’s control. In the former - we want to prevent activation of the text fragment unless the - destination is loaded in a separate browsing context group (so that - the source cannot both control the text snippet and observe - side-effects in the navigation).
-See sec-fetch-site in [FETCH-METADATA] for a more detailed discussion of how this applies.
+Note: The intent in this item is to distinguish cases where the + app/page is able to control the URL from those that are fully + under the user’s control. In the former we want to prevent + scrolling of the text fragment unless the destination is loaded + in a separate browsing context group (so that the source cannot + both control the text snippet and observe side-effects in the + navigation). There are some cases where "browser UI" may be a + grey area in this regard. E.g. an "open in new window" context + menu item when right clicking on a link.
+See sec-fetch-site in [FETCH-METADATA] for a related discussion of how this applies.
If text directive user activation is false, set allow text fragment scroll to false and abort these sub-steps.
+If text directive user activation is false, or browsing context is + not a top-level browsing context, set allow text fragment scroll to false and abort these sub-steps.
If the navigationParam’s request has a sec-fetch-site header and its value is "same-origin"
set allow text fragment scroll to true and abort these
sub-steps.