mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 04:34:44 +00:00
Fix load event for page with no external scripts but with iframes
Previously the "load" event happened when all external scripts were done. In the case that there was no external script, the "load" event would fire immediately after parsing. With iframes, it now waits for external script AND iframes to complete but the no-external-script code was never updated to consider iframes and would thus fire load events prematurely.
This commit is contained in:
@@ -866,11 +866,6 @@ fn pageDoneCallback(ctx: *anyopaque) !void {
|
||||
.html => |buf| {
|
||||
parser.parse(buf.items);
|
||||
self._script_manager.staticScriptsDone();
|
||||
if (self._script_manager.isDone()) {
|
||||
// No scripts, or just inline scripts that were already processed
|
||||
// we need to trigger this ourselves
|
||||
self.documentIsComplete();
|
||||
}
|
||||
self._parse_state = .complete;
|
||||
},
|
||||
.text => |*buf| {
|
||||
|
||||
@@ -582,12 +582,6 @@ fn evaluate(self: *ScriptManager) void {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn isDone(self: *const ScriptManager) bool {
|
||||
return self.static_scripts_done and // page is done processing initial html
|
||||
self.defer_scripts.first == null and // no deferred scripts
|
||||
self.async_scripts.first == null; // no async scripts
|
||||
}
|
||||
|
||||
fn parseImportmap(self: *ScriptManager, script: *const Script) !void {
|
||||
const content = script.source.content();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user