From bdd33701dba9ef924795aba17468014db9d1a835 Mon Sep 17 00:00:00 2001 From: Botond Ballo Date: Mon, 23 Mar 2020 22:21:46 +0000 Subject: [PATCH] Bug 1623476 - Fix event targeting in a click_events_on_input.html. r=jgraham Presumably, the intention of the test is to hit the middle of the target. To this end, the test specifies an offset of half the target's dimensions relative to the origin of the target. However, when pointerMove() is given an element as origin, it already uses the element's center as the origin point, so we end up actually targeting the bottom right pixel which is prone to rounding issues. Differential Revision: https://phabricator.services.mozilla.com/D67518 --HG-- extra : moz-landing-system : lando --- .../tests/uievents/click/click_events_on_input.html | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/testing/web-platform/tests/uievents/click/click_events_on_input.html b/testing/web-platform/tests/uievents/click/click_events_on_input.html index 731d13934f0d..2f380eb4514b 100644 --- a/testing/web-platform/tests/uievents/click/click_events_on_input.html +++ b/testing/web-platform/tests/uievents/click/click_events_on_input.html @@ -37,10 +37,7 @@ // Inject mouse click events. var actions = new test_driver.Actions(); document.getElementById("other").focus(); - var bounds = target.getBoundingClientRect(); - actions.pointerMove(Math.floor(bounds.width / 5), - Math.floor(bounds.height / 2), - {origin: target}) + actions.pointerMove(0, 0, {origin: target}) .pointerDown({button: mouseButton}) .pointerUp({button: mouseButton}) .send()