Merge pull request #1627 from lightpanda-io/dom_load_no_window

Don't bubble "load" event to Window
This commit is contained in:
Karl Seguin
2026-02-24 07:24:58 +08:00
committed by GitHub

View File

@@ -313,12 +313,15 @@ fn dispatchNode(self: *EventManager, target: *Node, event: *Event, was_handled:
node = n._parent;
}
// Even though the window isn't part of the DOM, events always propagate
// Even though the window isn't part of the DOM, most events propagate
// through it in the capture phase (unless we stopped at a shadow boundary)
// The only explicit exception is "load"
if (event._type_string.eql(comptime .wrap("load")) == false) {
if (path_len < path_buffer.len) {
path_buffer[path_len] = page.window.asEventTarget();
path_len += 1;
}
}
const path = path_buffer[0..path_len];