-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Expand file tree
/
Copy pathfocus-visible-026.html
More file actions
31 lines (29 loc) · 1.38 KB
/
focus-visible-026.html
File metadata and controls
31 lines (29 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE html>
<meta charset="utf-8" />
<title>CSS Test (Selectors): Checkbox doesn't match :focus-visiblel after click on label</title>
<link rel="help" href="https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo" />
<meta name="assert" content="This test checks that :focus-visible does NOT match when a checkbox is focused because an associated label has been clicked.">
<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>
<script src="/resources/accesskey.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
<style>
:focus-visible {
outline: red solid 5px;
}
</style>
<input type="checkbox" id="checkbox">
<label for="checkbox" id="label">label</label>
<script>
// Check that :focus-visible is supported.
test_valid_selector(':focus-visible');
promise_test(async t => {
await test_driver.click(label);
assert_equals(getComputedStyle(checkbox).outlineStyle, "none", `outline-style for ${checkbox.tagName}#${checkbox.id} should be none`);
t.done();
}, ":focus-visible does NOT match when a checkbox is focused via click on the associated label");
</script>