Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /svg/interact/scripted/composed.window.svg - WPT Dashboard Interop Dashboard
<?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>