Skip to content

Commit 7ffdee0

Browse files
committed
node: add baseURI getter
1 parent 3d0928a commit 7ffdee0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/browser/dom/node.zig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ pub const Node = struct {
111111
// --------
112112

113113
// Read-only attributes
114+
pub fn get_baseURI(_: *parser.Node, page: *Page) ![]const u8 {
115+
return page.url.raw;
116+
}
114117

115118
pub fn get_firstChild(self: *parser.Node) !?Union {
116119
const res = try parser.nodeFirstChild(self);
@@ -737,6 +740,10 @@ test "Browser.DOM.node" {
737740
.{ "link.normalize()", "undefined" },
738741
}, .{});
739742

743+
try runner.testCases(&.{
744+
.{ "link.baseURI", "https://lightpanda.io/opensource-browser/" },
745+
}, .{});
746+
740747
try runner.testCases(&.{
741748
.{ "content.removeChild(append) !== undefined", "true" },
742749
.{ "last_child.__proto__.constructor.name !== 'HTMLHeadingElement'", "true" },

0 commit comments

Comments
 (0)