mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 04:34:44 +00:00
Merge pull request #1899 from lightpanda-io/idle_task_fix
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;
|
document._page = self;
|
||||||
|
|
||||||
if (comptime builtin.is_test == false) {
|
if (comptime builtin.is_test == false) {
|
||||||
|
if (parent == null) {
|
||||||
// HTML test runner manually calls these as necessary
|
// HTML test runner manually calls these as necessary
|
||||||
try self.js.scheduler.add(session.browser, struct {
|
try self.js.scheduler.add(session.browser, struct {
|
||||||
fn runIdleTasks(ctx: *anyopaque) !?u32 {
|
fn runIdleTasks(ctx: *anyopaque) !?u32 {
|
||||||
@@ -317,6 +318,7 @@ pub fn init(self: *Page, frame_id: u32, session: *Session, parent: ?*Page) !void
|
|||||||
}
|
}
|
||||||
}.runIdleTasks, 200, .{ .name = "page.runIdleTasks", .low_priority = true });
|
}.runIdleTasks, 200, .{ .name = "page.runIdleTasks", .low_priority = true });
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn deinit(self: *Page, abort_http: bool) void {
|
pub fn deinit(self: *Page, abort_http: bool) void {
|
||||||
|
|||||||
Reference in New Issue
Block a user