Skip to content

Commit d8f1505

Browse files
committed
Bug 1854180 [wpt PR 42006] - Implement setSequentialFocusStartingPoint, a=testonly
Automatic update from web-platform-tests Implement setSequentialFocusStartingPoint This is proposed here: whatwg/html#5326 Change-Id: I2c0c0ac578180ce5e1cf327fb65c6450a7d49f60 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4866726 Reviewed-by: Di Zhang <dizhanggchromium.org> Commit-Queue: Joey Arhar <jarharchromium.org> Cr-Commit-Position: refs/heads/main{#1197956} -- wpt-commits: ac2aa5a07011181a9437a071786ded31431b6b73 wpt-pr: 42006 UltraBlame original commit: e31a9e86898a1b6b91b3acb6c3b792ba4d67166f
1 parent 2f3d959 commit d8f1505

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!DOCTYPE html>
2+
<link rel=author href="mailto:[email protected]">
3+
<link rel=help href="https://github.com/whatwg/html/issues/5326">
4+
<script src="/resources/testharness.js"></script>
5+
<script src="/resources/testharnessreport.js"></script>
6+
<script src="/resources/testdriver.js"></script>
7+
<script src="/resources/testdriver-vendor.js"></script>
8+
9+
<button id=b1>b1</button>
10+
<div id=d1>d1</div>
11+
<button id=b2>b2</button>
12+
13+
<script>
14+
const tabKey = '\uE004';
15+
promise_test(async () => {
16+
assert_equals(document.activeElement, document.body,
17+
'Focus should initially be set on the body element.');
18+
19+
document.setSequentialFocusStartingPoint(d1);
20+
assert_equals(document.activeElement, document.body,
21+
'Calling setSequentialFocusStartingPoint should not change the focused element.');
22+
23+
await test_driver.send_keys(document.activeElement, tabKey);
24+
assert_equals(document.activeElement, b2,
25+
'Pressing tab should focus the next button after the sequential focus starting point.');
26+
}, 'document.setSequentialFocusStartingPoint should set the sequential focus starting point on any element.');
27+
</script>

0 commit comments

Comments
 (0)