on iframe re-navigation, keep pending_loads in sync

This commit is contained in:
Karl Seguin
2026-02-28 21:51:44 +08:00
parent ac2e276a6a
commit 524b5be937

View File

@@ -236,7 +236,7 @@ version: usize = 0,
// ScriptManager, so all scripts just count as 1 pending load. // ScriptManager, so all scripts just count as 1 pending load.
_pending_loads: u32, _pending_loads: u32,
_parent_notified: if (IS_DEBUG) bool else void = if (IS_DEBUG) false else {}, _parent_notified: bool = false,
_type: enum { root, frame }, // only used for logs right now _type: enum { root, frame }, // only used for logs right now
_req_id: u32 = 0, _req_id: u32 = 0,
@@ -753,11 +753,15 @@ fn _documentIsComplete(self: *Page) !void {
} }
fn notifyParentLoadComplete(self: *Page) void { fn notifyParentLoadComplete(self: *Page) void {
if (comptime IS_DEBUG) { if (self._parent_notified == true) {
std.debug.assert(self._parent_notified == false); if (comptime IS_DEBUG) {
self._parent_notified = true; std.debug.assert(false);
}
// shouldn't happen, don't want to crash a release build over it
return;
} }
self._parent_notified = true;
if (self.parent) |p| { if (self.parent) |p| {
p.iframeCompletedLoading(self.iframe.?); p.iframeCompletedLoading(self.iframe.?);
} }