1
1
mirror of https://github.com/microsoft/playwright.git synced 2024-12-15 06:02:57 +03:00
Commit Graph

4 Commits

Author SHA1 Message Date
Dmitry Gozman
61ff52704c
feat(input): perform hit target check during input ()
This replaces previous `checkHitTarget` heuristic that took place before the action
with a new `setupHitTargetInterceptor` that works during the action:
- Before the action we set up capturing listeners on the window.
- During the action we ensure that event target is the element we expect to interact with.
- After the action we clear the listeners.

This should catch the "layout shift" issues where things move
between action point calculation and the actual action.

Possible issues:
- **Risk:** `{ trial: true }` might dispatch move events like `mousemove` or `pointerout`,
because we do actually move the mouse but prevent all other events.
- **Timing**: The timing of "hit target check" has moved, so this may affect different web pages
in different ways, for example expose more races. In this case, we should retry the click as before.
- **No risk**: There is still a possibility of mis-targeting with iframes shifting around,
because we only intercept in the target frame. This behavior does not change.

There is an opt-out environment variable PLAYWRIGHT_NO_LAYOUT_SHIFT_CHECK that reverts to previous behavior.
2021-11-05 17:31:28 -07:00
Max Schmitt
cd22072685
chore: enable object-curly-spacing in ESLint () 2021-09-27 18:58:08 +02:00
Dmitry Gozman
217cbe3e21
test: cleanup bad usages of pageTest () 2021-05-06 07:08:22 -07:00
Dmitry Gozman
9433cae4fe
test: move all page tests to a subdirectory () 2021-05-05 19:10:28 -07:00