tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 1f1aeaffd48f4ca340c3a43f27116e246e446612
parent ea34326146a4dcd27022637baecfe3904b464d86
Author: Sam Sneddon <gsnedders@apple.com>
Date:   Fri, 31 Oct 2025 08:54:18 +0000

Bug 1996236 [wpt PR 55629] - Add cleanup so that lone pointerdown events do get a pointerup, a=testonly

Automatic update from web-platform-tests
Add cleanup so that lone pointerdown events do get a pointerup

This is a workaround for
https://bugs.webkit.org/show_bug.cgi?id=213060, a long-standing WebKit
bug affecting the WebDriver Release Actions command.

--

wpt-commits: ac1d3f13bec63ee791d98305104c317e15488479
wpt-pr: 55629

Diffstat:
Mtesting/web-platform/tests/event-timing/interactionid-aux-pointerdown-and-pointerdown.html | 4++++
Mtesting/web-platform/tests/event-timing/interactionid-aux-pointerdown.html | 4++++
Mtesting/web-platform/tests/event-timing/resources/event-timing-test-utils.js | 14++++++++++++++
3 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/testing/web-platform/tests/event-timing/interactionid-aux-pointerdown-and-pointerdown.html b/testing/web-platform/tests/event-timing/interactionid-aux-pointerdown-and-pointerdown.html @@ -21,6 +21,10 @@ // pointerdown entry with a valid/non-trivial interactionId. promise_test(async t => { assert_implements(window.PerformanceEventTiming, 'Event Timing is not supported.'); + // Workaround https://bugs.webkit.org/show_bug.cgi?id=213060, which causes + // WebKit-based browsers to never release the pointerdown, breaking + // subsequent tests. + t.add_cleanup(() => orphanAuxPointerup(document.getElementById('target')).catch(() => {})); // This test is not applicable to platforms like Windows where contextmenu // is triggered on aux pointerup. So we do a platform behavior test first to // distinguish and skip those platforms who do not dispatch contextmenu on diff --git a/testing/web-platform/tests/event-timing/interactionid-aux-pointerdown.html b/testing/web-platform/tests/event-timing/interactionid-aux-pointerdown.html @@ -21,6 +21,10 @@ // pointerdown entry with a valid/non-trivial interactionId. promise_test(async t => { assert_implements(window.PerformanceEventTiming, 'Event Timing is not supported.'); + // Workaround https://bugs.webkit.org/show_bug.cgi?id=213060, which causes + // WebKit-based browsers to never release the pointerdown, breaking + // subsequent tests. + t.add_cleanup(() => orphanAuxPointerup(document.getElementById('target')).catch(() => {})); // This test is not applicable to platforms like Windows where contextmenu // is triggered on aux pointerup. So we do a platform behavior test first to // distinguish and skip those platforms who do not dispatch contextmenu on diff --git a/testing/web-platform/tests/event-timing/resources/event-timing-test-utils.js b/testing/web-platform/tests/event-timing/resources/event-timing-test-utils.js @@ -381,6 +381,20 @@ async function auxPointerdown(target) { .send(); } +async function orphanAuxPointerup(target) { + const actions = new test_driver.Actions(); + await actions.addPointer("mousePointer", "mouse") + .pointerMove(0, 0, { origin: target }) + .pointerUp({ button: actions.ButtonType.RIGHT }) + .send(); + + // Orphan pointerup doesn't get triggered in some browsers. Sending a + // non-pointer related event to make sure that at least an event gets handled. + // If a browsers sends an orphan pointerup, it will always be before the + // keydown, so the test will correctly handle it. + await pressKey(target, 'a'); +} + // The testdriver.js, testdriver-vendor.js need to be included to use this // function. async function pressKey(target, key) {