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/interaction/focus/focusgroup/tentative/reading-flow-navigation/flex-visual-order-basic.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: focusgroup - Reading flow navigation respects flex visual order</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="../resources/focusgroup-utils.js"></script>
<style>
.flex-container {
display: flex;
flex-direction: row-reverse;
reading-flow: flex-visual;
}
</style>
<div class="flex-container" focusgroup="toolbar">
<span id=item1 tabindex=0>item1</span>
<span id=item2 tabindex=0>item2</span>
<span id=item3 tabindex=0>item3</span>
</div>
<script>
promise_test(async t => {
// Expected visual order due to flex-direction: row-reverse and reading-flow: flex-visual
// Visual order: item3, item2, item1
const elementsInVisualOrder = [
document.getElementById("item3"),
document.getElementById("item2"),
document.getElementById("item1")
];
await assert_focus_navigation_bidirectional(elementsInVisualOrder);
}, "Focusgroup navigation should respect reading-flow: flex-visual order instead of DOM order.");
</script>