Skip to content

Commit

Permalink
Make moveToDocument move pointer to non-(0, 0) position first
Browse files Browse the repository at this point in the history
WebDriver spec defines that the pointer position should be initialized
to (0, 0) by default.  Therefore, a call of `pointerMove(0, 0)` at
first time may be no-op.  Therefore, pointer should be moved to
different point, (1, 1), first.  Then, moving to (0, 0) causes
`pointerover`, `mouseover`, etc as expected by some tests.

web-platform-tests/interop#601
  • Loading branch information
masayuki-nakano authored and sideshowbarker committed Nov 7, 2023
1 parent 9b17436 commit c570935
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pointerevents/pointerevent_support.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,10 @@ function moveToDocument(pointerType) {
var pointerId = pointerType + "Pointer1";
return new test_driver.Actions()
.addPointer(pointerId, pointerType)
// WebDriver initializes the pointer position (0, 0), therefore, we need
// to move different position first. Otherwise, moving to (0, 0) may be
// ignored.
.pointerMove(1, 1)
.pointerMove(0, 0)
.send();
}
Expand Down

0 comments on commit c570935

Please sign in to comment.