From de83521e08a6f8ce2e5f54b165fe37ae6e8b33e5 Mon Sep 17 00:00:00 2001 From: Karl Seguin Date: Mon, 13 Oct 2025 21:53:58 +0800 Subject: [PATCH] Fire page lifecycle events when all scripts are either inline or async This is how, for example, scripts on lightpanda.io are. Though fixing this doesn't really change anything, it's good to make sure these events are firing correctly. --- src/browser/ScriptManager.zig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/browser/ScriptManager.zig b/src/browser/ScriptManager.zig index 735a2eab..ebf843e6 100644 --- a/src/browser/ScriptManager.zig +++ b/src/browser/ScriptManager.zig @@ -384,6 +384,7 @@ pub fn getAsyncModule(self: *ScriptManager, url: [:0]const u8, cb: AsyncModule.C pub fn staticScriptsDone(self: *ScriptManager) void { std.debug.assert(self.static_scripts_done == false); self.static_scripts_done = true; + self.evaluate(); } // try to evaluate completed scripts (in order). This is called whenever a script @@ -450,6 +451,12 @@ pub fn isDone(self: *const ScriptManager) bool { self.deferreds.first == null; // and there are no more