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

This commit is contained in:
Joel Einbinder 2020-11-16 11:07:06 -08:00 committed by GitHub
parent 31bebc7ea0
commit e91140e88c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -1,2 +1,2 @@
1208 1209
Changed: yurys@chromium.org Fri 13 Nov 2020 02:55:31 PM PST Changed: joel.einbinder@gmail.com Mon 16 Nov 2020 10:52:59 AM PST

View File

@ -715,6 +715,14 @@ class PageAgent {
} }
async _dispatchTapEvent({x, y, modifiers}) { 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({ const {defaultPrevented: startPrevented} = await this._dispatchTouchEvent({
type: 'touchstart', type: 'touchstart',
modifiers, modifiers,