Bug 259028 - [user-activation] Fix html/user-activation/activation-trigger-pointerevent.html WPT
Summary: [user-activation] Fix html/user-activation/activation-trigger-pointerevent.ht...
Status: REOPENED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Abrar Rahman Protyasha
URL: https://wpt.fyi/results/html/user-act...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-07-09 01:36 PDT by Tim Nguyen (:ntim)
Modified: 2023-12-12 02:55 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Nguyen (:ntim) 2023-07-09 01:36:57 PDT
https://searchfox.org/wubkat/rev/2517a540e6f5a2037c6843102f3a9cb753f2f9f0/Source/WebCore/dom/UserGestureIndicator.cpp#133-138

The function call (`window->notifyActivated(currentToken()->startTime());`) should happen only for specific events:

An activation triggering input event is any event whose isTrusted attribute is true and whose type is one of:

"keydown", provided the key is neither the Esc key nor a shortcut key reserved by the user agent.
"mousedown".
"pointerdown", provided the event's pointerType is "mouse".
"pointerup", provided the event's pointerType is not "mouse".
"touchend".

Here's where we currently trigger it (see EventHandler.cpp notably): https://searchfox.org/wubkat/search?q=symbol:_ZN7WebCore20UserGestureIndicatorC1ESt8optionalINS_26ProcessingUserGestureStateEEPNS_8DocumentENS_15UserGestureTypeENS0_23ProcessInteractionStyleES1_IN3WTF4UUIDEE&redirect=false

We don't seem to currently trigger it from pointer events.
Comment 1 Radar WebKit Bug Importer 2023-07-09 01:37:06 PDT
<rdar://problem/111970701>
Comment 2 Tim Nguyen (:ntim) 2023-07-09 01:37:29 PDT
The spec for this is at: https://html.spec.whatwg.org/multipage/interaction.html#user-activation-processing-model
Comment 4 Abrar Rahman Protyasha 2023-09-22 00:09:16 PDT
Pull request: https://github.com/WebKit/WebKit/pull/18067
Comment 5 EWS 2023-09-22 10:36:06 PDT
Committed 268320@main (df336e8effd7): <https://commits.webkit.org/268320@main>

Reviewed commits have been landed. Closing PR #18067 and removing active labels.
Comment 6 Tim Nguyen (:ntim) 2023-11-30 14:53:30 PST
This was reverted
Comment 7 Abrar Rahman Protyasha 2023-11-30 14:54:23 PST
Thanks for flipping the bits, Tim. I'll address re-landing soon!
Comment 8 Abrar Rahman Protyasha 2023-12-12 02:49:09 PST
Pull request: https://github.com/WebKit/WebKit/pull/21668
Comment 9 Abrar Rahman Protyasha 2023-12-12 02:55:38 PST
The original fix to address this bug was reverted because it introduced the regression in bug 263887.

The PR posted just now attempts to do things "the right way" by imbibing certain web automation script to execute with user activation and not have a blanket "make all web automation script blessed with user activation" policy.