Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test ShadowRoot's delegatesFocus attribute #28593

Merged
merged 1 commit into from
Apr 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions shadow-dom/focus/ShadowRoot-delegatesFocus.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>ShadowRoot's delegatesFocus attribute</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="host1"></div>
<div id="host2"></div>
<div id="host3"></div>
<script>
test(t => {
const host = document.getElementById("host1");
const shadowRoot = host.attachShadow({mode: "closed"});
assert_equals(shadowRoot.delegatesFocus, false);
}, "default delegatesFocus value");

test(t => {
const host = document.getElementById("host2");
const shadowRoot = host.attachShadow({mode: "closed", delegatesFocus: false});
assert_equals(shadowRoot.delegatesFocus, false);
}, "delegatesFocus set to false in init dict");

test(t => {
const host = document.getElementById("host3");
const shadowRoot = host.attachShadow({mode: "closed", delegatesFocus: true});
assert_equals(shadowRoot.delegatesFocus, true);
}, "delegatesFocus set to true in init dict");
</script>