mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-07-31 09:46:05 -04:00
webapi: move SVGAElement.getRelList out of the JsApi bridge block
Review pattern: the JsApi struct is for JS/v8 bridging only; the relList getter is plain delegation with no v8 adaptation, so it moves to the type and the bridge accessor references it. Co-Authored-By: Karl Seguin <karlseguin@users.noreply.github.com>
This commit is contained in:
committed by
Karl Seguin
parent
1a51a2ec1d
commit
3fd9149917
@@ -22,6 +22,7 @@ const Frame = @import("../../../Frame.zig");
|
||||
const Node = @import("../../Node.zig");
|
||||
const Element = @import("../../Element.zig");
|
||||
const AnimatedString = @import("../../svg/AnimatedString.zig");
|
||||
const DOMTokenList = @import("../../collections.zig").DOMTokenList;
|
||||
|
||||
const Graphics = @import("Graphics.zig");
|
||||
|
||||
@@ -35,6 +36,10 @@ pub fn asNode(self: *A) *Node {
|
||||
return self.asElement().asNode();
|
||||
}
|
||||
|
||||
pub fn getRelList(self: *A, frame: *Frame) !*DOMTokenList {
|
||||
return self.asElement().getRelList(frame);
|
||||
}
|
||||
|
||||
pub const JsApi = struct {
|
||||
pub const bridge = js.Bridge(A);
|
||||
|
||||
@@ -49,8 +54,5 @@ pub const JsApi = struct {
|
||||
return AnimatedString.getOrCreate(self.asElement(), .href, frame);
|
||||
}
|
||||
|
||||
pub const relList = bridge.accessor(_getRelList, null, .{});
|
||||
fn _getRelList(self: *A, frame: *Frame) !*@import("../../collections.zig").DOMTokenList {
|
||||
return self.asElement().getRelList(frame);
|
||||
}
|
||||
pub const relList = bridge.accessor(A.getRelList, null, .{});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user