From 2e0191e26670ae082e509d11036cbeab38a39682 Mon Sep 17 00:00:00 2001 From: CanadaHonk Date: Sat, 7 Oct 2023 23:16:39 +0000 Subject: [PATCH] Implement User Activation API Rewrote internal user activation tree (spreading state to other elements) logic to match HTML spec: https://html.spec.whatwg.org/multipage/interaction.html#user-activation-processing-model Added navigator.userActivation API to expose internal user activation. Also fixed a WPT test to conform to spec (siblings are not activated), see also spec issue: https://github.com/whatwg/html/issues/9831 Co-authored-by: Tom Schuster Differential Revision: https://phabricator.services.mozilla.com/D185348 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1791079 gecko-commit: fba49989dde6aa32244c622fd43abe19a32128ae gecko-reviewers: dom-core, webidl, saschanaz, edgar --- html/user-activation/propagation-sameorigin.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/html/user-activation/propagation-sameorigin.html b/html/user-activation/propagation-sameorigin.html index 61debbf948a3ee..94d15c2d415e34 100644 --- a/html/user-activation/propagation-sameorigin.html +++ b/html/user-activation/propagation-sameorigin.html @@ -62,9 +62,11 @@ assert_false(msg.hasBeenActive); }, "Grandchild frame initial state"); } else if (msg.type == 'child-one-report') { + // Siblings (same or cross origin) should not be activated per spec + // Spec issue discussing: https://github.com/whatwg/html/issues/9831 test(() => { - assert_true(msg.isActive); - assert_true(msg.hasBeenActive); + assert_false(msg.isActive); + assert_false(msg.hasBeenActive); }, "Child1 frame final state"); } else if (msg.type == 'child-sameorigin-report') { // This msg was triggered by a user click.