diff --git a/testing/marionette/action.js b/testing/marionette/action.js index 71f1073c40b4c..7882b8b315d49 100644 --- a/testing/marionette/action.js +++ b/testing/marionette/action.js @@ -1311,7 +1311,7 @@ function dispatchPointerMove(a, inputState, tickDuration, window) { const start = Date.now(); const [startX, startY] = [inputState.x, inputState.y]; - let coords = getElementCenter(a.origin, window); + let coords = getElementCenter(a.origin); let target = action.computePointerDestination(a, inputState, coords); const [targetX, targetY] = [target.x, target.y]; @@ -1421,9 +1421,9 @@ function inViewPort(x, y, win) { return !(x < 0 || y < 0 || x > win.innerWidth || y > win.innerHeight); } -function getElementCenter(el, window) { +function getElementCenter(el) { if (element.isDOMElement(el)) { - return element.getInViewCentrePoint(el.getClientRects()[0], window); + return element.coordinates(el); } return {}; }