mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-15 15:58:57 +00:00
class_index => class_id
This commit is contained in:
@@ -589,7 +589,7 @@ pub fn mapZigInstanceToJs(self: *Context, js_obj_: ?v8.Object, value: anytype) !
|
||||
// for example, when we're executing a constructor, v8 has
|
||||
// already created the "this" object.
|
||||
const js_obj = js_obj_ orelse blk: {
|
||||
const template = self.templates[resolved.class_index];
|
||||
const template = self.templates[resolved.class_id];
|
||||
break :blk template.getInstanceTemplate().initInstance(v8_context);
|
||||
};
|
||||
const JsApi = bridge.Struct(ptr.child).JsApi;
|
||||
@@ -916,7 +916,7 @@ fn jsValueToTypedArray(_: *Context, comptime T: type, js_value: v8.Value) !?[]T
|
||||
// get the most specific class_id possible.
|
||||
const Resolved = struct {
|
||||
ptr: *anyopaque,
|
||||
class_index: u16,
|
||||
class_id: u16,
|
||||
prototype_chain: []const js.PrototypeChainEntry,
|
||||
};
|
||||
fn resolveValue(value: anytype) Resolved {
|
||||
@@ -947,7 +947,7 @@ fn resolveValue(value: anytype) Resolved {
|
||||
fn resolveT(comptime T: type, value: *anyopaque) Resolved {
|
||||
return .{
|
||||
.ptr = value,
|
||||
.class_index = T.JsApi.Meta.class_index,
|
||||
.class_id = T.JsApi.Meta.class_id,
|
||||
.prototype_chain = &T.JsApi.Meta.prototype_chain,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ pub fn init(allocator: Allocator, platform: *const Platform, _: Opts) !*Env {
|
||||
const templates = &env.templates;
|
||||
inline for (JsApis, 0..) |JsApi, i| {
|
||||
@setEvalBranchQuota(10_000);
|
||||
JsApi.Meta.class_index = i;
|
||||
JsApi.Meta.class_id = i;
|
||||
templates[i] = v8.Persistent(v8.FunctionTemplate).init(isolate, generateClass(JsApi, isolate)).castToFunctionTemplate();
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ const Caller = @import("Caller.zig");
|
||||
|
||||
pub fn Builder(comptime T: type) type {
|
||||
return struct {
|
||||
pub const ClassId = u16;
|
||||
pub const @"type" = T;
|
||||
|
||||
pub fn constructor(comptime func: anytype, comptime opts: Constructor.Opts) Constructor {
|
||||
|
||||
@@ -30,7 +30,7 @@ pub const JsApi = struct {
|
||||
pub const name = "AbortController";
|
||||
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const constructor = bridge.constructor(AbortController.init, .{});
|
||||
|
||||
@@ -85,7 +85,7 @@ pub const JsApi = struct {
|
||||
pub const name = "AbortSignal";
|
||||
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const Prototype = EventTarget;
|
||||
|
||||
@@ -63,7 +63,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "CData";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const data = bridge.accessor(CData.getData, CData.setData, .{});
|
||||
|
||||
@@ -43,7 +43,7 @@ pub const JsApi = struct {
|
||||
pub const name = "Console";
|
||||
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
pub const empty_with_no_proto = true;
|
||||
};
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "Crypto";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const getRandomValues = bridge.function(Crypto.getRandomValues, .{ .static = true });
|
||||
|
||||
@@ -60,7 +60,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "DOMException";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const constructor = bridge.constructor(DOMException.init, .{});
|
||||
|
||||
@@ -38,7 +38,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "DOMImplementation";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
pub const empty_with_no_proto = true;
|
||||
};
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "NodeIterator";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const root = bridge.accessor(DOMNodeIterator.getRoot, null, .{});
|
||||
|
||||
@@ -245,7 +245,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "TreeWalker";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const root = bridge.accessor(DOMTreeWalker.getRoot, null, .{});
|
||||
|
||||
@@ -167,7 +167,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "Document";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const constructor = bridge.constructor(_constructor, .{});
|
||||
|
||||
@@ -124,7 +124,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "DocumentFragment";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const constructor = bridge.constructor(DocumentFragment.init, .{});
|
||||
|
||||
@@ -41,7 +41,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "DocumentType";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const name = bridge.accessor(DocumentType.getName, null, .{});
|
||||
|
||||
@@ -621,7 +621,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "Element";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const tagName = bridge.accessor(_tagName, null, .{});
|
||||
|
||||
@@ -105,7 +105,7 @@ pub const JsApi = struct {
|
||||
pub const name = "Event";
|
||||
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const constructor = bridge.constructor(Event.init, .{});
|
||||
|
||||
@@ -74,7 +74,7 @@ pub const JsApi = struct {
|
||||
pub const name = "EventTarget";
|
||||
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const dispatchEvent = bridge.function(EventTarget.dispatchEvent, .{});
|
||||
|
||||
@@ -109,7 +109,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLDocument";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const constructor = bridge.constructor(_constructor, .{});
|
||||
|
||||
@@ -56,7 +56,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "Location";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const toString = bridge.function(Location.toString, .{});
|
||||
|
||||
@@ -16,7 +16,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "MutationObserver";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const constructor = bridge.constructor(MutationObserver.init, .{});
|
||||
|
||||
@@ -78,7 +78,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "Navigator";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
// ZIGDOM (currently no optimization for empty types)
|
||||
pub const empty_with_no_proto = true;
|
||||
};
|
||||
|
||||
@@ -589,7 +589,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "Node";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const ELEMENT_NODE = bridge.property(1);
|
||||
|
||||
@@ -66,7 +66,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "NodeFilter";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const FILTER_ACCEPT = bridge.property(NodeFilter.FILTER_ACCEPT);
|
||||
|
||||
@@ -136,7 +136,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "URL";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const constructor = bridge.constructor(URL.init, .{});
|
||||
|
||||
@@ -252,7 +252,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "Window";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const self = bridge.accessor(Window.getWindow, null, .{ .cache = "self" });
|
||||
|
||||
@@ -12,6 +12,6 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "Comment";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -16,7 +16,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "Text";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const wholeText = bridge.accessor(Text.getWholeText, null, .{});
|
||||
|
||||
@@ -193,7 +193,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "DOMTokenList";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const length = bridge.accessor(DOMTokenList.length, null, .{});
|
||||
|
||||
@@ -142,7 +142,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLAllCollection";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
|
||||
// This is a very weird class that requires special JavaScript behavior
|
||||
// this htmldda and callable are only used here..
|
||||
|
||||
@@ -78,7 +78,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLCollection";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const length = bridge.accessor(HTMLCollection.length, null, .{});
|
||||
|
||||
@@ -70,7 +70,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "NodeList";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const length = bridge.accessor(NodeList.length, null, .{});
|
||||
|
||||
@@ -47,7 +47,7 @@ pub fn Entry(comptime Inner: type, comptime field: ?[]const u8) type {
|
||||
|
||||
pub const Meta = struct {
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const next = bridge.function(Self.next, .{});
|
||||
|
||||
@@ -202,7 +202,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "CSSStyleDeclaration";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const cssText = bridge.accessor(CSSStyleDeclaration.getCssText, CSSStyleDeclaration.setCssText, .{});
|
||||
|
||||
@@ -117,7 +117,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "CSSStyleProperties";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const @"[]" = bridge.namedIndexed(_getPropertyIndexed, .{});
|
||||
|
||||
@@ -31,7 +31,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "MediaQueryList";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const media = bridge.accessor(MediaQueryList.getMedia, null, .{});
|
||||
|
||||
@@ -70,7 +70,7 @@ pub const JsApi = struct {
|
||||
// (TODO: we probably _should_ hold a refernece, because calling getAttributeNode
|
||||
// on the same element + name should return the same instance)
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const name = bridge.accessor(Attribute.getName, null, .{});
|
||||
@@ -381,7 +381,7 @@ pub const NamedNodeMap = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "NamedNodeMap";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const length = bridge.accessor(NamedNodeMap.length, null, .{});
|
||||
|
||||
@@ -119,7 +119,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "SVGElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLAnchorElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const href = bridge.accessor(Anchor.getHref, null, .{});
|
||||
|
||||
@@ -20,6 +20,6 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLBRElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -24,7 +24,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLBodyElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLButtonElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const disabled = bridge.accessor(Button.getDisabled, Button.setDisabled, .{});
|
||||
|
||||
@@ -23,6 +23,6 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "TODO-CUSTOM-NAME";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -19,6 +19,6 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLDivElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -112,6 +112,6 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLFormElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -23,6 +23,6 @@ pub const JsApi = struct {
|
||||
|
||||
pub const Meta = struct {
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -19,6 +19,6 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLHRElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -19,6 +19,6 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLHeadElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -24,6 +24,6 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLHeadingElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -19,6 +19,6 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLHtmlElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -19,6 +19,6 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLImageElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -195,7 +195,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLInputElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const @"type" = bridge.accessor(Input.getType, Input.setType, .{});
|
||||
|
||||
@@ -19,6 +19,6 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLLIElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -19,6 +19,6 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLLinkElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -23,6 +23,6 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLMetaElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -19,6 +19,6 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLOLElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -70,7 +70,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLOptionElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const value = bridge.accessor(Option.getValue, Option.setValue, .{});
|
||||
|
||||
@@ -19,6 +19,6 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLParagraphElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -63,7 +63,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLScriptElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const src = bridge.accessor(Script.getSrc, Script.setSrc, .{});
|
||||
|
||||
@@ -122,7 +122,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLSelectElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const value = bridge.accessor(Select.getValue, Select.setValue, .{});
|
||||
|
||||
@@ -19,6 +19,6 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLStyleElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -77,7 +77,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLTextAreaElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const value = bridge.accessor(TextArea.getValue, TextArea.setValue, .{});
|
||||
|
||||
@@ -20,6 +20,6 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLTitleElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -19,6 +19,6 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLULElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -23,6 +23,6 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "HTMLUnknownElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -24,6 +24,6 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "SVGGenericElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -23,6 +23,6 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "SVGRectElement";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -84,7 +84,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "TextDecoder";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const constructor = bridge.constructor(TextDecoder.init, .{});
|
||||
|
||||
@@ -25,7 +25,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "TextEncoder";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
pub const empty_with_no_proto = true;
|
||||
};
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "ErrorEvent";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
// Start API
|
||||
|
||||
@@ -38,7 +38,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "ProgressEvent";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const constructor = bridge.constructor(ProgressEvent.init, .{});
|
||||
|
||||
@@ -92,7 +92,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "FormData";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const constructor = bridge.constructor(FormData.init, .{});
|
||||
|
||||
@@ -32,7 +32,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "Request";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const constructor = bridge.constructor(Request.init, .{});
|
||||
|
||||
@@ -44,7 +44,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "Response";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const ok = bridge.accessor(Response.isOK, null, .{});
|
||||
|
||||
@@ -266,7 +266,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "URLSearchParams";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const constructor = bridge.constructor(URLSearchParams.init, .{});
|
||||
|
||||
@@ -311,7 +311,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "XMLHttpRequest";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const constructor = bridge.constructor(XMLHttpRequest.init, .{});
|
||||
|
||||
@@ -154,7 +154,7 @@ pub const JsApi = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "XMLHttpRequestEventTarget";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const onloadstart = bridge.accessor(XMLHttpRequestEventTarget.getOnLoadStart, XMLHttpRequestEventTarget.setOnLoadStart, .{});
|
||||
|
||||
@@ -90,7 +90,7 @@ pub const Lookup = struct {
|
||||
pub const Meta = struct {
|
||||
pub const name = "Storage";
|
||||
pub const prototype_chain = bridge.prototypeChain();
|
||||
pub var class_index: u16 = 0;
|
||||
pub var class_id: bridge.ClassId = undefined;
|
||||
};
|
||||
|
||||
pub const length = bridge.accessor(Lookup.getLength, null, .{});
|
||||
|
||||
Reference in New Issue
Block a user