mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-21 20:24:42 +00:00
only run idle tasks from the root page
This commit is contained in:
@@ -308,6 +308,7 @@ pub fn init(self: *Page, frame_id: u32, session: *Session, parent: ?*Page) !void
|
||||
document._page = self;
|
||||
|
||||
if (comptime builtin.is_test == false) {
|
||||
if (parent == null) {
|
||||
// HTML test runner manually calls these as necessary
|
||||
try self.js.scheduler.add(session.browser, struct {
|
||||
fn runIdleTasks(ctx: *anyopaque) !?u32 {
|
||||
@@ -318,6 +319,7 @@ pub fn init(self: *Page, frame_id: u32, session: *Session, parent: ?*Page) !void
|
||||
}.runIdleTasks, 200, .{ .name = "page.runIdleTasks", .low_priority = true });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn deinit(self: *Page, abort_http: bool) void {
|
||||
for (self.frames.items) |frame| {
|
||||
|
||||
Reference in New Issue
Block a user