mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-16 08:18:59 +00:00
netsurf: declare EventTargetTBase as extern
to guarantee the memory layout
This commit is contained in:
@@ -333,7 +333,7 @@ pub const Page = struct {
|
|||||||
// dispatch window.load event
|
// dispatch window.load event
|
||||||
const loadevt = try parser.eventCreate();
|
const loadevt = try parser.eventCreate();
|
||||||
try parser.eventInit(loadevt, "load", .{});
|
try parser.eventInit(loadevt, "load", .{});
|
||||||
_ = try parser.eventTargetDispatchEvent(parser.toEventTarget(EventTargetTBase, &self.session.window), loadevt);
|
_ = try parser.eventTargetDispatchEvent(parser.toEventTarget(Window, &self.session.window), loadevt);
|
||||||
}
|
}
|
||||||
|
|
||||||
// evalScript evaluates the src in priority.
|
// evalScript evaluates the src in priority.
|
||||||
|
|||||||
@@ -653,7 +653,7 @@ pub fn eventTargetTBaseFieldName(comptime T: type) ?[]const u8 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// EventTargetBase is used to implement EventTarget for pure zig struct.
|
// EventTargetBase is used to implement EventTarget for pure zig struct.
|
||||||
pub const EventTargetTBase = struct {
|
pub const EventTargetTBase = extern struct {
|
||||||
const Self = @This();
|
const Self = @This();
|
||||||
|
|
||||||
vtable: ?*const c.struct_dom_event_target_vtable = &c.struct_dom_event_target_vtable{
|
vtable: ?*const c.struct_dom_event_target_vtable = &c.struct_dom_event_target_vtable{
|
||||||
|
|||||||
Reference in New Issue
Block a user