Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/browser/dom/document.zig
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const css = @import("css.zig");
const Element = @import("element.zig").Element;
const ElementUnion = @import("element.zig").Union;
const TreeWalker = @import("tree_walker.zig").TreeWalker;
const CSSStyleSheet = @import("../cssom/css_stylesheet.zig").CSSStyleSheet;
const Range = @import("range.zig").Range;

const Env = @import("../env.zig").Env;
Expand Down Expand Up @@ -295,6 +296,11 @@ pub const Document = struct {
pub fn _createRange(_: *parser.Document, page: *Page) Range {
return Range.constructor(page);
}

// TODO: dummy implementation
pub fn get_styleSheets(_: *parser.Document) []CSSStyleSheet {
return &.{};
}
};

const testing = @import("../../testing.zig");
Expand Down Expand Up @@ -471,6 +477,10 @@ test "Browser.DOM.Document" {
.{ "document.activeElement === document.getElementById('link')", "true" },
}, .{});

try runner.testCases(&.{
.{ "document.styleSheets.length", "0" },
}, .{});

// this test breaks the doc structure, keep it at the end of the test
// suite.
try runner.testCases(&.{
Expand Down