Skip to content

Commit 7fd316e

Browse files
authored
Changed documentation of ‘org.openqa.selenium.interactions.Actions.moveToElement’ to better match the W3C spec (see: #4847 (comment)). (#8722) [skip ci]
1 parent 3a60290 commit 7fd316e

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

  • java/client/src/org/openqa/selenium/interactions

java/client/src/org/openqa/selenium/interactions/Actions.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -366,13 +366,12 @@ public Actions moveToElement(WebElement target) {
366366
}
367367

368368
/**
369-
* Moves the mouse to an offset from the center of the element.
370-
* The element is scrolled into view and its location is calculated using getClientRects.
369+
* Moves the mouse to an offset from the element's in-view center point.
371370
* @param target element to move to.
372-
* @param xOffset Offset from the center. A negative value means coordinates left from
373-
* the element.
374-
* @param yOffset Offset from the center. A negative value means coordinates above
375-
* the element.
371+
* @param xOffset Offset from the element's in-view center point. A negative value means
372+
* an offset left of the point.
373+
* @param yOffset Offset from the element's in-view center point. A negative value means
374+
* an offset above the point.
376375
* @return A self reference.
377376
*/
378377
public Actions moveToElement(WebElement target, int xOffset, int yOffset) {
@@ -382,7 +381,7 @@ public Actions moveToElement(WebElement target, int xOffset, int yOffset) {
382381

383382
// Of course, this is the offset from the centre of the element. We have no idea what the width
384383
// and height are once we execute this method.
385-
LOG.info("When using the W3C Action commands, offsets are from the center of element");
384+
LOG.info("When using the W3C Action commands, offsets are from the element's in-view center point");
386385
return moveInTicks(target, xOffset, yOffset);
387386
}
388387

0 commit comments

Comments
 (0)