Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<title>MathML autofocus attribute</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<math>
<a id="element" autofocus href="https://example.com/"><mtext>MathML Link</mtext></a>
</math>
<input id="input" autofocus value="some input">
<script>
let t = async_test("MathML autofocus on <a> element");
input.addEventListener("focus",
t.unreached_func("focus() shouldn't be called on `<input>`"));
element.addEventListener("focus", t.step_func_done(function(e) {
assert_equals(document.activeElement, element, "<a> element is focused");
assert_true(element.autofocus, "autofocus IDL attribute");
}, "focus() called on <a> element"));
</script>