Skip to content

Commit

Permalink
Implement User Activation API
Browse files Browse the repository at this point in the history
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: whatwg/html#9831

Co-authored-by: Tom Schuster <[email protected]>

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
  • Loading branch information
CanadaHonk authored and cookiecrook committed Oct 11, 2023
1 parent 37aeecf commit 55c382d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions html/user-activation/propagation-sameorigin.html
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 55c382d

Please sign in to comment.