playwright/packages/playwright-core/src/server
Ross Wollman fbb364c1cd
fix: page.locator.focus() and page.locator(…).type(…) (#14267)
Fixes focus and blur management when `page.locator(…).focus()`  and  `page.locator(…).type(…)` are used which was regressed by 7a5b070 (#13510).

#13510 relied on an implicit assumption that this (conditional) [`blur`](7a5b070e95/packages/playwright-core/src/server/injected/injectedScript.ts (L672)) call would always be followed by a call that resulted in a newly focused element via this [`focus`](7a5b070e95/packages/playwright-core/src/server/injected/injectedScript.ts (L674)) call.

However, some elements are [not focusable](https://html.spec.whatwg.org/multipage/interaction.html#focusable-area), so we were blurring incorrectly, and losing focus that we should have maintained.

Two regression tests were added that pass on the commit prior to 7a5b070e95 (and match manual testing/expectations):

* `page.locator(…).focus()`: _keeps focus on element when attempting to focus a non-focusable element_
* `page.locator(…).type(…)`: _should type repeatedly in input in shadow dom_

Additionally, a third test (_should type repeatedly in input in shadow dom_) was added to check the invariant from #13510 that states:

> This affects [contenteditable] elements, but not input elements.

and allows us to introduce the targeted fix (contenteditble check before blur) without breaking FF again.

And _should type repeatedly in contenteditable in shadow dom with nested elements_ was added to ensure the above fix works with nest contenteditble detection.

Fixes #14254.
2022-05-19 14:31:56 -07:00
..
android chore: make Android host option configurable (#13685) 2022-04-21 22:16:42 +02:00
chromium chore: disable AvoidUnnecessaryBeforeUnloadCheckSync on chromium (#14080) 2022-05-10 14:55:44 -07:00
dispatchers chore: serialize circular objects (#14045) 2022-05-09 18:51:53 -07:00
electron chore: use utils via index export (5) (#13413) 2022-04-07 20:18:22 -07:00
firefox chore: do not reset internal bindings for reuse (#14019) 2022-05-09 07:44:20 -07:00
har chore: bundle core deps (#13621) 2022-04-18 20:20:49 -07:00
injected fix: page.locator.focus() and page.locator(…).type(…) (#14267) 2022-05-19 14:31:56 -07:00
isomorphic chore: split injected utils into proper files (#14093) 2022-05-11 13:49:12 +01:00
recorder fix(recorder): remove waitForNavigation from codegen (#14166) 2022-05-18 10:02:09 -07:00
registry fix: support installing dependencies on non-ubuntu. (#14010) 2022-05-10 04:05:39 -07:00
trace fix(tracing): workaround chromium scrollTop slowness (#14114) 2022-05-12 10:55:29 -07:00
webkit chore: bundle core deps (#13621) 2022-04-18 20:20:49 -07:00
accessibility.ts chore: always import type (#13365) 2022-04-06 14:57:14 -07:00
artifact.ts chore: use utils via index export (5) (#13413) 2022-04-07 20:18:22 -07:00
browser.ts chore: use utils via index export (4) (#13404) 2022-04-07 14:36:13 -07:00
browserContext.ts fix: leaking server side objects (#13991) 2022-05-09 17:34:00 +01:00
browserType.ts fix: typo in the missing X Display error message (#13810) 2022-04-28 08:35:01 -07:00
console.ts chore: always import type (#13365) 2022-04-06 14:57:14 -07:00
cookieStore.ts chore: always import type (#13365) 2022-04-06 14:57:14 -07:00
debugger.ts fix: leaking server side objects (#13991) 2022-05-09 17:34:00 +01:00
DEPS.list chore: make bundles typed (#13620) 2022-04-18 17:50:25 -07:00
deviceDescriptors.js chore: migrate to monorepo (#9421) 2021-10-11 16:52:17 +02:00
deviceDescriptorsSource.json feat(chromium): roll to r1006 (#14192) 2022-05-16 10:56:38 -07:00
dialog.ts chore: use utils via index export (3) (#13403) 2022-04-07 13:55:44 -07:00
dom.ts feat: make scrollIntoView work with zero-sized elements (#13702) 2022-04-23 21:48:36 +01:00
download.ts chore: use utils via index export (3) (#13403) 2022-04-07 13:55:44 -07:00
fetch.ts chore: make tests pass on Node.js 17+ (#13678) 2022-04-22 13:42:52 +02:00
fileChooser.ts chore: always import type (#13365) 2022-04-06 14:57:14 -07:00
formData.ts chore: bundle core deps (#13621) 2022-04-18 20:20:49 -07:00
frames.ts chore: disable AvoidUnnecessaryBeforeUnloadCheckSync on chromium (#14080) 2022-05-10 14:55:44 -07:00
helper.ts chore: use utils via index export (5) (#13413) 2022-04-07 20:18:22 -07:00
index.ts chore: fix installation scripts (#13376) 2022-04-06 23:09:10 -07:00
input.ts chore: use utils via index export (3) (#13403) 2022-04-07 13:55:44 -07:00
instrumentation.ts fix: leaking server side objects (#13991) 2022-05-09 17:34:00 +01:00
javascript.ts chore: use utils via index export (6) (#13417) 2022-04-07 21:48:41 -07:00
macEditingCommands.ts fix: support undo/redo editing commands (#13606) 2022-04-18 22:22:52 -07:00
network.ts chore: use utils via index export (5) (#13413) 2022-04-07 20:18:22 -07:00
page.ts chore: serialize circular objects (#14045) 2022-05-09 18:51:53 -07:00
pipeTransport.ts chore: use utils via index export (4) (#13404) 2022-04-07 14:36:13 -07:00
playwright.ts chore: use utils via index export (4) (#13404) 2022-04-07 14:36:13 -07:00
progress.ts chore: use utils via index export (5) (#13413) 2022-04-07 20:18:22 -07:00
protocolError.ts chore: move some files out of server/common (#11466) 2022-01-18 19:13:51 -08:00
recorder.ts fix: leaking server side objects (#13991) 2022-05-09 17:34:00 +01:00
screenshotter.ts chore: nuke "fonts" screenshot option (#14004) 2022-05-06 17:54:17 -07:00
selectors.ts feat(locators): remove layout locators (#14129) 2022-05-12 18:50:19 +01:00
transport.ts feat(chromium): roll tot, ignore unknown session error (#13932) 2022-05-04 10:00:02 -07:00
types.ts chore: make Android host option configurable (#13685) 2022-04-21 22:16:42 +02:00
usKeyboardLayout.ts chore: migrate to monorepo (#9421) 2021-10-11 16:52:17 +02:00