Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<title>Nested inert, focusability and dynamic changes</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="outer" inert>
<div id="inner" inert>
<input id="inp" type="text">
</div>
</div>
<script>
test(() => {
inp.focus();
assert_not_equals(document.activeElement, inp);
}, "Input element in nested inerts is not focusable");
test(() => {
outer.inert = false;
inp.focus();
assert_not_equals(document.activeElement, inp);
}, "Input element still not focusable after outer inert removed");
test(() => {
inner.inert = false;
inp.focus();
assert_equals(document.activeElement, inp);
}, "Input element focusable with both inerts removed");
</script>