Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /dom/events/window-composed-path.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>Window: Event.composedPath()</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<script>
test(() => {
const target = window;
const event = new Event("foo");
function listener(e) {
assert_array_equals(e.composedPath(), [target]);
}
target.addEventListener("foo", listener);
target.dispatchEvent(event);
assert_array_equals(event.composedPath(), []);
}, "window target has an empty path after dispatch");
</script>
</body>
</html>