Automatic update from web-platform-tests Add tests for autofocus content/IDL attribute on MathML elements. https://github.com/whatwg/html/pull/12416 https://html.spec.whatwg.org/multipage/interaction.html#the-autofocus-attribute https://w3c.github.io/mathml-core/#dfn-autofocus -- wpt-commits: 4cc9a18629dffa80639bb996b56211ac13d5b29d wpt-pr: 59816
20 lines
842 B
HTML
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>
|