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.
It turns out that we can only bootstrap Firefox toolchains
from latest commits.
So in case of a full build, we have to fetch latest commit
from `master`, bootstrap from it, and then build the commit we'd like.
This PR fixes the following error message in WPE:
```
[pid=506430][err] (MiniBrowser:506435): GLib-GObject-CRITICAL **: 11:47:23.538: g_object_new_is_valid_property: object class 'WebKitWebContext' has no property named 'process-swap-on-cross-site-navigation-enabled' +0ms
```
Our changes to WPE port that added support for the parameter were removed in 5a3fae4c5a as PSON is enabled by default in WPE (see https://bugs.webkit.org/show_bug.cgi?id=240052) and we don't need to set this explicitly in our fork.
Pretty diff: fc28e40f36
OverridenGeolocationProvider can be destroyed after BrowserContext. Since the provider is owned by WebGeolocationManagerProxy we now store weak pointer to it in the browser context.
Refs: #14081