Adds Document.prerendering

Expands bridge.property to work as a getter. This previously only worked by
setting a value directly on the TemplatePrototype. This is what you want for
something like Node.TEXT_NODE which is accessible on both Node and an instance
(e.g. document.createElement('div').TEXT_NODE).

Now the property can be configured with .{.template = false}. It essentially
becomes an optimized: bridge.accessor(comptime scalar, null, .{});

There are other accessor that can be converted to this type, but I'll do that
after this is merged to keep this PR manageable.
This commit is contained in:
Karl Seguin
2026-02-07 19:05:00 +08:00
parent 122255058e
commit eef203633b
11 changed files with 132 additions and 76 deletions

View File

@@ -565,10 +565,10 @@ pub const JsApi = struct {
};
// Constants for compareBoundaryPoints
pub const START_TO_START = bridge.property(0);
pub const START_TO_END = bridge.property(1);
pub const END_TO_END = bridge.property(2);
pub const END_TO_START = bridge.property(3);
pub const START_TO_START = bridge.property(0, .{ .template = true });
pub const START_TO_END = bridge.property(1, .{ .template = true });
pub const END_TO_END = bridge.property(2, .{ .template = true });
pub const END_TO_START = bridge.property(3, .{ .template = true });
pub const constructor = bridge.constructor(Range.init, .{});
pub const setStart = bridge.function(Range.setStart, .{ .dom_exception = true });