commit | eca081525f043ca6e09a78f94fea5b74c8f43902 | [log] [tgz] |
---|---|---|
author | Emilio Cobos Álvarez <emilio@crisal.io> | Fri Mar 01 08:13:41 2024 |
committer | moz-wptsync-bot <wptsync@mozilla.com> | Fri Mar 01 18:58:55 2024 |
tree | d9dad19e815a93952d8723d14b1c4399083352fc | |
parent | ffae172a1c2e44bddf71ca9430bc2aa519fbff6e [diff] |
Workaround test_driver.actions not working with shadow DOM. This works around https://github.com/web-platform-tests/wpt/issues/41257 and enables the tests. Differential Revision: https://phabricator.services.mozilla.com/D203152 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1878104 gecko-commit: 343b540522ec81232a7eaa98161c1065d3391796 gecko-reviewers: dholbert
diff --git a/html/semantics/popovers/resources/popover-utils.js b/html/semantics/popovers/resources/popover-utils.js index bfc1f89..96ac7e0 100644 --- a/html/semantics/popovers/resources/popover-utils.js +++ b/html/semantics/popovers/resources/popover-utils.js
@@ -7,9 +7,13 @@ } async function clickOn(element) { - const actions = new test_driver.Actions(); await waitForRender(); - await actions.pointerMove(0, 0, {origin: element}) + let rect = element.getBoundingClientRect(); + let actions = new test_driver.Actions(); + // FIXME: Switch to pointerMove(0, 0, {origin: element}) once + // https://github.com/web-platform-tests/wpt/issues/41257 is fixed. + await actions + .pointerMove(Math.round(rect.x + rect.width / 2), Math.round(rect.y + rect.height / 2), {}) .pointerDown({button: actions.ButtonType.LEFT}) .pointerUp({button: actions.ButtonType.LEFT}) .send();