Bubble events to the Window

This commit is contained in:
Karl Seguin
2025-09-15 22:24:35 +08:00
parent 0f13e062fe
commit 4f127c9de3
3 changed files with 25 additions and 3 deletions

View File

@@ -13,4 +13,12 @@
el.dispatchEvent(new CustomEvent('c2', {detail: {over: 9000}}));
testing.expectEqual("c2-9000", capture);
let window_calls = 0;
window.addEventListener('c1', () => {
window_calls += 1;
});
el.dispatchEvent(new CustomEvent('c1', {bubbles: true}));
testing.expectEqual(1, window_calls);
</script>