Bug 235672 - avoid setting and clearing :active state when dispatching synthetic click events when possible
Summary: avoid setting and clearing :active state when dispatching synthetic click eve...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Cameron McCormack (:heycam)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-01-26 13:57 PST by Cameron McCormack (:heycam)
Modified: 2022-01-27 00:49 PST (History)
6 users (show)

See Also:


Attachments
Patch (2.39 KB, patch)
2022-01-26 14:01 PST, Cameron McCormack (:heycam)
no flags Details | Formatted Diff | Diff
Patch (4.72 KB, patch)
2022-01-26 17:33 PST, Cameron McCormack (:heycam)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].