Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

browser(firefox): force a layout before dispatching a tap (#4428)

Joel Einbindere91140e88cc5
diff --git a/browser_patches/firefox/BUILD_NUMBER b/browser_patches/firefox/BUILD_NUMBER
index e6256d5dbb..0c9507bd0c 100644
--- a/browser_patches/firefox/BUILD_NUMBER
+++ b/browser_patches/firefox/BUILD_NUMBER
@@ -1,2 +1,2 @@
-1208
-Changed: [email protected] Fri 13 Nov 2020 02:55:31 PM PST
+1209
+Changed: [email protected] Mon 16 Nov 2020 10:52:59 AM PST
diff --git a/browser_patches/firefox/juggler/content/PageAgent.js b/browser_patches/firefox/juggler/content/PageAgent.js
index 01146de227..af53449327 100644
--- a/browser_patches/firefox/juggler/content/PageAgent.js
+++ b/browser_patches/firefox/juggler/content/PageAgent.js
@@ -715,6 +715,14 @@ class PageAgent {
}
async _dispatchTapEvent({x, y, modifiers}) {
+ // Force a layout at the point in question, because touch events
+ // do not seem to trigger one like mouse events.
+ this._frameTree.mainFrame().domWindow().windowUtils.elementFromPoint(
+ x,
+ y,
+ false /* aIgnoreRootScrollFrame */,
+ true /* aFlushLayout */);
+
const {defaultPrevented: startPrevented} = await this._dispatchTouchEvent({
type: 'touchstart',
modifiers,