Bug 235672

Summary: avoid setting and clearing :active state when dispatching synthetic click events when possible
Product: WebKit Reporter: Cameron McCormack (:heycam) <heycam>
Component: DOMAssignee: Cameron McCormack (:heycam) <heycam>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, esprehn+autocc, ews-watchlist, kangil.han, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Cameron McCormack (:heycam) 2022-01-26 13:57:09 PST
Simulated click events are dispatched with two options:

* whether to send associated events mouseover, mouseup, mousedown
* whether to repaint the target element with its pressed look

We currently always set the element's :active state just after when we'd send the mousedown event, and clear it just after that.

When we dispatch a simulated click event with neither of the above options set, there's no way to observe the temporary :active state on the element.  We can skip it in that case.

Forthcoming is a 0.3-0.4% improvement on Speedometer 2.
Comment 1 Cameron McCormack (:heycam) 2022-01-26 14:01:40 PST
Created attachment 450067 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2022-01-26 14:20:49 PST
<rdar://problem/88095418>
Comment 3 Cameron McCormack (:heycam) 2022-01-26 17:33:40 PST
Created attachment 450091 [details]
Patch
Comment 4 EWS 2022-01-27 00:49:29 PST
Committed r288669 (246475@main): <https://commits.webkit.org/246475@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 450091 [details].