load event dispatching for Style

This commit is contained in:
Halil Durak
2026-02-04 23:17:47 +03:00
parent 8ecbd8e71c
commit 3afbb6fcc2

View File

@@ -96,6 +96,15 @@ pub const JsApi = struct {
pub const sheet = bridge.accessor(Style.getSheet, null, .{}); pub const sheet = bridge.accessor(Style.getSheet, null, .{});
}; };
pub const Build = struct {
pub fn created(node: *Node, page: *Page) !void {
const self = node.as(Style);
const style = self.asElement();
// Push to `_to_load` to dispatch load event just before window load event.
return page._to_load.append(page.arena, style);
}
};
const testing = @import("../../../../testing.zig"); const testing = @import("../../../../testing.zig");
test "WebApi: Style" { test "WebApi: Style" {
try testing.htmlRunner("element/html/style.html", .{}); try testing.htmlRunner("element/html/style.html", .{});