From e884c36da46bec00cbf1f53775ba2eaf2b73cf3e Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Wed, 12 Feb 2025 08:30:23 -0800 Subject: [PATCH] Revert "chore(bidi): use fractional coordinates for pointerAction (#34675)" Reverting this until Firefox implements support for fractional coordinates. Landing this now increases overall testing time on the bots and tips over the limit for Firefox Bidi tests. This reverts commit 8e51be9069c775a199b4326af5751434bca59d9d. --- packages/playwright-core/src/server/bidi/bidiInput.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/playwright-core/src/server/bidi/bidiInput.ts b/packages/playwright-core/src/server/bidi/bidiInput.ts index e460a9f3ef..a7f8810da5 100644 --- a/packages/playwright-core/src/server/bidi/bidiInput.ts +++ b/packages/playwright-core/src/server/bidi/bidiInput.ts @@ -79,6 +79,9 @@ export class RawMouseImpl implements input.RawMouse { } async move(x: number, y: number, button: types.MouseButton | 'none', buttons: Set, modifiers: Set, forClick: boolean): Promise { + // Bidi throws when x/y are not integers. + x = Math.floor(x); + y = Math.floor(y); await this._performActions([{ type: 'pointerMove', x, y }]); } @@ -91,6 +94,9 @@ export class RawMouseImpl implements input.RawMouse { } async wheel(x: number, y: number, buttons: Set, modifiers: Set, deltaX: number, deltaY: number): Promise { + // Bidi throws when x/y are not integers. + x = Math.round(x); + y = Math.round(y); await this._session.send('input.performActions', { context: this._session.sessionId, actions: [