Skip to content

Commit f1be514

Browse files
agolomanmoz-wptsync-bot
authored andcommitted
Revert "Bug 2035573 - Start focus navigation from selection if it is a descendant of focused element. " for causing wpt failures @sequential-focus-navigation-starting-point.tentative.html.
This reverts commit 15f3930b2c232064170a7a5e61b7a9bd1e1b8b51. gecko-commit: 0dfd3bd46c854f4ac99e1e5dbd272a2e68fb4e8a gecko-commit-git: 861a985a35e4266ac504cee2b76363cbaa4e804d gecko-reviewers: vhilla, edgar
1 parent b7d9760 commit f1be514

1 file changed

Lines changed: 3 additions & 31 deletions

File tree

html/interaction/focus/sequential-focus-navigation-starting-point.tentative.html renamed to html/interaction/focus/sequential-focus-navigation-starting-point.html

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -118,28 +118,6 @@
118118
<button data-next slot="d">button 4</button>
119119
</div>
120120
</template>
121-
<template data-description="Focus navigation starting point should be used when it's a descendant of the focused element.">
122-
<div tabindex="0" data-focus>
123-
<button data-prev id="button1">button 1</button>
124-
<span data-click>in between</span>
125-
<button data-next id="button2">button 2</button>
126-
</div>
127-
</template>
128-
<template data-description="Backwards focus navigation should not be stuck when starting point is inside focused element but before any other focusable areas.">
129-
<button data-prev id="button1">button 1</button>
130-
<div tabindex="0" id="focusable" data-focus>
131-
<span data-click>in between</span>
132-
<button data-next id="button2">button 2</button>
133-
</div>
134-
</template>
135-
<template data-description="Should start from focused element if it was focused after the selection was set.">
136-
<button id="button1">button 1</button>
137-
<span data-click>in between</span>
138-
<button id="button2">button 2</button>
139-
<button id="button3" data-prev>button 3</button>
140-
<div tabindex="0" id="focusable" data-focus2>focusable</div>
141-
<button id="button4" data-next>button 4</button>
142-
</template>
143121

144122
<script>
145123
"use strict";
@@ -148,15 +126,13 @@
148126
const kTab = "\uE004";
149127

150128
// Runs callback on each element matching selector, descending into open shadow roots.
151-
async function forEachMatching(selector, callback, root) {
129+
function forEachMatching(selector, callback, root) {
152130
if (!root) { root = container; }
153131
for (let element of root.querySelectorAll(selector)) {
154-
await callback(element);
132+
callback(element);
155133
}
156134
for (let element of root.querySelectorAll("[data-shadow]")) {
157-
if (element.shadowRoot) {
158-
await forEachMatching(selector, callback, element.shadowRoot);
159-
}
135+
forEachMatching(selector, callback, element.shadowRoot);
160136
}
161137
}
162138

@@ -173,7 +149,6 @@
173149
forEachMatching("[data-focus]", element => {
174150
element.focus();
175151
});
176-
await forEachMatching("[data-click]", test_driver.click);
177152
forEachMatching("[data-blur]", element => {
178153
element.blur();
179154
});
@@ -201,9 +176,6 @@
201176
forEachMatching("[data-reenable]", element => {
202177
element.disabled = false;
203178
});
204-
forEachMatching("[data-focus2]", element => {
205-
element.focus();
206-
});
207179

208180
let actions = new test_driver.Actions();
209181
if (backwards) {

0 commit comments

Comments
 (0)