w3c / event-timing

A proposal for an Event Timing specification.
https://w3c.github.io/event-timing/
Other
44 stars 13 forks source link

Expose interactionId to keypress #134

Open zuoaoyuan opened 1 year ago

zuoaoyuan commented 1 year ago

Context:

Event timing has added interactionId attribute to all entries, but to most entry types, its value would be 0. Currently it's only exposed to [pointerdown, pointerup, click, keydown, keyup] with non-trivial values.

Issue:

Keypress is possible to have the longest duration among all the entries from the same interaction, but having an interactionId 0 makes it not being counted towards INP and makes INP not reflecting the real user experience. image

Proposed solution:

Event timing assign valid interactionId to keypress entry, and match it with the same interactionId of the keydown & keyup entries from the same interaction.