diff options
Diffstat (limited to 'testing/web-platform/tests/html/interaction/focus/setSequentialFocusStartingPoint.tentative.html')
-rw-r--r-- | testing/web-platform/tests/html/interaction/focus/setSequentialFocusStartingPoint.tentative.html | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/interaction/focus/setSequentialFocusStartingPoint.tentative.html b/testing/web-platform/tests/html/interaction/focus/setSequentialFocusStartingPoint.tentative.html new file mode 100644 index 0000000000..a7c7506b13 --- /dev/null +++ b/testing/web-platform/tests/html/interaction/focus/setSequentialFocusStartingPoint.tentative.html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<link rel=author href="mailto:jarhar@chromium.org"> +<link rel=help href="https://github.com/whatwg/html/issues/5326"> +<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> + +<button id=b1>b1</button> +<div id=d1>d1</div> +<button id=b2>b2</button> + +<script> +const tabKey = '\uE004'; +promise_test(async () => { + assert_equals(document.activeElement, document.body, + 'Focus should initially be set on the body element.'); + + document.setSequentialFocusStartingPoint(d1); + assert_equals(document.activeElement, document.body, + 'Calling setSequentialFocusStartingPoint should not change the focused element.'); + + await test_driver.send_keys(document.activeElement, tabKey); + assert_equals(document.activeElement, b2, + 'Pressing tab should focus the next button after the sequential focus starting point.'); +}, 'document.setSequentialFocusStartingPoint should set the sequential focus starting point on any element.'); +</script> |