Skip to content

Commit e44f453

Browse files
noamrchromium-wpt-export-bot
authored andcommitted
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 <[email protected]> Reviewed-by: Dominic Farolino <[email protected]> Cr-Commit-Position: refs/heads/main@{#1380625}
1 parent 44c412c commit e44f453

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

dom/nodes/moveBefore/tentative/fire-focusin-focusout.html

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<title>moveBefore should handle focus bubbling correctly</title>
2+
<title>moveBefore should not fire focus events</title>
33
<script src="/resources/testharness.js"></script>
44
<script src="/resources/testharnessreport.js"></script>
55
<body>
@@ -48,10 +48,8 @@
4848
new_parent.moveBefore(button, null);
4949
assert_collected_events_equals(collected_events, [
5050
{type: "focusin", target: button},
51-
{type: "focusout", target: old_parent},
52-
{type: "focusin", target: new_parent}
5351
]);
54-
}, "Fire focusin/out when reparenting focused element directly");
52+
}, "Don't fire focusin/out when reparenting focused element directly");
5553

5654
test(t => {
5755
const collected_events = collect_focusinout_events(t);
@@ -62,10 +60,8 @@
6260
new_parent.moveBefore(old_parent, null);
6361
assert_collected_events_equals(collected_events, [
6462
{type: "focusin", target: button},
65-
{type: "focusout", target: document.body},
66-
{type: "focusin", target: new_parent}
6763
]);
68-
}, "Fire focusin/out when reparenting an element that has focus within");
64+
}, "Don't fire focusin/out when reparenting an element that has focus within");
6965

7066
test(t => {
7167
const collected_events = collect_focusinout_events(t);
@@ -88,18 +84,13 @@
8884
button.focus();
8985
inert_parent.moveBefore(button, null);
9086
assert_collected_events_equals(collected_events, [
91-
{type: "focusin", target: button},
92-
{type: "focusout", target: old_parent},
93-
{type: "focusin", target: inert_parent}
94-
]);
87+
{type: "focusin", target: button}]);
9588
await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(() => resolve())));
9689
assert_collected_events_equals(collected_events, [
9790
{type: "focusin", target: button},
98-
{type: "focusout", target: old_parent},
99-
{type: "focusin", target: inert_parent},
10091
{type: "focusout", target: button},
10192
]);
102-
}, "Fire focusin and then correct when moving to an inert subtree");
93+
}, "Don't fire focusin and then correct when moving to an inert subtree");
10394

10495
promise_test(async t => {
10596
const collected_events = collect_focusinout_events(t);
@@ -111,16 +102,12 @@
111102
inert_when_not_empty_parent.moveBefore(button, null);
112103
assert_collected_events_equals(collected_events, [
113104
{type: "focusin", target: button},
114-
{type: "focusout", target: old_parent},
115-
{type: "focusin", target: inert_when_not_empty_parent}
116105
]);
117106
await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(() => resolve())));
118107
assert_collected_events_equals(collected_events, [
119108
{type: "focusin", target: button},
120-
{type: "focusout", target: old_parent},
121-
{type: "focusin", target: inert_when_not_empty_parent},
122109
{type: "focusout", target: button},
123110
]);
124-
}, "Fire focusin and then correct when moving to a tree that is made inert using style");
111+
}, "Don't fire focusin and then correct when moving to a tree that is made inert using style");
125112

126113
</script>

0 commit comments

Comments
 (0)