mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-16 08:18:59 +00:00
Don't break wait on scheduler callback error
Allow recursive parsing
This commit is contained in:
@@ -629,8 +629,7 @@ fn _wait(self: *Page, wait_ms: u32) !Session.WaitResult {
|
|||||||
|
|
||||||
if (try_catch.hasCaught()) {
|
if (try_catch.hasCaught()) {
|
||||||
const msg = (try try_catch.err(self.arena)) orelse "unknown";
|
const msg = (try try_catch.err(self.arena)) orelse "unknown";
|
||||||
log.warn(.js, "page wait", .{ .err = msg, .src = "scheduler" });
|
log.info(.js, "page wait", .{ .err = msg, .src = "scheduler" });
|
||||||
return error.JsError;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const http_active = http_client.active;
|
const http_active = http_client.active;
|
||||||
@@ -1648,9 +1647,9 @@ pub fn childListChange(
|
|||||||
|
|
||||||
// TODO: optimize and cleanup, this is called a lot (e.g., innerHTML = '')
|
// TODO: optimize and cleanup, this is called a lot (e.g., innerHTML = '')
|
||||||
pub fn parseHtmlAsChildren(self: *Page, node: *Node, html: []const u8) !void {
|
pub fn parseHtmlAsChildren(self: *Page, node: *Node, html: []const u8) !void {
|
||||||
std.debug.assert(self._parse_mode == .document);
|
const previous_parse_mode = self._parse_mode;
|
||||||
self._parse_mode = .fragment;
|
self._parse_mode = .fragment;
|
||||||
defer self._parse_mode = .document;
|
defer self._parse_mode = previous_parse_mode;
|
||||||
|
|
||||||
var parser = Parser.init(self.call_arena, node, self);
|
var parser = Parser.init(self.call_arena, node, self);
|
||||||
parser.parseFragment(html);
|
parser.parseFragment(html);
|
||||||
|
|||||||
@@ -67,8 +67,8 @@ pub fn init(input: Input, options: ?RequestInit, page: *Page) !js.Promise {
|
|||||||
.url = request._url,
|
.url = request._url,
|
||||||
.method = .GET,
|
.method = .GET,
|
||||||
.headers = headers,
|
.headers = headers,
|
||||||
.cookie_jar = &page._session.cookie_jar,
|
|
||||||
.resource_type = .fetch,
|
.resource_type = .fetch,
|
||||||
|
.cookie_jar = &page._session.cookie_jar,
|
||||||
.header_callback = httpHeaderDoneCallback,
|
.header_callback = httpHeaderDoneCallback,
|
||||||
.data_callback = httpDataCallback,
|
.data_callback = httpDataCallback,
|
||||||
.done_callback = httpDoneCallback,
|
.done_callback = httpDoneCallback,
|
||||||
|
|||||||
Reference in New Issue
Block a user