mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-08-02 10:47:15 -04:00
minor: remove DOMException WebAPI flag (make it always on).
This change touches a lot of files, but it's pretty minor. Most files simply have .dom_exception = true removed from their WebAPI binding. The only reason NOT to have this on is in the case where a Zig function returns an error that incorrectly gets mapped to a DOMException. But this hasn't happened yet, none of the base errors (e.g. OutOfMemory) map to a DOMException, but the opposite DOES happen: we don't flag an API as dom_exception = true that we should.
This commit is contained in:
@@ -118,7 +118,6 @@ pub fn deinit(self: *Caller) void {
|
||||
}
|
||||
|
||||
pub const CallOpts = struct {
|
||||
dom_exception: bool = false,
|
||||
null_as_undefined: bool = false,
|
||||
as_typed_array: bool = false,
|
||||
// Constructor-only. When true, `new.target` is pulled from the
|
||||
@@ -137,12 +136,12 @@ pub fn constructor(self: *Caller, comptime T: type, func: anytype, handle: *cons
|
||||
const info = FunctionCallbackInfo{ .handle = handle };
|
||||
|
||||
if (!info.isConstructCall()) {
|
||||
handleError(T, @TypeOf(func), local, error.InvalidArgument, info, opts);
|
||||
handleError(T, @TypeOf(func), local, error.InvalidArgument, info);
|
||||
return;
|
||||
}
|
||||
|
||||
self._constructor(func, info, opts) catch |err| {
|
||||
handleError(T, @TypeOf(func), local, err, info, opts);
|
||||
handleError(T, @TypeOf(func), local, err, info);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -193,7 +192,7 @@ pub fn getIndex(self: *Caller, comptime T: type, func: anytype, idx: u32, handle
|
||||
|
||||
const info = PropertyCallbackInfo{ .handle = handle };
|
||||
return _getIndex(T, local, func, idx, info, opts) catch |err| {
|
||||
handleError(T, @TypeOf(func), local, err, info, opts);
|
||||
handleError(T, @TypeOf(func), local, err, info);
|
||||
return js.Intercepted.no;
|
||||
};
|
||||
}
|
||||
@@ -219,7 +218,7 @@ pub fn getNamedIndex(self: *Caller, comptime T: type, func: anytype, name: *cons
|
||||
|
||||
const info = PropertyCallbackInfo{ .handle = handle };
|
||||
return _getNamedIndex(T, local, func, name, info, opts) catch |err| {
|
||||
handleError(T, @TypeOf(func), local, err, info, opts);
|
||||
handleError(T, @TypeOf(func), local, err, info);
|
||||
return js.Intercepted.no;
|
||||
};
|
||||
}
|
||||
@@ -245,7 +244,7 @@ pub fn setNamedIndex(self: *Caller, comptime T: type, func: anytype, name: *cons
|
||||
|
||||
const info = PropertyCallbackInfo{ .handle = handle };
|
||||
return _setNamedIndex(T, local, func, name, .{ .local = &self.local, .handle = js_value }, info, opts) catch |err| {
|
||||
handleError(T, @TypeOf(func), local, err, info, opts);
|
||||
handleError(T, @TypeOf(func), local, err, info);
|
||||
return js.Intercepted.no;
|
||||
};
|
||||
}
|
||||
@@ -272,7 +271,7 @@ pub fn deleteNamedIndex(self: *Caller, comptime T: type, func: anytype, name: *c
|
||||
|
||||
const info = PropertyCallbackInfo{ .handle = handle };
|
||||
return _deleteNamedIndex(T, local, func, name, info, opts) catch |err| {
|
||||
handleError(T, @TypeOf(func), local, err, info, opts);
|
||||
handleError(T, @TypeOf(func), local, err, info);
|
||||
return js.Intercepted.no;
|
||||
};
|
||||
}
|
||||
@@ -298,7 +297,7 @@ pub fn getEnumerator(self: *Caller, comptime T: type, func: anytype, handle: *co
|
||||
|
||||
const info = PropertyCallbackInfo{ .handle = handle };
|
||||
return _getEnumerator(T, local, func, info, opts) catch |err| {
|
||||
handleError(T, @TypeOf(func), local, err, info, opts);
|
||||
handleError(T, @TypeOf(func), local, err, info);
|
||||
return js.Intercepted.no;
|
||||
};
|
||||
}
|
||||
@@ -328,7 +327,7 @@ fn handleIndexedReturn(comptime T: type, comptime F: type, comptime with_value:
|
||||
return js.Intercepted.no;
|
||||
}
|
||||
}
|
||||
handleError(T, F, local, err, info, opts);
|
||||
handleError(T, F, local, err, info);
|
||||
return js.Intercepted.no;
|
||||
};
|
||||
},
|
||||
@@ -359,7 +358,7 @@ fn nameToString(local: *const Local, comptime T: type, name: *const v8.Name) !T
|
||||
return try js.String.toSlice(.{ .local = local, .handle = handle });
|
||||
}
|
||||
|
||||
fn handleError(comptime T: type, comptime F: type, local: *const Local, err: anyerror, info: anytype, comptime opts: CallOpts) void {
|
||||
fn handleError(comptime T: type, comptime F: type, local: *const Local, err: anyerror, info: anytype) void {
|
||||
const isolate = local.isolate;
|
||||
|
||||
if (comptime IS_DEBUG and @TypeOf(info) == FunctionCallbackInfo) {
|
||||
@@ -379,22 +378,21 @@ fn handleError(comptime T: type, comptime F: type, local: *const Local, err: any
|
||||
error.RangeError => isolate.createRangeError(""),
|
||||
error.OutOfMemory => isolate.createError("out of memory"),
|
||||
error.IllegalConstructor => isolate.createError("Illegal Constructor"),
|
||||
else => blk: {
|
||||
if (comptime opts.dom_exception) {
|
||||
const DOMException = @import("../webapi/DOMException.zig");
|
||||
if (DOMException.fromError(err)) |ex| {
|
||||
const value = local.zigValueToJs(ex, .{}) catch break :blk isolate.createError("internal error");
|
||||
break :blk value.handle;
|
||||
}
|
||||
}
|
||||
break :blk isolate.createError(@errorName(err));
|
||||
},
|
||||
else => domExceptionToJs(local, err) orelse isolate.createError(@errorName(err)),
|
||||
};
|
||||
|
||||
const js_exception = isolate.throwException(js_err);
|
||||
info.getReturnValue().setValueHandle(js_exception);
|
||||
}
|
||||
|
||||
// Convert a Zig error to a DOMException. If the error is unknown, return null.
|
||||
fn domExceptionToJs(local: *const Local, err: anyerror) ?*const v8.Value {
|
||||
const DOMException = @import("../webapi/DOMException.zig");
|
||||
const ex = DOMException.fromError(err) orelse return null;
|
||||
const value = local.zigValueToJs(ex, .{}) catch return local.isolate.createError("internal error");
|
||||
return value.handle;
|
||||
}
|
||||
|
||||
// This is extracted to speed up compilation. When left inlined in handleError,
|
||||
// this can add as much as 10 seconds of compilation time.
|
||||
fn logFunctionCallError(local: *const Local, type_name: []const u8, func: []const u8, err: anyerror, info: FunctionCallbackInfo) void {
|
||||
@@ -568,7 +566,6 @@ pub const Function = struct {
|
||||
static: bool = false,
|
||||
wpt_only: bool = false,
|
||||
deletable: bool = true,
|
||||
dom_exception: bool = false,
|
||||
as_typed_array: bool = false,
|
||||
null_as_undefined: bool = false,
|
||||
cache: ?Caching = null,
|
||||
@@ -650,11 +647,7 @@ pub const Function = struct {
|
||||
};
|
||||
|
||||
const js_value = _call(T, &caller.local, info, func, opts) catch |err| {
|
||||
handleError(T, @TypeOf(func), &caller.local, err, info, .{
|
||||
.dom_exception = opts.dom_exception,
|
||||
.as_typed_array = opts.as_typed_array,
|
||||
.null_as_undefined = opts.null_as_undefined,
|
||||
});
|
||||
handleError(T, @TypeOf(func), &caller.local, err, info);
|
||||
return;
|
||||
};
|
||||
|
||||
@@ -677,7 +670,6 @@ pub const Function = struct {
|
||||
}
|
||||
const res = @call(.auto, func, args);
|
||||
const js_value = try local.zigValueToJs(res, .{
|
||||
.dom_exception = opts.dom_exception,
|
||||
.as_typed_array = opts.as_typed_array,
|
||||
.null_as_undefined = opts.null_as_undefined,
|
||||
});
|
||||
@@ -883,12 +875,6 @@ fn getArgs(comptime F: type, comptime offset: usize, local: *const Local, info:
|
||||
@field(args, tupleFieldName(field_index)) = local.jsValueToZig(param.type.?, js_val) catch |err| {
|
||||
const DOMException = @import("../webapi/DOMException.zig");
|
||||
if (DOMException.fromError(err) != null) {
|
||||
// I don't love this. But we have [a few] cases when trying to
|
||||
// map a JS Value that we have a specific DOMException to throw.
|
||||
// Ideally we should only do this if dom_exception = true in the
|
||||
// bridge definition. But we don't have access to that here.
|
||||
// Instead, we just rely on the fact that local.jsValueToZig
|
||||
// only throws a DOMException-known error when it should.
|
||||
return err;
|
||||
}
|
||||
return error.InvalidArgument;
|
||||
|
||||
@@ -110,7 +110,6 @@ pub const Constructor = struct {
|
||||
func: *const fn (?*const v8.FunctionCallbackInfo) callconv(.c) void,
|
||||
|
||||
const Opts = struct {
|
||||
dom_exception: bool = false,
|
||||
// When true, the constructor function receives `new.target` (as a
|
||||
// js.Function) as its first parameter. Used by HTMLElement to support
|
||||
// direct instantiation of custom elements via `new MyElement()`.
|
||||
@@ -142,7 +141,6 @@ pub const Constructor = struct {
|
||||
defer if (ce_frame) |frame| frame._ce_reactions.popAndInvoke(ce_checkpoint, frame);
|
||||
|
||||
caller.constructor(T, func, handle.?, .{
|
||||
.dom_exception = opts.dom_exception,
|
||||
.new_target = opts.new_target,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ pub const JsApi = struct {
|
||||
pub const constructor = bridge.constructor(BroadcastChannel.init, .{});
|
||||
|
||||
pub const name = bridge.accessor(BroadcastChannel.getName, null, .{});
|
||||
pub const postMessage = bridge.function(BroadcastChannel.postMessage, .{ .dom_exception = true });
|
||||
pub const postMessage = bridge.function(BroadcastChannel.postMessage, .{});
|
||||
pub const close = bridge.function(BroadcastChannel.close, .{});
|
||||
|
||||
pub const onmessage = bridge.accessor(BroadcastChannel.getOnMessage, BroadcastChannel.setOnMessage, .{});
|
||||
|
||||
@@ -426,10 +426,10 @@ pub const JsApi = struct {
|
||||
pub const length = bridge.accessor(CData.getLength, null, .{});
|
||||
|
||||
pub const appendData = bridge.function(CData.appendData, .{ .ce_reactions = true });
|
||||
pub const deleteData = bridge.function(CData.deleteData, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const insertData = bridge.function(CData.insertData, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const replaceData = bridge.function(CData.replaceData, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const substringData = bridge.function(CData.substringData, .{ .dom_exception = true });
|
||||
pub const deleteData = bridge.function(CData.deleteData, .{ .ce_reactions = true });
|
||||
pub const insertData = bridge.function(CData.insertData, .{ .ce_reactions = true });
|
||||
pub const replaceData = bridge.function(CData.replaceData, .{ .ce_reactions = true });
|
||||
pub const substringData = bridge.function(CData.substringData, .{});
|
||||
|
||||
pub const remove = bridge.function(CData.remove, .{ .ce_reactions = true });
|
||||
pub const before = bridge.function(CData.before, .{ .ce_reactions = true });
|
||||
|
||||
@@ -82,7 +82,7 @@ pub const JsApi = struct {
|
||||
pub const empty_with_no_proto = true;
|
||||
};
|
||||
|
||||
pub const getRandomValues = bridge.function(Crypto.getRandomValues, .{ .dom_exception = true });
|
||||
pub const getRandomValues = bridge.function(Crypto.getRandomValues, .{});
|
||||
pub const randomUUID = bridge.function(Crypto.randomUUID, .{});
|
||||
pub const subtle = bridge.accessor(Crypto.getSubtle, null, .{});
|
||||
};
|
||||
|
||||
@@ -281,10 +281,10 @@ pub const JsApi = struct {
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
};
|
||||
|
||||
pub const define = bridge.function(CustomElementRegistry.define, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const define = bridge.function(CustomElementRegistry.define, .{ .ce_reactions = true });
|
||||
pub const get = bridge.function(CustomElementRegistry.get, .{ .null_as_undefined = true });
|
||||
pub const upgrade = bridge.function(CustomElementRegistry.upgrade, .{ .ce_reactions = true });
|
||||
pub const whenDefined = bridge.function(CustomElementRegistry.whenDefined, .{ .dom_exception = true });
|
||||
pub const whenDefined = bridge.function(CustomElementRegistry.whenDefined, .{});
|
||||
};
|
||||
|
||||
const testing = @import("../../testing.zig");
|
||||
|
||||
@@ -101,7 +101,7 @@ pub const JsApi = struct {
|
||||
pub const empty_with_no_proto = true;
|
||||
};
|
||||
|
||||
pub const createDocumentType = bridge.function(DOMImplementation.createDocumentType, .{ .dom_exception = true });
|
||||
pub const createDocumentType = bridge.function(DOMImplementation.createDocumentType, .{});
|
||||
pub const createDocument = bridge.function(DOMImplementation.createDocument, .{});
|
||||
pub const createHTMLDocument = bridge.function(DOMImplementation.createHTMLDocument, .{});
|
||||
pub const hasFeature = bridge.function(DOMImplementation.hasFeature, .{});
|
||||
|
||||
@@ -224,7 +224,7 @@ pub const JsApi = struct {
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const constructor = bridge.constructor(DOMMatrix.init, .{ .dom_exception = true });
|
||||
pub const constructor = bridge.constructor(DOMMatrix.init, .{});
|
||||
|
||||
pub const fromMatrix = bridge.function(DOMMatrix.fromMatrix, .{ .static = true });
|
||||
pub const fromFloat32Array = bridge.function(DOMMatrix.fromFloat32Array, .{ .static = true });
|
||||
@@ -268,7 +268,7 @@ pub const JsApi = struct {
|
||||
pub const preMultiplySelf = bridge.function(DOMMatrix.preMultiplySelf, .{});
|
||||
pub const invertSelf = bridge.function(DOMMatrix.invertSelf, .{});
|
||||
// setMatrixValue parses a CSS transform string; Window-only.
|
||||
pub const setMatrixValue = bridge.function(DOMMatrix.setMatrixValue, .{ .dom_exception = true, .exposed = .window });
|
||||
pub const setMatrixValue = bridge.function(DOMMatrix.setMatrixValue, .{ .exposed = .window });
|
||||
|
||||
fn getM(comptime idx: usize) fn (*const DOMMatrix) f64 {
|
||||
return struct {
|
||||
|
||||
@@ -803,7 +803,7 @@ pub const JsApi = struct {
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const constructor = bridge.constructor(DOMMatrixReadOnly.init, .{ .dom_exception = true });
|
||||
pub const constructor = bridge.constructor(DOMMatrixReadOnly.init, .{});
|
||||
|
||||
pub const fromMatrix = bridge.function(DOMMatrixReadOnly.fromMatrix, .{ .static = true });
|
||||
pub const fromFloat32Array = bridge.function(DOMMatrixReadOnly.fromFloat32Array, .{ .static = true });
|
||||
@@ -852,7 +852,7 @@ pub const JsApi = struct {
|
||||
pub const toFloat32Array = bridge.function(DOMMatrixReadOnly.toFloat32Array, .{});
|
||||
pub const toFloat64Array = bridge.function(DOMMatrixReadOnly.toFloat64Array, .{});
|
||||
// The stringifier depends on CSS serialization and is Window-only.
|
||||
pub const toString = bridge.function(DOMMatrixReadOnly.toString, .{ .dom_exception = true, .exposed = .window });
|
||||
pub const toString = bridge.function(DOMMatrixReadOnly.toString, .{ .exposed = .window });
|
||||
|
||||
// m11..m44 getters are generated from the storage index.
|
||||
fn getM(comptime idx: usize) fn (*const DOMMatrixReadOnly) f64 {
|
||||
|
||||
@@ -199,7 +199,7 @@ pub const JsApi = struct {
|
||||
pub const whatToShow = bridge.accessor(DOMNodeIterator.getWhatToShow, null, .{});
|
||||
pub const filter = bridge.accessor(DOMNodeIterator.getFilter, null, .{});
|
||||
|
||||
pub const nextNode = bridge.function(DOMNodeIterator.nextNode, .{ .dom_exception = true });
|
||||
pub const previousNode = bridge.function(DOMNodeIterator.previousNode, .{ .dom_exception = true });
|
||||
pub const nextNode = bridge.function(DOMNodeIterator.nextNode, .{});
|
||||
pub const previousNode = bridge.function(DOMNodeIterator.previousNode, .{});
|
||||
pub const detach = bridge.function(DOMNodeIterator.detach, .{});
|
||||
};
|
||||
|
||||
@@ -1277,23 +1277,23 @@ pub const JsApi = struct {
|
||||
pub const styleSheets = bridge.accessor(Document.getStyleSheets, null, .{});
|
||||
pub const fonts = bridge.accessor(Document.getFonts, null, .{});
|
||||
pub const contentType = bridge.accessor(Document.getContentType, null, .{});
|
||||
pub const domain = bridge.accessor(Document.getDomain, Document.setDomain, .{ .dom_exception = true });
|
||||
pub const domain = bridge.accessor(Document.getDomain, Document.setDomain, .{});
|
||||
pub const cookie = bridge.accessor(Document.getCookie, Document.setCookie, .{});
|
||||
pub const createElement = bridge.function(Document.createElement, .{ .dom_exception = true });
|
||||
pub const createElementNS = bridge.function(Document.createElementNS, .{ .dom_exception = true });
|
||||
pub const createElement = bridge.function(Document.createElement, .{});
|
||||
pub const createElementNS = bridge.function(Document.createElementNS, .{});
|
||||
pub const createDocumentFragment = bridge.function(Document.createDocumentFragment, .{});
|
||||
pub const createComment = bridge.function(Document.createComment, .{});
|
||||
pub const createTextNode = bridge.function(Document.createTextNode, .{});
|
||||
pub const createAttribute = bridge.function(Document.createAttribute, .{ .dom_exception = true });
|
||||
pub const createAttributeNS = bridge.function(Document.createAttributeNS, .{ .dom_exception = true });
|
||||
pub const createCDATASection = bridge.function(Document.createCDATASection, .{ .dom_exception = true });
|
||||
pub const createProcessingInstruction = bridge.function(Document.createProcessingInstruction, .{ .dom_exception = true });
|
||||
pub const createAttribute = bridge.function(Document.createAttribute, .{});
|
||||
pub const createAttributeNS = bridge.function(Document.createAttributeNS, .{});
|
||||
pub const createCDATASection = bridge.function(Document.createCDATASection, .{});
|
||||
pub const createProcessingInstruction = bridge.function(Document.createProcessingInstruction, .{});
|
||||
pub const createRange = bridge.function(Document.createRange, .{});
|
||||
pub const createEvent = bridge.function(Document.createEvent, .{ .dom_exception = true });
|
||||
pub const createEvent = bridge.function(Document.createEvent, .{});
|
||||
pub const createTreeWalker = bridge.function(Document.createTreeWalker, .{});
|
||||
pub const createNodeIterator = bridge.function(Document.createNodeIterator, .{});
|
||||
pub const evaluate = bridge.function(Document.evaluate, .{ .dom_exception = true });
|
||||
pub const createExpression = bridge.function(Document.createExpression, .{ .dom_exception = true });
|
||||
pub const evaluate = bridge.function(Document.evaluate, .{});
|
||||
pub const createExpression = bridge.function(Document.createExpression, .{});
|
||||
pub const createNSResolver = bridge.function(Document.createNSResolver, .{});
|
||||
pub const getElementById = bridge.function(_getElementById, .{});
|
||||
fn _getElementById(self: *Document, value_: ?js.Value, frame: *Frame) !?*Element {
|
||||
@@ -1306,25 +1306,25 @@ pub const JsApi = struct {
|
||||
}
|
||||
return self.getElementById(try value.toZig([]const u8), frame);
|
||||
}
|
||||
pub const querySelector = bridge.function(Document.querySelector, .{ .dom_exception = true });
|
||||
pub const querySelectorAll = bridge.function(Document.querySelectorAll, .{ .dom_exception = true });
|
||||
pub const querySelector = bridge.function(Document.querySelector, .{});
|
||||
pub const querySelectorAll = bridge.function(Document.querySelectorAll, .{});
|
||||
pub const getElementsByTagName = bridge.function(Document.getElementsByTagName, .{});
|
||||
pub const getElementsByTagNameNS = bridge.function(Document.getElementsByTagNameNS, .{});
|
||||
pub const getSelection = bridge.function(Document.getSelection, .{});
|
||||
pub const getElementsByClassName = bridge.function(Document.getElementsByClassName, .{});
|
||||
pub const getElementsByName = bridge.function(Document.getElementsByName, .{});
|
||||
pub const adoptNode = bridge.function(Document.adoptNode, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const importNode = bridge.function(Document.importNode, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const append = bridge.function(Document.append, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const prepend = bridge.function(Document.prepend, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const moveBefore = bridge.function(Document.moveBefore, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const replaceChildren = bridge.function(Document.replaceChildren, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const adoptNode = bridge.function(Document.adoptNode, .{ .ce_reactions = true });
|
||||
pub const importNode = bridge.function(Document.importNode, .{ .ce_reactions = true });
|
||||
pub const append = bridge.function(Document.append, .{ .ce_reactions = true });
|
||||
pub const prepend = bridge.function(Document.prepend, .{ .ce_reactions = true });
|
||||
pub const moveBefore = bridge.function(Document.moveBefore, .{ .ce_reactions = true });
|
||||
pub const replaceChildren = bridge.function(Document.replaceChildren, .{ .ce_reactions = true });
|
||||
pub const elementFromPoint = bridge.function(Document.elementFromPoint, .{});
|
||||
pub const elementsFromPoint = bridge.function(Document.elementsFromPoint, .{});
|
||||
pub const write = bridge.function(Document.write, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const writeln = bridge.function(Document.writeln, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const open = bridge.function(Document.open, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const close = bridge.function(Document.close, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const write = bridge.function(Document.write, .{ .ce_reactions = true });
|
||||
pub const writeln = bridge.function(Document.writeln, .{ .ce_reactions = true });
|
||||
pub const open = bridge.function(Document.open, .{ .ce_reactions = true });
|
||||
pub const close = bridge.function(Document.close, .{ .ce_reactions = true });
|
||||
pub const doctype = bridge.accessor(Document.getDocType, null, .{});
|
||||
pub const firstElementChild = bridge.accessor(Document.getFirstElementChild, null, .{});
|
||||
pub const lastElementChild = bridge.accessor(Document.getLastElementChild, null, .{});
|
||||
|
||||
@@ -208,16 +208,16 @@ pub const JsApi = struct {
|
||||
return self.getElementById(try value.toZig([]const u8));
|
||||
}
|
||||
|
||||
pub const querySelector = bridge.function(DocumentFragment.querySelector, .{ .dom_exception = true });
|
||||
pub const querySelectorAll = bridge.function(DocumentFragment.querySelectorAll, .{ .dom_exception = true });
|
||||
pub const querySelector = bridge.function(DocumentFragment.querySelector, .{});
|
||||
pub const querySelectorAll = bridge.function(DocumentFragment.querySelectorAll, .{});
|
||||
pub const children = bridge.accessor(DocumentFragment.getChildren, null, .{});
|
||||
pub const childElementCount = bridge.accessor(DocumentFragment.getChildElementCount, null, .{});
|
||||
pub const firstElementChild = bridge.accessor(DocumentFragment.firstElementChild, null, .{});
|
||||
pub const lastElementChild = bridge.accessor(DocumentFragment.lastElementChild, null, .{});
|
||||
pub const append = bridge.function(DocumentFragment.append, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const prepend = bridge.function(DocumentFragment.prepend, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const moveBefore = bridge.function(DocumentFragment.moveBefore, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const replaceChildren = bridge.function(DocumentFragment.replaceChildren, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const append = bridge.function(DocumentFragment.append, .{ .ce_reactions = true });
|
||||
pub const prepend = bridge.function(DocumentFragment.prepend, .{ .ce_reactions = true });
|
||||
pub const moveBefore = bridge.function(DocumentFragment.moveBefore, .{ .ce_reactions = true });
|
||||
pub const replaceChildren = bridge.function(DocumentFragment.replaceChildren, .{ .ce_reactions = true });
|
||||
|
||||
pub const innerHTML = bridge.accessor(_getInnerHTML, _setInnerHTML, .{ .ce_reactions = true });
|
||||
fn _getInnerHTML(self: *DocumentFragment, frame: *Frame) ![]const u8 {
|
||||
|
||||
@@ -1958,12 +1958,12 @@ pub const JsApi = struct {
|
||||
|
||||
pub const prefix = bridge.accessor(Element._prefix, null, .{});
|
||||
|
||||
pub const setAttribute = bridge.function(_setAttribute, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const setAttribute = bridge.function(_setAttribute, .{ .ce_reactions = true });
|
||||
fn _setAttribute(self: *Element, name: String, value: js.Value, frame: *Frame) !void {
|
||||
return self.setAttribute(name, .wrap(try value.toStringSlice()), frame);
|
||||
}
|
||||
|
||||
pub const setAttributeNS = bridge.function(_setAttributeNS, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const setAttributeNS = bridge.function(_setAttributeNS, .{ .ce_reactions = true });
|
||||
fn _setAttributeNS(self: *Element, maybe_ns: ?[]const u8, qn: []const u8, value: js.Value, frame: *Frame) !void {
|
||||
return self.setAttributeNS(maybe_ns, qn, .wrap(try value.toStringSlice()), frame);
|
||||
}
|
||||
@@ -1986,16 +1986,16 @@ pub const JsApi = struct {
|
||||
pub const getAttributeNode = bridge.function(Element.getAttributeNode, .{});
|
||||
pub const setAttributeNode = bridge.function(Element.setAttributeNode, .{ .ce_reactions = true });
|
||||
pub const removeAttribute = bridge.function(Element.removeAttribute, .{ .ce_reactions = true });
|
||||
pub const toggleAttribute = bridge.function(Element.toggleAttribute, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const toggleAttribute = bridge.function(Element.toggleAttribute, .{ .ce_reactions = true });
|
||||
pub const getAttributeNames = bridge.function(Element.getAttributeNames, .{});
|
||||
pub const removeAttributeNode = bridge.function(Element.removeAttributeNode, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const removeAttributeNode = bridge.function(Element.removeAttributeNode, .{ .ce_reactions = true });
|
||||
pub const shadowRoot = bridge.accessor(Element.getShadowRoot, null, .{});
|
||||
pub const assignedSlot = bridge.accessor(Element.getAssignedSlot, null, .{});
|
||||
pub const attachShadow = bridge.function(_attachShadow, .{ .dom_exception = true });
|
||||
pub const insertAdjacentHTML = bridge.function(Element.insertAdjacentHTML, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const setHTMLUnsafe = bridge.function(Element.setHTMLUnsafe, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const insertAdjacentElement = bridge.function(Element.insertAdjacentElement, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const insertAdjacentText = bridge.function(Element.insertAdjacentText, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const attachShadow = bridge.function(_attachShadow, .{});
|
||||
pub const insertAdjacentHTML = bridge.function(Element.insertAdjacentHTML, .{ .ce_reactions = true });
|
||||
pub const setHTMLUnsafe = bridge.function(Element.setHTMLUnsafe, .{ .ce_reactions = true });
|
||||
pub const insertAdjacentElement = bridge.function(Element.insertAdjacentElement, .{ .ce_reactions = true });
|
||||
pub const insertAdjacentText = bridge.function(Element.insertAdjacentText, .{ .ce_reactions = true });
|
||||
|
||||
const ShadowRootInit = struct {
|
||||
mode: String,
|
||||
@@ -2024,23 +2024,23 @@ pub const JsApi = struct {
|
||||
.serializable = init.serializable,
|
||||
}, frame);
|
||||
}
|
||||
pub const replaceChildren = bridge.function(Element.replaceChildren, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const replaceWith = bridge.function(Element.replaceWith, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const replaceChildren = bridge.function(Element.replaceChildren, .{ .ce_reactions = true });
|
||||
pub const replaceWith = bridge.function(Element.replaceWith, .{ .ce_reactions = true });
|
||||
pub const remove = bridge.function(Element.remove, .{ .ce_reactions = true });
|
||||
pub const append = bridge.function(Element.append, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const prepend = bridge.function(Element.prepend, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const moveBefore = bridge.function(Element.moveBefore, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const before = bridge.function(Element.before, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const after = bridge.function(Element.after, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const append = bridge.function(Element.append, .{ .ce_reactions = true });
|
||||
pub const prepend = bridge.function(Element.prepend, .{ .ce_reactions = true });
|
||||
pub const moveBefore = bridge.function(Element.moveBefore, .{ .ce_reactions = true });
|
||||
pub const before = bridge.function(Element.before, .{ .ce_reactions = true });
|
||||
pub const after = bridge.function(Element.after, .{ .ce_reactions = true });
|
||||
pub const firstElementChild = bridge.accessor(Element.firstElementChild, null, .{});
|
||||
pub const lastElementChild = bridge.accessor(Element.lastElementChild, null, .{});
|
||||
pub const nextElementSibling = bridge.accessor(Element.nextElementSibling, null, .{});
|
||||
pub const previousElementSibling = bridge.accessor(Element.previousElementSibling, null, .{});
|
||||
pub const childElementCount = bridge.accessor(Element.getChildElementCount, null, .{});
|
||||
pub const matches = bridge.function(Element.matches, .{ .dom_exception = true });
|
||||
pub const querySelector = bridge.function(Element.querySelector, .{ .dom_exception = true });
|
||||
pub const querySelectorAll = bridge.function(Element.querySelectorAll, .{ .dom_exception = true });
|
||||
pub const closest = bridge.function(Element.closest, .{ .dom_exception = true });
|
||||
pub const matches = bridge.function(Element.matches, .{});
|
||||
pub const querySelector = bridge.function(Element.querySelector, .{});
|
||||
pub const querySelectorAll = bridge.function(Element.querySelectorAll, .{});
|
||||
pub const closest = bridge.function(Element.closest, .{});
|
||||
pub const getAnimations = bridge.function(Element.getAnimations, .{});
|
||||
pub const animate = bridge.function(Element.animate, .{});
|
||||
pub const checkVisibility = bridge.function(Element.checkVisibility, .{});
|
||||
|
||||
@@ -204,7 +204,7 @@ pub const JsApi = struct {
|
||||
};
|
||||
|
||||
pub const constructor = bridge.constructor(EventTarget.init, .{});
|
||||
pub const dispatchEvent = bridge.function(EventTarget.dispatchEvent, .{ .dom_exception = true });
|
||||
pub const dispatchEvent = bridge.function(EventTarget.dispatchEvent, .{});
|
||||
pub const addEventListener = bridge.function(EventTarget.addEventListener, .{});
|
||||
pub const removeEventListener = bridge.function(EventTarget.removeEventListener, .{});
|
||||
};
|
||||
|
||||
@@ -342,10 +342,10 @@ pub const JsApi = struct {
|
||||
pub const onprogress = bridge.accessor(FileReader.getOnProgress, FileReader.setOnProgress, .{});
|
||||
|
||||
// Methods
|
||||
pub const readAsArrayBuffer = bridge.function(FileReader.readAsArrayBuffer, .{ .dom_exception = true });
|
||||
pub const readAsBinaryString = bridge.function(FileReader.readAsBinaryString, .{ .dom_exception = true });
|
||||
pub const readAsText = bridge.function(FileReader.readAsText, .{ .dom_exception = true });
|
||||
pub const readAsDataURL = bridge.function(FileReader.readAsDataURL, .{ .dom_exception = true });
|
||||
pub const readAsArrayBuffer = bridge.function(FileReader.readAsArrayBuffer, .{});
|
||||
pub const readAsBinaryString = bridge.function(FileReader.readAsBinaryString, .{});
|
||||
pub const readAsText = bridge.function(FileReader.readAsText, .{});
|
||||
pub const readAsDataURL = bridge.function(FileReader.readAsDataURL, .{});
|
||||
pub const abort = bridge.function(FileReader.abort, .{});
|
||||
};
|
||||
|
||||
|
||||
@@ -264,7 +264,7 @@ pub const JsApi = struct {
|
||||
|
||||
pub const dir = bridge.accessor(HTMLDocument.getDir, HTMLDocument.setDir, .{ .ce_reactions = true });
|
||||
pub const head = bridge.accessor(HTMLDocument.getHead, null, .{});
|
||||
pub const body = bridge.accessor(HTMLDocument.getBody, HTMLDocument.setBody, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const body = bridge.accessor(HTMLDocument.getBody, HTMLDocument.setBody, .{ .ce_reactions = true });
|
||||
pub const lang = bridge.accessor(HTMLDocument.getLang, HTMLDocument.setLang, .{});
|
||||
pub const title = bridge.accessor(HTMLDocument.getTitle, HTMLDocument.setTitle, .{ .ce_reactions = true });
|
||||
pub const images = bridge.accessor(HTMLDocument.getImages, null, .{});
|
||||
|
||||
@@ -127,7 +127,7 @@ pub const JsApi = struct {
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const constructor = bridge.constructor(ImageData.init, .{ .dom_exception = true });
|
||||
pub const constructor = bridge.constructor(ImageData.init, .{});
|
||||
|
||||
pub const colorSpace = bridge.property("srgb", .{ .template = false, .readonly = true });
|
||||
pub const pixelFormat = bridge.property("rgba-unorm8", .{ .template = false, .readonly = true });
|
||||
|
||||
@@ -192,7 +192,7 @@ pub const JsApi = struct {
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
};
|
||||
|
||||
pub const postMessage = bridge.function(MessagePort.postMessage, .{ .dom_exception = true });
|
||||
pub const postMessage = bridge.function(MessagePort.postMessage, .{});
|
||||
pub const start = bridge.function(MessagePort.start, .{});
|
||||
pub const close = bridge.function(MessagePort.close, .{});
|
||||
|
||||
|
||||
@@ -233,10 +233,7 @@ pub const JsApi = struct {
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const registerTool = bridge.function(
|
||||
ModelContext.registerTool,
|
||||
.{ .dom_exception = true },
|
||||
);
|
||||
pub const registerTool = bridge.function(ModelContext.registerTool, .{});
|
||||
};
|
||||
|
||||
const testing = @import("../../testing.zig");
|
||||
|
||||
@@ -254,8 +254,8 @@ pub const JsApi = struct {
|
||||
// window only
|
||||
pub const plugins = bridge.accessor(Navigator.getPlugins, null, .{ .exposed = .window });
|
||||
pub const modelContext = bridge.accessor(Navigator.getModelContext, null, .{ .exposed = .window });
|
||||
pub const registerProtocolHandler = bridge.function(Navigator.registerProtocolHandler, .{ .dom_exception = true, .exposed = .window });
|
||||
pub const unregisterProtocolHandler = bridge.function(Navigator.unregisterProtocolHandler, .{ .dom_exception = true, .exposed = .window });
|
||||
pub const registerProtocolHandler = bridge.function(Navigator.registerProtocolHandler, .{ .exposed = .window });
|
||||
pub const unregisterProtocolHandler = bridge.function(Navigator.unregisterProtocolHandler, .{ .exposed = .window });
|
||||
};
|
||||
|
||||
const testing = @import("../../testing.zig");
|
||||
|
||||
@@ -1329,19 +1329,19 @@ pub const JsApi = struct {
|
||||
pub const previousSibling = bridge.accessor(Node.previousSibling, null, .{});
|
||||
pub const parentNode = bridge.accessor(Node.parentNode, null, .{});
|
||||
pub const parentElement = bridge.accessor(Node.parentElement, null, .{});
|
||||
pub const appendChild = bridge.function(Node.appendChild, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const appendChild = bridge.function(Node.appendChild, .{ .ce_reactions = true });
|
||||
pub const childNodes = bridge.accessor(Node.childNodes, null, .{ .cache = .{ .private = "child_nodes" } });
|
||||
pub const isConnected = bridge.accessor(Node.isConnected, null, .{});
|
||||
pub const ownerDocument = bridge.accessor(Node.ownerDocument, null, .{});
|
||||
pub const hasChildNodes = bridge.function(Node.hasChildNodes, .{});
|
||||
pub const isSameNode = bridge.function(Node.isSameNode, .{});
|
||||
pub const contains = bridge.function(Node.contains, .{});
|
||||
pub const removeChild = bridge.function(Node.removeChild, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const removeChild = bridge.function(Node.removeChild, .{ .ce_reactions = true });
|
||||
pub const nodeValue = bridge.accessor(Node.getNodeValue, Node.setNodeValue, .{ .ce_reactions = true });
|
||||
pub const insertBefore = bridge.function(Node.insertBefore, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const replaceChild = bridge.function(Node.replaceChild, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const insertBefore = bridge.function(Node.insertBefore, .{ .ce_reactions = true });
|
||||
pub const replaceChild = bridge.function(Node.replaceChild, .{ .ce_reactions = true });
|
||||
pub const normalize = bridge.function(Node.normalize, .{ .ce_reactions = true });
|
||||
pub const cloneNode = bridge.function(Node.cloneNode, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const cloneNode = bridge.function(Node.cloneNode, .{ .ce_reactions = true });
|
||||
pub const compareDocumentPosition = bridge.function(Node.compareDocumentPosition, .{});
|
||||
pub const getRootNode = bridge.function(_getRootNode, .{});
|
||||
// The `options` argument is optional in JS; default it before calling the
|
||||
|
||||
@@ -357,7 +357,7 @@ pub const JsApi = struct {
|
||||
|
||||
pub const now = bridge.function(Performance.now, .{});
|
||||
pub const mark = bridge.function(Performance.mark, .{});
|
||||
pub const measure = bridge.function(Performance.measure, .{ .dom_exception = true });
|
||||
pub const measure = bridge.function(Performance.measure, .{});
|
||||
pub const clearMarks = bridge.function(Performance.clearMarks, .{});
|
||||
pub const clearMeasures = bridge.function(Performance.clearMeasures, .{});
|
||||
pub const setResourceTimingBufferSize = bridge.function(Performance.setResourceTimingBufferSize, .{ .noop = true });
|
||||
|
||||
@@ -197,11 +197,11 @@ pub const JsApi = struct {
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const constructor = bridge.constructor(PerformanceObserver.init, .{ .dom_exception = true });
|
||||
pub const constructor = bridge.constructor(PerformanceObserver.init, .{});
|
||||
|
||||
pub const observe = bridge.function(PerformanceObserver.observe, .{ .dom_exception = true });
|
||||
pub const observe = bridge.function(PerformanceObserver.observe, .{});
|
||||
pub const disconnect = bridge.function(PerformanceObserver.disconnect, .{});
|
||||
pub const takeRecords = bridge.function(PerformanceObserver.takeRecords, .{ .dom_exception = true });
|
||||
pub const takeRecords = bridge.function(PerformanceObserver.takeRecords, .{});
|
||||
pub const supportedEntryTypes = bridge.accessor(PerformanceObserver.getSupportedEntryTypes, null, .{ .static = true });
|
||||
};
|
||||
|
||||
|
||||
@@ -108,5 +108,5 @@ pub const JsApi = struct {
|
||||
pub const empty_with_no_proto = true;
|
||||
};
|
||||
|
||||
pub const query = bridge.function(Permissions.query, .{ .dom_exception = true });
|
||||
pub const query = bridge.function(Permissions.query, .{});
|
||||
};
|
||||
|
||||
@@ -708,28 +708,28 @@ pub const JsApi = struct {
|
||||
|
||||
pub const constructor = bridge.constructor(Range.init, .{});
|
||||
pub const commonAncestorContainer = bridge.accessor(Range.getCommonAncestorContainer, null, .{});
|
||||
pub const setStart = bridge.function(Range.setStart, .{ .dom_exception = true });
|
||||
pub const setEnd = bridge.function(Range.setEnd, .{ .dom_exception = true });
|
||||
pub const setStartBefore = bridge.function(Range.setStartBefore, .{ .dom_exception = true });
|
||||
pub const setStartAfter = bridge.function(Range.setStartAfter, .{ .dom_exception = true });
|
||||
pub const setEndBefore = bridge.function(Range.setEndBefore, .{ .dom_exception = true });
|
||||
pub const setEndAfter = bridge.function(Range.setEndAfter, .{ .dom_exception = true });
|
||||
pub const selectNode = bridge.function(Range.selectNode, .{ .dom_exception = true });
|
||||
pub const setStart = bridge.function(Range.setStart, .{});
|
||||
pub const setEnd = bridge.function(Range.setEnd, .{});
|
||||
pub const setStartBefore = bridge.function(Range.setStartBefore, .{});
|
||||
pub const setStartAfter = bridge.function(Range.setStartAfter, .{});
|
||||
pub const setEndBefore = bridge.function(Range.setEndBefore, .{});
|
||||
pub const setEndAfter = bridge.function(Range.setEndAfter, .{});
|
||||
pub const selectNode = bridge.function(Range.selectNode, .{});
|
||||
pub const selectNodeContents = bridge.function(Range.selectNodeContents, .{});
|
||||
pub const collapse = bridge.function(Range.collapse, .{ .dom_exception = true });
|
||||
pub const collapse = bridge.function(Range.collapse, .{});
|
||||
pub const detach = bridge.function(Range.detach, .{});
|
||||
pub const compareBoundaryPoints = bridge.function(Range.compareBoundaryPoints, .{ .dom_exception = true });
|
||||
pub const comparePoint = bridge.function(Range.comparePoint, .{ .dom_exception = true });
|
||||
pub const isPointInRange = bridge.function(Range.isPointInRange, .{ .dom_exception = true });
|
||||
pub const compareBoundaryPoints = bridge.function(Range.compareBoundaryPoints, .{});
|
||||
pub const comparePoint = bridge.function(Range.comparePoint, .{});
|
||||
pub const isPointInRange = bridge.function(Range.isPointInRange, .{});
|
||||
pub const intersectsNode = bridge.function(Range.intersectsNode, .{});
|
||||
pub const cloneRange = bridge.function(Range.cloneRange, .{ .dom_exception = true });
|
||||
pub const insertNode = bridge.function(Range.insertNode, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const deleteContents = bridge.function(Range.deleteContents, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const cloneContents = bridge.function(Range.cloneContents, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const extractContents = bridge.function(Range.extractContents, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const surroundContents = bridge.function(Range.surroundContents, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const createContextualFragment = bridge.function(Range.createContextualFragment, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const toString = bridge.function(Range.toString, .{ .dom_exception = true });
|
||||
pub const cloneRange = bridge.function(Range.cloneRange, .{});
|
||||
pub const insertNode = bridge.function(Range.insertNode, .{ .ce_reactions = true });
|
||||
pub const deleteContents = bridge.function(Range.deleteContents, .{ .ce_reactions = true });
|
||||
pub const cloneContents = bridge.function(Range.cloneContents, .{ .ce_reactions = true });
|
||||
pub const extractContents = bridge.function(Range.extractContents, .{ .ce_reactions = true });
|
||||
pub const surroundContents = bridge.function(Range.surroundContents, .{ .ce_reactions = true });
|
||||
pub const createContextualFragment = bridge.function(Range.createContextualFragment, .{ .ce_reactions = true });
|
||||
pub const toString = bridge.function(Range.toString, .{});
|
||||
pub const getBoundingClientRect = bridge.function(Range.getBoundingClientRect, .{});
|
||||
pub const getClientRects = bridge.function(Range.getClientRects, .{});
|
||||
};
|
||||
|
||||
@@ -730,21 +730,21 @@ pub const JsApi = struct {
|
||||
pub const @"type" = bridge.accessor(Selection.getType, null, .{});
|
||||
|
||||
pub const addRange = bridge.function(Selection.addRange, .{});
|
||||
pub const collapse = bridge.function(Selection.collapse, .{ .dom_exception = true });
|
||||
pub const collapse = bridge.function(Selection.collapse, .{});
|
||||
pub const collapseToEnd = bridge.function(Selection.collapseToEnd, .{});
|
||||
pub const collapseToStart = bridge.function(Selection.collapseToStart, .{ .dom_exception = true });
|
||||
pub const collapseToStart = bridge.function(Selection.collapseToStart, .{});
|
||||
pub const containsNode = bridge.function(Selection.containsNode, .{});
|
||||
pub const deleteFromDocument = bridge.function(Selection.deleteFromDocument, .{ .ce_reactions = true });
|
||||
pub const empty = bridge.function(Selection.removeAllRanges, .{});
|
||||
pub const extend = bridge.function(Selection.extend, .{ .dom_exception = true });
|
||||
pub const extend = bridge.function(Selection.extend, .{});
|
||||
// unimplemented: getComposedRanges
|
||||
pub const getRangeAt = bridge.function(Selection.getRangeAt, .{ .dom_exception = true });
|
||||
pub const getRangeAt = bridge.function(Selection.getRangeAt, .{});
|
||||
pub const modify = bridge.function(Selection.modify, .{});
|
||||
pub const removeAllRanges = bridge.function(Selection.removeAllRanges, .{});
|
||||
pub const removeRange = bridge.function(Selection.removeRange, .{ .dom_exception = true });
|
||||
pub const selectAllChildren = bridge.function(Selection.selectAllChildren, .{ .dom_exception = true });
|
||||
pub const setBaseAndExtent = bridge.function(Selection.setBaseAndExtent, .{ .dom_exception = true });
|
||||
pub const setPosition = bridge.function(Selection.collapse, .{ .dom_exception = true });
|
||||
pub const removeRange = bridge.function(Selection.removeRange, .{});
|
||||
pub const selectAllChildren = bridge.function(Selection.selectAllChildren, .{});
|
||||
pub const setBaseAndExtent = bridge.function(Selection.setBaseAndExtent, .{});
|
||||
pub const setPosition = bridge.function(Selection.collapse, .{});
|
||||
pub const toString = bridge.function(Selection.toString, .{});
|
||||
};
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ pub const JsApi = struct {
|
||||
return self.getElementById(try value.toZig([]const u8), frame);
|
||||
}
|
||||
pub const adoptedStyleSheets = bridge.accessor(ShadowRoot.getAdoptedStyleSheets, ShadowRoot.setAdoptedStyleSheets, .{});
|
||||
pub const setHTMLUnsafe = bridge.function(ShadowRoot.setHTMLUnsafe, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const setHTMLUnsafe = bridge.function(ShadowRoot.setHTMLUnsafe, .{ .ce_reactions = true });
|
||||
pub const onslotchange = bridge.accessor(ShadowRoot.getOnSlotChange, ShadowRoot.setOnSlotChange, .{});
|
||||
};
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ pub const JsApi = struct {
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const constructor = bridge.constructor(StaticRange.init, .{ .dom_exception = true });
|
||||
pub const constructor = bridge.constructor(StaticRange.init, .{});
|
||||
};
|
||||
|
||||
const testing = @import("../../testing.zig");
|
||||
|
||||
@@ -569,14 +569,14 @@ pub const JsApi = struct {
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
};
|
||||
|
||||
pub const generateKey = bridge.function(SubtleCrypto.generateKey, .{ .dom_exception = true });
|
||||
pub const importKey = bridge.function(SubtleCrypto.importKey, .{ .dom_exception = true });
|
||||
pub const exportKey = bridge.function(SubtleCrypto.exportKey, .{ .dom_exception = true });
|
||||
pub const encrypt = bridge.function(SubtleCrypto.encrypt, .{ .dom_exception = true });
|
||||
pub const decrypt = bridge.function(SubtleCrypto.decrypt, .{ .dom_exception = true });
|
||||
pub const sign = bridge.function(SubtleCrypto.sign, .{ .dom_exception = true });
|
||||
pub const verify = bridge.function(SubtleCrypto.verify, .{ .dom_exception = true });
|
||||
pub const deriveBits = bridge.function(SubtleCrypto.deriveBits, .{ .dom_exception = true });
|
||||
pub const deriveKey = bridge.function(SubtleCrypto.deriveKey, .{ .dom_exception = true });
|
||||
pub const digest = bridge.function(SubtleCrypto.digest, .{ .dom_exception = true });
|
||||
pub const generateKey = bridge.function(SubtleCrypto.generateKey, .{});
|
||||
pub const importKey = bridge.function(SubtleCrypto.importKey, .{});
|
||||
pub const exportKey = bridge.function(SubtleCrypto.exportKey, .{});
|
||||
pub const encrypt = bridge.function(SubtleCrypto.encrypt, .{});
|
||||
pub const decrypt = bridge.function(SubtleCrypto.decrypt, .{});
|
||||
pub const sign = bridge.function(SubtleCrypto.sign, .{});
|
||||
pub const verify = bridge.function(SubtleCrypto.verify, .{});
|
||||
pub const deriveBits = bridge.function(SubtleCrypto.deriveBits, .{});
|
||||
pub const deriveKey = bridge.function(SubtleCrypto.deriveKey, .{});
|
||||
pub const digest = bridge.function(SubtleCrypto.digest, .{});
|
||||
};
|
||||
|
||||
@@ -1045,9 +1045,9 @@ pub const JsApi = struct {
|
||||
pub const requestIdleCallback = bridge.function(Window.requestIdleCallback, .{});
|
||||
pub const cancelIdleCallback = bridge.function(Window.cancelIdleCallback, .{});
|
||||
pub const matchMedia = bridge.function(Window.matchMedia, .{});
|
||||
pub const postMessage = bridge.function(Window.postMessage, .{ .dom_exception = true });
|
||||
pub const btoa = bridge.function(Window.btoa, .{ .dom_exception = true });
|
||||
pub const atob = bridge.function(Window.atob, .{ .dom_exception = true });
|
||||
pub const postMessage = bridge.function(Window.postMessage, .{});
|
||||
pub const btoa = bridge.function(Window.btoa, .{});
|
||||
pub const atob = bridge.function(Window.atob, .{});
|
||||
pub const reportError = bridge.function(Window.reportError, .{});
|
||||
pub const structuredClone = bridge.function(Window.structuredClone, .{});
|
||||
pub const getComputedStyle = bridge.function(Window.getComputedStyle, .{});
|
||||
@@ -1081,7 +1081,7 @@ pub const JsApi = struct {
|
||||
pub const opener = bridge.accessor(Window.getOpener, null, .{});
|
||||
pub const closed = bridge.accessor(Window.getClosed, null, .{});
|
||||
pub const name = bridge.accessor(Window.getName, Window.setName, .{});
|
||||
pub const open = bridge.function(Window.open, .{ .dom_exception = true });
|
||||
pub const open = bridge.function(Window.open, .{});
|
||||
pub const close = bridge.function(Window.close, .{});
|
||||
|
||||
pub const alert = bridge.function(struct {
|
||||
@@ -1159,7 +1159,7 @@ const CrossOriginWindow = struct {
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const postMessage = bridge.function(CrossOriginWindow.postMessage, .{ .dom_exception = true });
|
||||
pub const postMessage = bridge.function(CrossOriginWindow.postMessage, .{});
|
||||
pub const top = bridge.accessor(CrossOriginWindow.getTop, null, .{});
|
||||
pub const parent = bridge.accessor(CrossOriginWindow.getParent, null, .{});
|
||||
pub const length = bridge.accessor(CrossOriginWindow.getFramesLength, null, .{});
|
||||
|
||||
@@ -553,12 +553,12 @@ pub const JsApi = struct {
|
||||
pub const onrejectionhandled = bridge.accessor(WorkerGlobalScope.getOnRejectionHandled, WorkerGlobalScope.setOnRejectionHandled, .{});
|
||||
pub const onunhandledrejection = bridge.accessor(WorkerGlobalScope.getOnUnhandledRejection, WorkerGlobalScope.setOnUnhandledRejection, .{});
|
||||
|
||||
pub const btoa = bridge.function(WorkerGlobalScope.btoa, .{ .dom_exception = true });
|
||||
pub const atob = bridge.function(WorkerGlobalScope.atob, .{ .dom_exception = true });
|
||||
pub const btoa = bridge.function(WorkerGlobalScope.btoa, .{});
|
||||
pub const atob = bridge.function(WorkerGlobalScope.atob, .{});
|
||||
pub const structuredClone = bridge.function(WorkerGlobalScope.structuredClone, .{});
|
||||
pub const reportError = bridge.function(WorkerGlobalScope.reportError, .{});
|
||||
pub const fetch = bridge.function(WorkerGlobalScope.fetch, .{});
|
||||
pub const importScripts = bridge.function(WorkerGlobalScope.importScripts, .{ .dom_exception = true });
|
||||
pub const importScripts = bridge.function(WorkerGlobalScope.importScripts, .{});
|
||||
pub const queueMicrotask = bridge.function(WorkerGlobalScope.queueMicrotask, .{});
|
||||
pub const setTimeout = bridge.function(WorkerGlobalScope.setTimeout, .{});
|
||||
pub const clearTimeout = bridge.function(WorkerGlobalScope.clearTimeout, .{});
|
||||
|
||||
@@ -83,8 +83,8 @@ pub const JsApi = struct {
|
||||
};
|
||||
|
||||
pub const constructor = bridge.constructor(XPathEvaluator.init, .{});
|
||||
pub const evaluate = bridge.function(XPathEvaluator.evaluate, .{ .dom_exception = true });
|
||||
pub const createExpression = bridge.function(XPathEvaluator.createExpression, .{ .dom_exception = true });
|
||||
pub const evaluate = bridge.function(XPathEvaluator.evaluate, .{});
|
||||
pub const createExpression = bridge.function(XPathEvaluator.createExpression, .{});
|
||||
pub const createNSResolver = bridge.function(XPathEvaluator.createNSResolver, .{});
|
||||
};
|
||||
|
||||
|
||||
@@ -101,5 +101,5 @@ pub const JsApi = struct {
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const evaluate = bridge.function(XPathExpression.evaluate, .{ .dom_exception = true });
|
||||
pub const evaluate = bridge.function(XPathExpression.evaluate, .{});
|
||||
};
|
||||
|
||||
@@ -27,10 +27,10 @@
|
||||
//! `deinit` once the JS wrapper's refcount hits zero.
|
||||
//!
|
||||
//! Type-mismatch accessor calls return `error.InvalidStateError` —
|
||||
//! translated to a `DOMException` by `bridge.function(.., .{
|
||||
//! .dom_exception = true })`. The WHATWG IDL technically specifies
|
||||
//! `TypeError` for type mismatches, but `InvalidStateError` is what
|
||||
//! decision #4 captures and what most legacy XPath consumers expect.
|
||||
//! translated to a `DOMException` by the bridge. The WHATWG IDL
|
||||
//! technically specifies `TypeError` for type mismatches, but
|
||||
//! `InvalidStateError` is what decision #4 captures and what most
|
||||
//! legacy XPath consumers expect.
|
||||
|
||||
const std = @import("std");
|
||||
const lp = @import("lightpanda");
|
||||
@@ -261,15 +261,15 @@ pub const JsApi = struct {
|
||||
pub const FIRST_ORDERED_NODE_TYPE = bridge.property(XPathResult.FIRST_ORDERED_NODE_TYPE, .{ .template = true });
|
||||
|
||||
pub const resultType = bridge.accessor(XPathResult.getResultType, null, .{});
|
||||
pub const numberValue = bridge.accessor(XPathResult.getNumberValue, null, .{ .dom_exception = true });
|
||||
pub const stringValue = bridge.accessor(XPathResult.getStringValue, null, .{ .dom_exception = true });
|
||||
pub const booleanValue = bridge.accessor(XPathResult.getBooleanValue, null, .{ .dom_exception = true });
|
||||
pub const singleNodeValue = bridge.accessor(XPathResult.getSingleNodeValue, null, .{ .dom_exception = true });
|
||||
pub const snapshotLength = bridge.accessor(XPathResult.getSnapshotLength, null, .{ .dom_exception = true });
|
||||
pub const numberValue = bridge.accessor(XPathResult.getNumberValue, null, .{});
|
||||
pub const stringValue = bridge.accessor(XPathResult.getStringValue, null, .{});
|
||||
pub const booleanValue = bridge.accessor(XPathResult.getBooleanValue, null, .{});
|
||||
pub const singleNodeValue = bridge.accessor(XPathResult.getSingleNodeValue, null, .{});
|
||||
pub const snapshotLength = bridge.accessor(XPathResult.getSnapshotLength, null, .{});
|
||||
pub const invalidIteratorState = bridge.accessor(XPathResult.getInvalidIteratorState, null, .{});
|
||||
|
||||
pub const iterateNext = bridge.function(XPathResult.iterateNext, .{ .dom_exception = true });
|
||||
pub const snapshotItem = bridge.function(XPathResult.snapshotItem, .{ .dom_exception = true });
|
||||
pub const iterateNext = bridge.function(XPathResult.iterateNext, .{});
|
||||
pub const snapshotItem = bridge.function(XPathResult.snapshotItem, .{});
|
||||
};
|
||||
|
||||
const testing = @import("../../testing.zig");
|
||||
|
||||
@@ -151,11 +151,11 @@ pub const JsApi = struct {
|
||||
pub const textBaseline = bridge.property("alphabetic", .{ .template = false, .readonly = false });
|
||||
|
||||
pub const fillStyle = bridge.accessor(CanvasRenderingContext2D.getFillStyle, CanvasRenderingContext2D.setFillStyle, .{});
|
||||
pub const createImageData = bridge.function(CanvasRenderingContext2D.createImageData, .{ .dom_exception = true });
|
||||
pub const createImageData = bridge.function(CanvasRenderingContext2D.createImageData, .{});
|
||||
|
||||
pub const putImageData = bridge.function(CanvasRenderingContext2D.putImageData, .{ .noop = true });
|
||||
pub const drawImage = bridge.function(CanvasRenderingContext2D.drawImage, .{ .noop = true });
|
||||
pub const getImageData = bridge.function(CanvasRenderingContext2D.getImageData, .{ .dom_exception = true });
|
||||
pub const getImageData = bridge.function(CanvasRenderingContext2D.getImageData, .{});
|
||||
pub const save = bridge.function(CanvasRenderingContext2D.save, .{ .noop = true });
|
||||
pub const restore = bridge.function(CanvasRenderingContext2D.restore, .{ .noop = true });
|
||||
pub const scale = bridge.function(CanvasRenderingContext2D.scale, .{ .noop = true });
|
||||
|
||||
@@ -137,10 +137,10 @@ pub const JsApi = struct {
|
||||
pub const textBaseline = bridge.property("alphabetic", .{ .template = false, .readonly = false });
|
||||
|
||||
pub const fillStyle = bridge.accessor(OffscreenCanvasRenderingContext2D.getFillStyle, OffscreenCanvasRenderingContext2D.setFillStyle, .{});
|
||||
pub const createImageData = bridge.function(OffscreenCanvasRenderingContext2D.createImageData, .{ .dom_exception = true });
|
||||
pub const createImageData = bridge.function(OffscreenCanvasRenderingContext2D.createImageData, .{});
|
||||
|
||||
pub const putImageData = bridge.function(OffscreenCanvasRenderingContext2D.putImageData, .{ .noop = true });
|
||||
pub const getImageData = bridge.function(OffscreenCanvasRenderingContext2D.getImageData, .{ .dom_exception = true });
|
||||
pub const getImageData = bridge.function(OffscreenCanvasRenderingContext2D.getImageData, .{});
|
||||
pub const save = bridge.function(OffscreenCanvasRenderingContext2D.save, .{ .noop = true });
|
||||
pub const restore = bridge.function(OffscreenCanvasRenderingContext2D.restore, .{ .noop = true });
|
||||
pub const scale = bridge.function(OffscreenCanvasRenderingContext2D.scale, .{ .noop = true });
|
||||
|
||||
@@ -83,5 +83,5 @@ pub const JsApi = struct {
|
||||
pub const constructor = bridge.constructor(Text.init, .{});
|
||||
pub const wholeText = bridge.accessor(Text.getWholeText, null, .{});
|
||||
pub const assignedSlot = bridge.accessor(Text.getAssignedSlot, null, .{});
|
||||
pub const splitText = bridge.function(Text.splitText, .{ .dom_exception = true });
|
||||
pub const splitText = bridge.function(Text.splitText, .{});
|
||||
};
|
||||
|
||||
@@ -325,12 +325,12 @@ pub const JsApi = struct {
|
||||
return self.item(@intCast(index), frame);
|
||||
}
|
||||
|
||||
pub const contains = bridge.function(DOMTokenList.contains, .{ .dom_exception = true });
|
||||
pub const supports = bridge.function(DOMTokenList.supports, .{ .dom_exception = true });
|
||||
pub const add = bridge.function(DOMTokenList.add, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const remove = bridge.function(DOMTokenList.remove, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const toggle = bridge.function(DOMTokenList.toggle, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const replace = bridge.function(DOMTokenList.replace, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const contains = bridge.function(DOMTokenList.contains, .{});
|
||||
pub const supports = bridge.function(DOMTokenList.supports, .{});
|
||||
pub const add = bridge.function(DOMTokenList.add, .{ .ce_reactions = true });
|
||||
pub const remove = bridge.function(DOMTokenList.remove, .{ .ce_reactions = true });
|
||||
pub const toggle = bridge.function(DOMTokenList.toggle, .{ .ce_reactions = true });
|
||||
pub const replace = bridge.function(DOMTokenList.replace, .{ .ce_reactions = true });
|
||||
pub const value = bridge.accessor(DOMTokenList.getValue, DOMTokenList.setValue, .{ .ce_reactions = true });
|
||||
pub const toString = bridge.function(DOMTokenList.getValue, .{});
|
||||
pub const keys = bridge.function(DOMTokenList.keys, .{});
|
||||
|
||||
@@ -104,6 +104,6 @@ pub const JsApi = struct {
|
||||
pub const @"[str]" = bridge.namedIndexed(HTMLOptionsCollection.getByName, null, null, .{ .null_as_undefined = true });
|
||||
|
||||
pub const selectedIndex = bridge.accessor(HTMLOptionsCollection.getSelectedIndex, HTMLOptionsCollection.setSelectedIndex, .{});
|
||||
pub const add = bridge.function(HTMLOptionsCollection.add, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const add = bridge.function(HTMLOptionsCollection.add, .{ .ce_reactions = true });
|
||||
pub const remove = bridge.function(HTMLOptionsCollection.remove, .{ .ce_reactions = true });
|
||||
};
|
||||
|
||||
@@ -207,8 +207,8 @@ pub const JsApi = struct {
|
||||
pub const disabled = bridge.accessor(CSSStyleSheet.getDisabled, CSSStyleSheet.setDisabled, .{});
|
||||
pub const cssRules = bridge.accessor(CSSStyleSheet.getCssRules, null, .{});
|
||||
pub const ownerRule = bridge.accessor(CSSStyleSheet.getOwnerRule, null, .{});
|
||||
pub const insertRule = bridge.function(CSSStyleSheet.insertRule, .{ .dom_exception = true });
|
||||
pub const deleteRule = bridge.function(CSSStyleSheet.deleteRule, .{ .dom_exception = true });
|
||||
pub const insertRule = bridge.function(CSSStyleSheet.insertRule, .{});
|
||||
pub const deleteRule = bridge.function(CSSStyleSheet.deleteRule, .{});
|
||||
pub const replace = bridge.function(CSSStyleSheet.replace, .{});
|
||||
pub const replaceSync = bridge.function(CSSStyleSheet.replaceSync, .{});
|
||||
};
|
||||
|
||||
@@ -1654,11 +1654,11 @@ pub const JsApi = struct {
|
||||
// `[LegacyNullToEmptyString]`: a JS null becomes "", not "null".
|
||||
return self.setInnerText(if (value.isNull()) "" else try value.toZig([]const u8), frame);
|
||||
}
|
||||
pub const outerText = bridge.accessor(_innerText, _setOuterText, .{ .ce_reactions = true, .dom_exception = true });
|
||||
pub const outerText = bridge.accessor(_innerText, _setOuterText, .{ .ce_reactions = true });
|
||||
fn _setOuterText(self: *HtmlElement, value: js.Value, frame: *Frame) !void {
|
||||
return self.setOuterText(if (value.isNull()) "" else try value.toZig([]const u8), frame);
|
||||
}
|
||||
pub const insertAdjacentHTML = bridge.function(HtmlElement.insertAdjacentHTML, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const insertAdjacentHTML = bridge.function(HtmlElement.insertAdjacentHTML, .{ .ce_reactions = true });
|
||||
pub const click = bridge.function(HtmlElement.click, .{});
|
||||
|
||||
pub const accessKey = bridge.accessor(HtmlElement.getAccessKey, HtmlElement.setAccessKey, .{ .ce_reactions = true });
|
||||
@@ -1666,9 +1666,9 @@ pub const JsApi = struct {
|
||||
pub const dir = bridge.accessor(HtmlElement.getDir, HtmlElement.setDir, .{ .ce_reactions = true });
|
||||
pub const hidden = bridge.accessor(HtmlElement.getHidden, HtmlElement.setHidden, .{ .ce_reactions = true });
|
||||
pub const popover = bridge.accessor(HtmlElement.getPopover, HtmlElement.setPopover, .{ .ce_reactions = true });
|
||||
pub const showPopover = bridge.function(HtmlElement.showPopover, .{ .dom_exception = true });
|
||||
pub const hidePopover = bridge.function(HtmlElement.hidePopover, .{ .dom_exception = true });
|
||||
pub const togglePopover = bridge.function(HtmlElement.togglePopover, .{ .dom_exception = true });
|
||||
pub const showPopover = bridge.function(HtmlElement.showPopover, .{});
|
||||
pub const hidePopover = bridge.function(HtmlElement.hidePopover, .{});
|
||||
pub const togglePopover = bridge.function(HtmlElement.togglePopover, .{});
|
||||
pub const isContentEditable = bridge.accessor(HtmlElement.getIsContentEditable, null, .{});
|
||||
pub const lang = bridge.accessor(HtmlElement.getLang, HtmlElement.setLang, .{ .ce_reactions = true });
|
||||
pub const nonce = bridge.accessor(HtmlElement.getNonce, HtmlElement.setNonce, .{ .ce_reactions = true });
|
||||
|
||||
@@ -84,7 +84,7 @@ pub const JsApi = struct {
|
||||
pub const returnValue = bridge.accessor(Dialog.getReturnValue, Dialog.setReturnValue, .{});
|
||||
|
||||
pub const show = bridge.function(Dialog.show, .{});
|
||||
pub const showModal = bridge.function(Dialog.showModal, .{ .dom_exception = true });
|
||||
pub const showModal = bridge.function(Dialog.showModal, .{});
|
||||
pub const close = bridge.function(Dialog.close, .{});
|
||||
};
|
||||
|
||||
|
||||
@@ -258,7 +258,7 @@ pub const JsApi = struct {
|
||||
pub const elements = bridge.accessor(Form.getElements, null, .{});
|
||||
pub const length = bridge.accessor(Form.getLength, null, .{});
|
||||
pub const submit = bridge.function(Form.submit, .{});
|
||||
pub const requestSubmit = bridge.function(Form.requestSubmit, .{ .dom_exception = true });
|
||||
pub const requestSubmit = bridge.function(Form.requestSubmit, .{});
|
||||
pub const checkValidity = bridge.function(Form.checkValidity, .{});
|
||||
pub const reportValidity = bridge.function(Form.reportValidity, .{});
|
||||
};
|
||||
|
||||
@@ -1408,7 +1408,7 @@ pub const JsApi = struct {
|
||||
|
||||
pub const onselectionchange = bridge.accessor(Input.getOnSelectionChange, Input.setOnSelectionChange, .{});
|
||||
pub const @"type" = bridge.accessor(Input.getType, Input.setType, .{ .ce_reactions = true });
|
||||
pub const value = bridge.accessor(Input.getValueForJS, setValueFromJS, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const value = bridge.accessor(Input.getValueForJS, setValueFromJS, .{ .ce_reactions = true });
|
||||
pub const files = bridge.accessor(Input.getFiles, null, .{});
|
||||
pub const defaultValue = bridge.accessor(Input.getDefaultValue, Input.setDefaultValue, .{ .ce_reactions = true });
|
||||
pub const checked = bridge.accessor(Input.getChecked, Input.setChecked, .{});
|
||||
@@ -1419,8 +1419,8 @@ pub const JsApi = struct {
|
||||
pub const accept = bridge.accessor(Input.getAccept, Input.setAccept, .{ .ce_reactions = true });
|
||||
pub const readOnly = bridge.accessor(Input.getReadonly, Input.setReadonly, .{ .ce_reactions = true });
|
||||
pub const alt = bridge.accessor(Input.getAlt, Input.setAlt, .{ .ce_reactions = true });
|
||||
pub const maxLength = bridge.accessor(Input.getMaxLength, Input.setMaxLength, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const minLength = bridge.accessor(Input.getMinLength, Input.setMinLength, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const maxLength = bridge.accessor(Input.getMaxLength, Input.setMaxLength, .{ .ce_reactions = true });
|
||||
pub const minLength = bridge.accessor(Input.getMinLength, Input.setMinLength, .{ .ce_reactions = true });
|
||||
pub const size = bridge.accessor(Input.getSize, Input.setSize, .{ .ce_reactions = true });
|
||||
pub const src = bridge.accessor(Input.getSrc, Input.setSrc, .{ .ce_reactions = true });
|
||||
pub const form = bridge.accessor(Input.getForm, null, .{});
|
||||
@@ -1451,7 +1451,7 @@ pub const JsApi = struct {
|
||||
pub const selectionStart = bridge.accessor(Input.getSelectionStart, Input.setSelectionStart, .{});
|
||||
pub const selectionEnd = bridge.accessor(Input.getSelectionEnd, Input.setSelectionEnd, .{});
|
||||
pub const selectionDirection = bridge.accessor(Input.getSelectionDirection, null, .{});
|
||||
pub const setSelectionRange = bridge.function(Input.setSelectionRange, .{ .dom_exception = true });
|
||||
pub const setSelectionRange = bridge.function(Input.setSelectionRange, .{});
|
||||
};
|
||||
|
||||
pub const Build = struct {
|
||||
|
||||
@@ -371,7 +371,7 @@ pub const JsApi = struct {
|
||||
pub const willValidate = bridge.accessor(Select.getWillValidate, null, .{});
|
||||
pub const validity = bridge.accessor(Select.getValidity, null, .{});
|
||||
pub const validationMessage = bridge.accessor(Select.getValidationMessage, null, .{});
|
||||
pub const add = bridge.function(Select.add, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const add = bridge.function(Select.add, .{ .ce_reactions = true });
|
||||
pub const checkValidity = bridge.function(Select.checkValidity, .{});
|
||||
pub const reportValidity = bridge.function(Select.reportValidity, .{});
|
||||
pub const setCustomValidity = bridge.function(Select.setCustomValidity, .{});
|
||||
|
||||
@@ -409,15 +409,15 @@ pub const JsApi = struct {
|
||||
pub const disabled = bridge.accessor(TextArea.getDisabled, TextArea.setDisabled, .{ .ce_reactions = true });
|
||||
pub const name = bridge.accessor(TextArea.getName, TextArea.setName, .{ .ce_reactions = true });
|
||||
pub const required = bridge.accessor(TextArea.getRequired, TextArea.setRequired, .{ .ce_reactions = true });
|
||||
pub const maxLength = bridge.accessor(TextArea.getMaxLength, TextArea.setMaxLength, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const minLength = bridge.accessor(TextArea.getMinLength, TextArea.setMinLength, .{ .dom_exception = true, .ce_reactions = true });
|
||||
pub const maxLength = bridge.accessor(TextArea.getMaxLength, TextArea.setMaxLength, .{ .ce_reactions = true });
|
||||
pub const minLength = bridge.accessor(TextArea.getMinLength, TextArea.setMinLength, .{ .ce_reactions = true });
|
||||
pub const form = bridge.accessor(TextArea.getForm, null, .{});
|
||||
pub const select = bridge.function(TextArea.select, .{});
|
||||
|
||||
pub const selectionStart = bridge.accessor(TextArea.getSelectionStart, TextArea.setSelectionStart, .{});
|
||||
pub const selectionEnd = bridge.accessor(TextArea.getSelectionEnd, TextArea.setSelectionEnd, .{});
|
||||
pub const selectionDirection = bridge.accessor(TextArea.getSelectionDirection, null, .{});
|
||||
pub const setSelectionRange = bridge.function(TextArea.setSelectionRange, .{ .dom_exception = true });
|
||||
pub const setSelectionRange = bridge.function(TextArea.setSelectionRange, .{});
|
||||
};
|
||||
|
||||
pub const Build = struct {
|
||||
|
||||
@@ -485,12 +485,12 @@ pub const JsApi = struct {
|
||||
pub const canGoForward = bridge.accessor(Navigation.getCanGoForward, null, .{});
|
||||
pub const currentEntry = bridge.accessor(Navigation.getCurrentEntry, null, .{});
|
||||
pub const transition = bridge.accessor(Navigation.getTransition, null, .{});
|
||||
pub const back = bridge.function(Navigation.back, .{ .dom_exception = true });
|
||||
pub const back = bridge.function(Navigation.back, .{});
|
||||
pub const entries = bridge.function(Navigation.entries, .{});
|
||||
pub const forward = bridge.function(Navigation.forward, .{ .dom_exception = true });
|
||||
pub const navigate = bridge.function(Navigation.navigate, .{ .dom_exception = true });
|
||||
pub const traverseTo = bridge.function(Navigation.traverseTo, .{ .dom_exception = true });
|
||||
pub const updateCurrentEntry = bridge.function(Navigation.updateCurrentEntry, .{ .dom_exception = true });
|
||||
pub const forward = bridge.function(Navigation.forward, .{});
|
||||
pub const navigate = bridge.function(Navigation.navigate, .{});
|
||||
pub const traverseTo = bridge.function(Navigation.traverseTo, .{});
|
||||
pub const updateCurrentEntry = bridge.function(Navigation.updateCurrentEntry, .{});
|
||||
|
||||
pub const oncurrententrychange = bridge.accessor(
|
||||
Navigation.getOnCurrentEntryChange,
|
||||
|
||||
@@ -503,7 +503,7 @@ pub const JsApi = struct {
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const constructor = bridge.constructor(FormData.init, .{ .dom_exception = true });
|
||||
pub const constructor = bridge.constructor(FormData.init, .{});
|
||||
pub const has = bridge.function(FormData.has, .{});
|
||||
pub const get = bridge.function(FormData.get, .{});
|
||||
pub const set = bridge.function(FormData.set, .{});
|
||||
|
||||
@@ -774,7 +774,7 @@ pub const JsApi = struct {
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const constructor = bridge.constructor(WebSocket.init, .{ .dom_exception = true });
|
||||
pub const constructor = bridge.constructor(WebSocket.init, .{});
|
||||
|
||||
pub const CONNECTING = bridge.property(@intFromEnum(ReadyState.connecting), .{ .template = true });
|
||||
pub const OPEN = bridge.property(@intFromEnum(ReadyState.open), .{ .template = true });
|
||||
@@ -794,8 +794,8 @@ pub const JsApi = struct {
|
||||
pub const onerror = bridge.accessor(WebSocket.getOnError, WebSocket.setOnError, .{});
|
||||
pub const onclose = bridge.accessor(WebSocket.getOnClose, WebSocket.setOnClose, .{});
|
||||
|
||||
pub const send = bridge.function(WebSocket.send, .{ .dom_exception = true });
|
||||
pub const close = bridge.function(WebSocket.close, .{ .dom_exception = true });
|
||||
pub const send = bridge.function(WebSocket.send, .{});
|
||||
pub const close = bridge.function(WebSocket.close, .{});
|
||||
};
|
||||
|
||||
const testing = @import("../../../testing.zig");
|
||||
|
||||
@@ -669,9 +669,9 @@ pub const JsApi = struct {
|
||||
pub const onreadystatechange = bridge.accessor(XMLHttpRequest.getOnReadyStateChange, XMLHttpRequest.setOnReadyStateChange, .{});
|
||||
pub const upload = bridge.accessor(XMLHttpRequest.getUpload, null, .{});
|
||||
pub const timeout = bridge.accessor(XMLHttpRequest.getTimeout, XMLHttpRequest.setTimeout, .{});
|
||||
pub const withCredentials = bridge.accessor(XMLHttpRequest.getWithCredentials, XMLHttpRequest.setWithCredentials, .{ .dom_exception = true });
|
||||
pub const withCredentials = bridge.accessor(XMLHttpRequest.getWithCredentials, XMLHttpRequest.setWithCredentials, .{});
|
||||
pub const open = bridge.function(XMLHttpRequest.open, .{});
|
||||
pub const send = bridge.function(XMLHttpRequest.send, .{ .dom_exception = true });
|
||||
pub const send = bridge.function(XMLHttpRequest.send, .{});
|
||||
pub const responseType = bridge.accessor(XMLHttpRequest.getResponseType, XMLHttpRequest.setResponseType, .{});
|
||||
pub const status = bridge.accessor(XMLHttpRequest.getStatus, null, .{});
|
||||
pub const statusText = bridge.accessor(XMLHttpRequest.getStatusText, null, .{});
|
||||
@@ -680,8 +680,8 @@ pub const JsApi = struct {
|
||||
pub const responseText = bridge.accessor(XMLHttpRequest.getResponseText, null, .{});
|
||||
pub const responseXML = bridge.accessor(XMLHttpRequest.getResponseXML, null, .{});
|
||||
pub const responseURL = bridge.accessor(XMLHttpRequest.getResponseURL, null, .{});
|
||||
pub const setRequestHeader = bridge.function(XMLHttpRequest.setRequestHeader, .{ .dom_exception = true });
|
||||
pub const overrideMimeType = bridge.function(XMLHttpRequest.overrideMimeType, .{ .dom_exception = true });
|
||||
pub const setRequestHeader = bridge.function(XMLHttpRequest.setRequestHeader, .{});
|
||||
pub const overrideMimeType = bridge.function(XMLHttpRequest.overrideMimeType, .{});
|
||||
pub const getResponseHeader = bridge.function(XMLHttpRequest.getResponseHeader, .{});
|
||||
pub const getAllResponseHeaders = bridge.function(XMLHttpRequest.getAllResponseHeaders, .{});
|
||||
pub const abort = bridge.function(XMLHttpRequest.abort, .{});
|
||||
|
||||
@@ -530,10 +530,10 @@ pub const JsApi = struct {
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const get = bridge.function(CookieStore.get, .{ .dom_exception = true });
|
||||
pub const getAll = bridge.function(CookieStore.getAll, .{ .dom_exception = true });
|
||||
pub const set = bridge.function(CookieStore.set, .{ .dom_exception = true });
|
||||
pub const delete = bridge.function(CookieStore.delete, .{ .dom_exception = true });
|
||||
pub const get = bridge.function(CookieStore.get, .{});
|
||||
pub const getAll = bridge.function(CookieStore.getAll, .{});
|
||||
pub const set = bridge.function(CookieStore.set, .{});
|
||||
pub const delete = bridge.function(CookieStore.delete, .{});
|
||||
pub const onchange = bridge.accessor(CookieStore.getOnChange, CookieStore.setOnChange, .{});
|
||||
};
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ pub const Lookup = struct {
|
||||
|
||||
pub const length = bridge.accessor(Lookup.getLength, null, .{});
|
||||
pub const getItem = bridge.function(Lookup.getItem, .{});
|
||||
pub const setItem = bridge.function(Lookup.setItem, .{ .dom_exception = true });
|
||||
pub const setItem = bridge.function(Lookup.setItem, .{});
|
||||
pub const removeItem = bridge.function(Lookup.removeItem, .{});
|
||||
pub const clear = bridge.function(Lookup.clear, .{});
|
||||
pub const key = bridge.function(Lookup.key, .{});
|
||||
|
||||
Reference in New Issue
Block a user