Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/forms/the-select-element/select-tabindex-order.tentative.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<input id="input1">
<select id="select" tabindex="2">
<option>one</option>
<option>two</option>
<option>three</option>
</select>
<input id="input3" tabindex="1">
<style>
select, ::picker(select) {
appearance: base-select;
}
</style>
<script>
promise_test(async () => {
const TAB_KEY = "\uE004";
const input1 = document.getElementById("input1");
const input3 = document.getElementById("input3");
input1.focus();
assert_equals(document.activeElement.id, "input1", "input1 should be active");
await test_driver.send_keys(input1, TAB_KEY);
assert_equals(document.activeElement.id, "input3", "input3 should be active");
await test_driver.send_keys(input3, TAB_KEY);
assert_equals(document.activeElement.id, "select", "select should be active");
}, "Check that tabindex applies to <select>");
</script>