Skip to content

Commit

Permalink
Bug 1754476 [wpt PR 32772] - WebKit export of https://bugs.webkit.org…
Browse files Browse the repository at this point in the history
…/show_bug.cgi?id=236331, a=testonly

Automatic update from web-platform-tests
WebKit export of https://bugs.webkit.org/show_bug.cgi?id=236331

--

wpt-commits: 5dc2ddb435ccc501a213daa1cec0e9c516fbabcf
wpt-pr: 32772
  • Loading branch information
mrego authored and moz-wptsync-bot committed Mar 7, 2022
1 parent 42e86c9 commit 4439078
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions testing/web-platform/tests/css/selectors/focus-visible-026.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<meta charset="utf-8" />
<title>CSS Test (Selectors): Checkbox doesn't match :focus-visiblel after click on label</title>
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:[email protected]">
<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>

0 comments on commit 4439078

Please sign in to comment.