Open saschanaz opened 3 years ago
cc @LanWei22
.pointerMove
is part of the testdriver-actions.js
helper library I think - is this difference coming from that wrapper, or is there an actual different in the testdriver.js
or webdriver
layers?
There are various tests in webdriver/
that call pointer_move
, do we know if any of them have differing results on Chrome/Firefox that show this off?
The WebDriver spec is the authority here: https://w3c.github.io/webdriver/#pointer-actions
When required to dispatch a pointerMove action
[...]
An object that represents a web element
Let element be equal to the result of trying to get a known connected element with argument origin.
Let x element and y element be the result of calculating the in-view center point of element.
Let x equal x element + x offset, and y equal y element + y offset.
So I'm pretty sure Gecko's behaviour is correct unless there's some weirdness with the element not being in view.
At a stab, https://wpt.fyi/results/webdriver/tests/perform_actions/pointer_origin.py?label=experimental&label=master&aligned would probably be the right test if a test existed, and its 10/10 in Chrome and Firefox.
@saschanaz - can you explain what you've seen in terms of 'Blink seems to do it differently' ?
Given this DOM tree:
<div class="test">
<span id="foo">foo</span><br>
<input id="input"><br>
<span id="bar">bar</span>
</div>
and this script:
await new test_driver.Actions()
.pointerMove(0, 0, {origin: foo})
.pointerDown()
.pointerMove(0, 0, {origin: input})
.pointerMove(0, 0, {origin: bar})
.pointerUp()
.send();
I see Gecko moves from the center of the foo
to the center of the bar
(as expected) but Chrome moves from the start of the foo
to somewhere beyond bar
.
I may be holding it wrong, but I don't visually see a difference for me (Linux, Chrome 88.0.4292.2 dev and Firefox 84.0a1):
$ cat css/test.html
<!doctype HTML>
<meta charset="utf8">
<title>My Test</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<div class="test">
<span id="foo">foo</span><br>
<input id="input"><br>
<span id="bar">bar</span>
</div>
<script>
promise_test(async t => {
await new test_driver.Actions()
.pointerMove(0, 0, {origin: foo})
.pointerDown()
.pointerMove(0, 0, {origin: input})
.pointerMove(0, 0, {origin: bar})
.pointerUp()
.send();
}, "My test");
</script>
./wpt run --log-mach=- --channel=dev chrome css/test.html
./wpt run --log-mach=- --no-headless --channel=nightly --binary=$HOME/firefox-nightly/firefox firefox css/test.html
That's weird, could it be Windows-only thing? 🤔
I just uploaded the full patch so you can access it here: https://hg.mozilla.org/try/rev/1bbb16e55d5e8b65b74767c885b140941a274827 (should be visible soon)
Assuming https://github.com/web-platform-tests/wpt/pull/26278 is the patch, it looks like it passed 22/22 on Chrome + Safari? Can this issue be closed then?
It still fails hard on my Windows machine, using Chrome 88.0.4302.0 dev channel.
Which suggests this is a Windows-specific Chrome bug. Could someone from Google confirm this?
Anyhow, I think we should still specify it, at least a link to webdriver spec.
Which suggests this is a Windows-specific Chrome bug. Could someone from Google confirm this?
I am unable to reproduce on Windows, using Chrome Dev 88.0.4315.5 :(. html/semantics/forms/the-input-element/selection-pointer.html
passes all subtests.
Anyhow, I think we should still specify it, at least a link to webdriver spec.
Seems reasonable, happy to review a doc PR to wherever seems reasonable (code comment, or https://web-platform-tests.org/writing-tests/testdriver.html ?)
Gecko interprets the zero coordination as the center of the
foo
element while Blink seems to do it differently.This difference has been quite painful to me, so it would be great if we document this. Currently testdriver.md does not say anything about it.