Files
sousa-gecko/testing/web-platform/tests/mathml/relations/html5-tree/autofocus-003.html
T
2026-05-14 20:46:01 +00:00

20 lines
842 B
HTML

<!DOCTYPE html>
<title>MathML autofocus attribute</title>
<link rel="help" content="https://w3c.github.io/mathml-core/#dfn-autofocus">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<math>
<mrow id="element" autofocus><mtext>mrow</mtext><mrow>
</math>
<input id="input" autofocus value="some input">
<script>
let t = async_test("MathML autofocus on <mrow> element");
element.addEventListener("focus",
t.unreached_func("focus() shouldn't be called on <mrow> element"));
input.addEventListener("focus", t.step_func_done(function(e) {
assert_not_equals(document.activeElement, element, "element is not focused");
assert_true(element.autofocus, "autofocus IDL attribute");
}, "focus() not called on element"));
</script>