Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

SVG Preview (Scaled)

Preview of https://hg.mozilla.org/mozilla-central/raw-file/tip/testing/web-platform/tests/svg/interact/scripted/composed.window.svg
<?xml version="1.0" encoding="UTF-8"?>
<title>Focus events are composed</title>
<metadata>
</metadata>
<a id="a1" href="#"></a>
<h:script src="/resources/testharness.js"/>
<h:script src="/resources/testharnessreport.js"/>
<script><![CDATA[
async_test(t => {
const anchor = document.getElementById("a1");
let happened = false;
anchor.onfocus = t.step_func(e => {
happened = true;
assert_equals(e.type, "focus");
assert_true(e.composed);
});
anchor.focus();
anchor.onblur = t.step_func_done(e => {
assert_true(happened);
assert_equals(e.type, "blur");
assert_true(e.composed);
});
anchor.blur();
}, "Focus events are composed");
]]></script>
</svg>