Closed Bug 1684002 Opened 3 years ago Closed 3 years ago

clickElement does not move pointer before clicking

Categories

(Remote Protocol :: Marionette, defect, P3)

Default
defect

Tracking

(firefox86 fixed)

RESOLVED FIXED
86 Branch
Tracking Status
firefox86 --- fixed

People

(Reporter: andrew, Assigned: andrew, Mentored)

References

(Blocks 1 open bug, )

Details

Attachments

(3 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36

Steps to reproduce:

Call the element/click endpoint

Minimal reproduction at https://github.com/andrewnicols/pointOnClick

Actual results:

The element is clicked

The mouse was not moved to the element

Expected results:

According to the W3C specification at https://w3c.github.io/webdriver/#element-click

Step 8 "Otherwise" states:

11: Dispatch a pointerMove action with arguments mouse’s input id, pointer move action, mouse’s input source state, and 0.
12: Dispatch a pointerDown action with arguments mouse’s input id, pointer down action, mouse’s input source state, and 0.
13: Dispatch a pointerUp action with arguments mouse’s input id, pointer up action, mouse’s input source state, and 0.

At present only steps 12, and 13 are completed.

Confirmed against default

Iteration: --- → 86.1 - Dec 14 - Dec 27
Version: Firefox 86 → Default

For W3C WebDriver Standards compliance the pointer should be moved to
the click target before the click occurs.

Assignee: nobody → andrew

Looks like the test file needs reformatting, but I'm not going to do so in this issue:

/Users/nicols/git/ext/gecko-dev/testing/marionette/harness/marionette_harness/tests/unit/test_click.py
  0   error  Reformat python  (black)

Thanks Andrew for filing this issue. The underlying reason here is that at some point the WebDriver spec has been changed and now refers to action primitives. And that hasn't yet been implemented in Marionette. See bug 1490268.

I'm happy to accept a patch that simply emits a mouseover event without implementing all the action primitive specific steps.

Mentor: hskupin
Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3
See Also: → 1490268

Thanks Henrik,

I did wonder whether we should be rewriting to ues the action primitives but I wasn't sure how best to achieve that.

Thanks

(In reply to Andrew Nicols from comment #6)

I did wonder whether we should be rewriting to ues the action primitives but I wasn't sure how best to achieve that.

No, we shouldn't at this point given that it is way more work. But we are able to easily synthesize a mousemove event. It would only have to be injected at the right position in webdriverClickElement().

Depends on D100381

Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2ab36b292611
[marionette] Synthesize a pointerMove action during elementClick r=marionette-reviewers,whimboo
https://hg.mozilla.org/integration/autoland/rev/84620cb6c5ac
[wdspec] Move filter_dict helper to shared helpers r=webdriver-reviewers,whimboo
https://hg.mozilla.org/integration/autoland/rev/a0d4d9981b93
[wdspec] Test mouse moves before click r=webdriver-reviewers,whimboo
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/27211 for changes under testing/web-platform/tests
Upstream PR was closed without merging

W3C specification states that the mouse should be moved before a click occurs, so this test should now be pass. I've updated D100381 to remove the expected failure state of this test as it is no longer accurate.

Flags: needinfo?(andrew)
Pushed by cmccormack@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1c8749bb95a4
[marionette] Synthesize a pointerMove action during elementClick r=marionette-reviewers,whimboo
https://hg.mozilla.org/integration/autoland/rev/2342b3670241
[wdspec] Move filter_dict helper to shared helpers r=webdriver-reviewers,whimboo
https://hg.mozilla.org/integration/autoland/rev/4996d0da4234
[wdspec] Test mouse moves before click r=webdriver-reviewers,whimboo
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch

Andrew, thanks a lot for fixing this bug!

Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: