Lightpanda: the headless browser designed for AI and automation
webapi: invoke MutationObserver callbacks with the observer as this
Francis Bouvier575ca0000c86
diff --git a/src/browser/webapi/MutationObserver.zig b/src/browser/webapi/MutationObserver.zigindex 719f09567..3c20732d0 100644--- a/src/browser/webapi/MutationObserver.zig+++ b/src/browser/webapi/MutationObserver.zig@@ -350,7 +350,8 @@ pub fn deliverRecords(self: *MutationObserver, frame: *Frame) !void {defer ls.deinit();var caught: js.TryCatch.Caught = undefined;- ls.toLocal(self._callback).tryCall(void, .{ records, self }, &caught) catch |err| {+ // Per spec, the callback is invoked with the observer as its this value.+ ls.toLocal(self._callback).tryCallWithThis(void, self, .{ records, self }, &caught) catch |err| {log.err(.frame, "MutObserver.deliverRecords", .{ .err = err, .caught = caught });return err;};