Skip to content

Commit bfc01d9

Browse files
authored
Merge pull request #874 from lightpanda-io/document_styleSheets
add dummy document.get_styleSheets
2 parents fb58c50 + 2d78b2c commit bfc01d9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/browser/dom/document.zig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const css = @import("css.zig");
3232
const Element = @import("element.zig").Element;
3333
const ElementUnion = @import("element.zig").Union;
3434
const TreeWalker = @import("tree_walker.zig").TreeWalker;
35+
const CSSStyleSheet = @import("../cssom/css_stylesheet.zig").CSSStyleSheet;
3536
const Range = @import("range.zig").Range;
3637

3738
const Env = @import("../env.zig").Env;
@@ -295,6 +296,11 @@ pub const Document = struct {
295296
pub fn _createRange(_: *parser.Document, page: *Page) Range {
296297
return Range.constructor(page);
297298
}
299+
300+
// TODO: dummy implementation
301+
pub fn get_styleSheets(_: *parser.Document) []CSSStyleSheet {
302+
return &.{};
303+
}
298304
};
299305

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

480+
try runner.testCases(&.{
481+
.{ "document.styleSheets.length", "0" },
482+
}, .{});
483+
474484
// this test breaks the doc structure, keep it at the end of the test
475485
// suite.
476486
try runner.testCases(&.{

0 commit comments

Comments
 (0)