Bug 1826208 [wpt PR 39347] - Event Timing flush pointerdown & keydown on contextmenu...
commiteb9b2a41f653bc86ed7063004b59a74b5e7db4da
authorBlink WPT Bot <blink-w3c-test-autoroller@chromium.org>
Mon, 27 Nov 2023 17:36:48 +0000 (27 17:36 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Wed, 29 Nov 2023 09:18:06 +0000 (29 09:18 +0000)
treea3d57c90234a5cf50695c63bf209bcb9f3441683
parentc93e121269e8a96244c814f87b15457bcbc6332d
Bug 1826208 [wpt PR 39347] - Event Timing flush pointerdown & keydown on contextmenu, a=testonly

Automatic update from web-platform-tests
Event Timing flush pointerdown & keydown on contextmenu (#39347)

* Previous undesired outcome: When right click brings up contextmenu,
the pointerdown or keydown entry is missing the first time you do so.
* Root cause: Pointerdown or keydown entries are deferred notifying PO
until pointercancel/pointerup or keyup. When pointerdown is only
followed by a contextmenu, the pointerdown/keydown entry would get stuck
in the map. The stuck entry can only be rescued when a new pointerdown
comes in to substitute it out. This explains why only the first
pointerdown was missing. It also explains why all subsequent right
clicks were printing pointerdowns, but are actually the incorrect
previous ones stuck in the map.
* This CL address it by: starting a timer to flush all pointerdown,
pointerup, and keydown entries upon contextmenu. We do a timer because
there exist cases where we do see a pointerup following the contextmenu
right after, in that case we would stop the timer and match pointerdown
pointerup with the same interactionId as usual.

Bug: 14130961428603
Change-Id: I03e9cdbe57c146fe61e6758b39249048aa982897
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4288967
Reviewed-by: Michal Mocny <mmocny@chromium.org>
Commit-Queue: Aoyuan Zuo <zuoaoyuan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1228546}

Co-authored-by: Aoyuan Zuo <zuoaoyuan@chromium.org>
--

wpt-commits: 6fd5c632669a5edab2676565976559dd6b2e284d
wpt-pr: 39347
testing/web-platform/tests/event-timing/event-click-visibilitychange.html
testing/web-platform/tests/event-timing/interactionid-aux-pointerdown-and-pointerdown.html [new file with mode: 0644]
testing/web-platform/tests/event-timing/interactionid-aux-pointerdown.html [new file with mode: 0644]
testing/web-platform/tests/event-timing/interactionid-auxclick.html [new file with mode: 0644]
testing/web-platform/tests/event-timing/resources/event-timing-test-utils.js