From 4ccd84a45d48492a1aca290bcd3853d3462dc515 Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Sat, 9 Nov 2024 10:00:07 +0000 Subject: [PATCH] Bug 1930252 [wpt PR 49076] - moveBefore: don't fire focusin/focusout, a=testonly Automatic update from web-platform-tests moveBefore: don't fire focusin/focusout Following spec conversation at WHATNOT, this will be deferred until we receive community feedback. Bug: 40150299 Change-Id: I18dc4ebd50d52fa83ea3a4cc8cf376e7b33d835b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5992801 Commit-Queue: Dominic Farolino Reviewed-by: Dominic Farolino Cr-Commit-Position: refs/heads/main@{#1380625} -- wpt-commits: e44f4535f4fe673f00e6f487c6240a4c4647b5a6 wpt-pr: 49076 --- .../tentative/fire-focusin-focusout.html | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/testing/web-platform/tests/dom/nodes/moveBefore/tentative/fire-focusin-focusout.html b/testing/web-platform/tests/dom/nodes/moveBefore/tentative/fire-focusin-focusout.html index d655dd6530219..5bc24ae96935a 100644 --- a/testing/web-platform/tests/dom/nodes/moveBefore/tentative/fire-focusin-focusout.html +++ b/testing/web-platform/tests/dom/nodes/moveBefore/tentative/fire-focusin-focusout.html @@ -1,5 +1,5 @@ -moveBefore should handle focus bubbling correctly +moveBefore should not fire focus events @@ -48,10 +48,8 @@ new_parent.moveBefore(button, null); assert_collected_events_equals(collected_events, [ {type: "focusin", target: button}, - {type: "focusout", target: old_parent}, - {type: "focusin", target: new_parent} ]); -}, "Fire focusin/out when reparenting focused element directly"); +}, "Don't fire focusin/out when reparenting focused element directly"); test(t => { const collected_events = collect_focusinout_events(t); @@ -62,10 +60,8 @@ new_parent.moveBefore(old_parent, null); assert_collected_events_equals(collected_events, [ {type: "focusin", target: button}, - {type: "focusout", target: document.body}, - {type: "focusin", target: new_parent} ]); -}, "Fire focusin/out when reparenting an element that has focus within"); +}, "Don't fire focusin/out when reparenting an element that has focus within"); test(t => { const collected_events = collect_focusinout_events(t); @@ -88,18 +84,13 @@ button.focus(); inert_parent.moveBefore(button, null); assert_collected_events_equals(collected_events, [ - {type: "focusin", target: button}, - {type: "focusout", target: old_parent}, - {type: "focusin", target: inert_parent} - ]); + {type: "focusin", target: button}]); await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(() => resolve()))); assert_collected_events_equals(collected_events, [ {type: "focusin", target: button}, - {type: "focusout", target: old_parent}, - {type: "focusin", target: inert_parent}, {type: "focusout", target: button}, ]); -}, "Fire focusin and then correct when moving to an inert subtree"); +}, "Don't fire focusin and then correct when moving to an inert subtree"); promise_test(async t => { const collected_events = collect_focusinout_events(t); @@ -111,16 +102,12 @@ inert_when_not_empty_parent.moveBefore(button, null); assert_collected_events_equals(collected_events, [ {type: "focusin", target: button}, - {type: "focusout", target: old_parent}, - {type: "focusin", target: inert_when_not_empty_parent} ]); await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(() => resolve()))); assert_collected_events_equals(collected_events, [ {type: "focusin", target: button}, - {type: "focusout", target: old_parent}, - {type: "focusin", target: inert_when_not_empty_parent}, {type: "focusout", target: button}, ]); -}, "Fire focusin and then correct when moving to a tree that is made inert using style"); +}, "Don't fire focusin and then correct when moving to a tree that is made inert using style");