github web-platform-tests/wpt merge_pr_46826

latest releases: merge_pr_49470, epochs/three_hourly/2024-12-03_06H, epochs/six_hourly/2024-12-03_06H...
15 months ago

[EditContext] Move focus/blur handling to Document::SetFocusedElement

When a focused element is removed from the DOM, the focus handling
code does not go through FocusController::SetFocusedElement as
it normally does for a focus change triggered by a call to
focus()/blur() or a user interaction. So, the code in that
function to deactivate/activate EditContext does not get called
in this case.

The result is if a focused element with an EditContext attached is
removed, editing is broken on the page because the page is still
sending text input to that EditContext.

Fix this by moving the EditContext deactivation/activation code
to Document::SetFocusedElement, which gets called even in the
element removal case.

Bug: 335542791
Change-Id: I7953ba6bd203734b396f891582f5d0c3e846c0aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5630890
Reviewed-by: Anupam Snigdha snianu@microsoft.com
Reviewed-by: Koji Ishii kojii@chromium.org
Commit-Queue: Dan Clark daniec@microsoft.com
Cr-Commit-Position: refs/heads/main@{#1317073}

Don't miss a new wpt release

NewReleases is sending notifications on new releases.