From ce00f26c3c55ad89cb488b380310a96c56eb04f2 Mon Sep 17 00:00:00 2001
From: Siye Liu <44512924+siliu1@users.noreply.github.com>
Date: Tue, 1 Oct 2024 10:54:20 -0700
Subject: [PATCH 01/11] Spec change for focus-without-user-activation
Cherry-picked from https://github.com/whatwg/html/pull/4585
---
source | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/source b/source
index 3299988e433..3e95a2cdfa0 100644
--- a/source
+++ b/source
@@ -4876,6 +4876,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
data-x="">cross-origin-isolated", which has a default allowlist of 'self'
.
+
focus-without-user-activation
", which has a default allowlist of *
.If current is null, then return.
If this algorithm is not triggered by user activation and
+ current's active document is not allowed to use the "focus-without-user-activation
" feature,
+ then return.
Run the focusing steps with current.
If current is a top-level traversable, user agents are encouraged @@ -80525,6 +80533,11 @@ dictionary ToggleEventInit : EventInit { method on elements, when invoked, must run the following steps:
If this algorithm is not triggered by user activation and the element's
+ node document is not allowed to use the "focus-without-user-activation
" feature,
+ then return.
If the element is marked as locked for focus, then return.
Mark the element as locked for focus.
If target's active sandboxing flag set has the sandboxed automatic features browsing context flag, then return.
If this algorithm is not triggered by user activation and the
+ target is not allowed to use the "focus-without-user-activation
" feature,
+ then return.
For each ancestorNavigable of
target's ancestor navigables: if ancestorNavigable's active document's
Date: Wed, 2 Oct 2024 14:08:03 -0700
Subject: [PATCH 02/11] change default allowlist of
`user-without-user-activation` to `self`.
---
source | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/source b/source
index 3e95a2cdfa0..4fa218bd37e 100644
--- a/source
+++ b/source
@@ -4877,8 +4877,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
data-x="concept-default-allowlist">default allowlist of 'self'
.
focus-without-user-activation
", which has a default allowlist of *
.`self`
.If current is null, then return.
If this algorithm is not triggered by user activation and +
If this algorithm is not triggered by user activation and is not
+ triggered by script execution from current's ancestor navigables, and
current's active document is not allowed to use the "focus-without-user-activation
" feature,
then return.
If this algorithm is not triggered by user activation and the element's +
If this algorithm is not triggered by user activation and is not
+ triggered by script execution from element's ancestor navigables, and the element's
node document is not allowed to use the "focus-without-user-activation
" feature,
then return.
If current is null, then return.
If this algorithm is not triggered by user activation and is not
+ If this algorithm is not triggered by user activation or is not
triggered by script execution from current's ancestor navigables, and
current's active document is not allowed to use the " If this algorithm is not triggered by user activation and is not
+ If this algorithm is not triggered by user activation or is not
triggered by script execution from element's ancestor navigables, and the element's
node document is not allowed to use the " If current is null, then return. If this algorithm is not triggered by user activation or is not
- triggered by script execution from current's ancestor navigables, and
- current's active document is not allowed to use the " If this algorithm is triggered without transient user
+ activation or is not triggered by script execution from current's
+ ancestor navigables, and current's active document is not
+ allowed to use the " Run the focusing steps with current. If this algorithm is not triggered by user activation or is not
- triggered by script execution from element's ancestor navigables, and the element's
- node document is not allowed to use the " If this algorithm is triggered without transient user
+ activation or is not triggered by script execution from element's ancestor
+ navigables, and the element's node document is not allowed to use
+ the " If the element is marked as locked for focus, then return. If target's active sandboxing flag set has the
sandboxed automatic features browsing context flag, then return. If this algorithm is not triggered by user activation and the
- target is not allowed to use the " If this algorithm is triggered without transient use
+ activation and the target is not allowed to use the " If current is null, then return. If this algorithm is triggered without transient user
- activation or is not triggered by script execution from current's
- ancestor navigables, and current's active document is not
- allowed to use the "focus-without-user-activation
" feature,
@@ -80535,7 +80535,7 @@ dictionary ToggleEventInit : EventInit {
method on elements, when invoked, must run the following steps:
-
focus-without-user-activation
" feature,
From 768a15b69c29943446579a1fd287e8ecf7fd5fac Mon Sep 17 00:00:00 2001
From: Siye Liu <44512924+siliu1@users.noreply.github.com>
Date: Thu, 3 Oct 2024 09:52:50 -0700
Subject: [PATCH 05/11] Add Siye Liu to the `Thanks to` list.
---
source | 1 +
1 file changed, 1 insertion(+)
diff --git a/source b/source
index 04db9e46c03..02bf3dd90a8 100644
--- a/source
+++ b/source
@@ -145054,6 +145054,7 @@ INSERT INTERFACES HERE
Yu Han,
Simon Spiegel,
Simon Wülker,
+ Siye Liu,
skeww,
Smylers,
Srirama Chandra Sekhar Mogali,
From 35661cf8bcde7660aff0b24077d3968e0bf85305 Mon Sep 17 00:00:00 2001
From: Siye Liu <44512924+siliu1@users.noreply.github.com>
Date: Mon, 7 Oct 2024 11:20:58 -0700
Subject: [PATCH 06/11] Attempt to fix build break.
---
source | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/source b/source
index 02bf3dd90a8..f2c79d44e18 100644
--- a/source
+++ b/source
@@ -80536,11 +80536,11 @@ dictionary ToggleEventInit : EventInit {
focus-without-user-activation
" feature,
- then return.
+ focus-without-user-activation
" feature, then return.
-
focus-without-user-activation
" feature,
- then return.focus-without-user-activation
"
+ feature, then return.focus-without-user-activation
" feature,
then return.
+ activation
focus-without-user-activation
" feature, then return.
Run the focusing steps with current.
If this algorithm is triggered without transient user
- activation or is not triggered by script execution from element's ancestor
+ activation and is not triggered by script execution from element's ancestor
navigables, and the element's node document is not allowed to use
the "focus-without-user-activation
"
feature, then return.
If this algorithm is triggered without transient use
+ activation and the target is not allowed to use the "focus-without-user-activation
" feature,
+ then return.
Let control be null.
If subject has the autofocus
@@ -85739,6 +85744,11 @@ dictionary DragEventInit : MouseEventInit {
element subject:
If this algorithm is triggered without transient use
+ activation and the target is not allowed to use the "focus-without-user-activation
" feature,
+ then return.
If subject is a dialog
element, then run the dialog focusing
steps given subject and return.
focus-without-user-activation
", which has a default allowlist of `self`
.If current is null, then return.
If this algorithm is triggered without transient user
- activation and is not triggered by script execution from current's
- ancestor navigables, and current's active document is not
- allowed to use the "
- focus-without-user-activation
" feature, then return.
+ focus-without-user-activation
" feature, then return.
Run the focusing steps with current.
If this algorithm is triggered without transient user
- activation and is not triggered by script execution from element's ancestor
- navigables, and the element's node document is not allowed to use
- the "focus-without-user-activation
"
- feature, then return.
focus-without-user-activation
"
+ feature, then return.
If the element is marked as locked for focus, then return.
If this algorithm is triggered without transient use
- activation and the target is not allowed to use the "focus-without-user-activation
" feature,
- then return.
focus-without-user-activation
" feature,
+ then return.
For each ancestorNavigable of
target's ancestor navigables: if ancestorNavigable's
Date: Thu, 19 Dec 2024 09:38:54 -0800
Subject: [PATCH 10/11] Address PR comments.
---
source | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/source b/source
index ff8f870c5c4..247f4d97619 100644
--- a/source
+++ b/source
@@ -61525,7 +61525,8 @@ interface HTMLDialogElement : HTMLElement {
If this algorithm is triggered without transient use
- activation and the target is not allowed to use the " If current is null, then return. If this algorithm is triggered without transient user
- activation and is not triggered by script execution from current's
- ancestor navigables, and current's active document is not
- allowed to use the "
in current's relevant global object and is not triggered
+ by invoking in current's relevant global object and current's
+ active document is not allowed to use the "
focus-without-user-activation
" feature,
then return.
+ activation
focus()
method on a child
+ of current's ancestor navigables' active document, and current's
+ active document is not allowed to use the "
focus-without-user-activation
" feature, then return.
Run the focusing steps with current.
If this algorithm is triggered without transient user
- activation and is not triggered by script execution from element's ancestor
- navigables, and the element's node document is not allowed to use
- the "focus-without-user-activation
"
- feature, then return.
focus()
method on a child
+ of current's ancestor navigables' active document, and the element's
+ node document is not allowed to use the "
+ focus-without-user-activation
" feature, then return.
If the element is marked as locked for focus, then return.
If this algorithm is triggered without transient use
- activation and the target is not allowed to use the "focus-without-user-activation
" feature,
- then return.
+ focus-without-user-activation
" feature, then return.
For each ancestorNavigable of
target's ancestor navigables: if ancestorNavigable's DragEventInit : MouseEventInit {
If this algorithm is triggered without transient use
- activation and the target is not allowed to use the "
in current's relevant global object and subject's
+ active document is not allowed to use the "
focus-without-user-activation
" feature,
then return.
If this algorithm is triggered without transient use - activation in current's relevant global object and current's +
If there is no transient user activation in
+ subject's relevant global object and subject's
active document is not allowed to use the "focus-without-user-activation
" feature,
then return.
If current is null, then return.
If this algorithm is triggered without transient user
- activation in current's relevant global object and is not triggered
- by invoking focus()
method on a child
+
If there is no transient user activation in
+ current's relevant global object and is not triggered by invoking
+ focus()
method on a child
of current's ancestor navigables' active document, and current's
active document is not allowed to use the "
focus-without-user-activation
" feature, then return.
If this algorithm is triggered without transient user
- activation in current's relevant global object and is not triggered
- by invoking focus()
method on a child
- of current's ancestor navigables' active document, and the element's
+
If there is no transient user activation in
+ the element's relevant global object and is not triggered by invoking
+ focus()
method on a child
+ of the element's ancestor navigables' active document, and the element's
node document is not allowed to use the "
focus-without-user-activation
" feature, then return.
If target's active sandboxing flag set has the sandboxed automatic features browsing context flag, then return.
If this algorithm is triggered without transient use - activation in current's relevant global object and target +
If there is no transient use activation in
+ target's relevant global object and target
is not allowed to use the "
focus-without-user-activation
" feature, then return.
If this algorithm is triggered without transient use - activation in current's relevant global object and subject's +
If there is no transient user activation in
+ subject's relevant global object and subject's
active document is not allowed to use the "focus-without-user-activation
" feature,
then return.