add noop window.scrollTo

This commit is contained in:
Karl Seguin
2025-06-03 18:41:45 +08:00
parent bde8c54e7e
commit 7e8df34681

View File

@@ -261,11 +261,26 @@ pub const Window = struct {
// TODO: getComputedStyle should return a read-only CSSStyleDeclaration. // TODO: getComputedStyle should return a read-only CSSStyleDeclaration.
// We currently don't have a read-only one, so we return a new instance on // We currently don't have a read-only one, so we return a new instance on
// each call. // each call.
pub fn _getComputedStyle(_: *Window, element: *parser.Element, pseudo_element: ?[]const u8) !CSSStyleDeclaration { pub fn _getComputedStyle(_: *const Window, element: *parser.Element, pseudo_element: ?[]const u8) !CSSStyleDeclaration {
_ = element; _ = element;
_ = pseudo_element; _ = pseudo_element;
return .empty; return .empty;
} }
const ScrollToOpts = union(enum) {
x: i32,
opts: Opts,
const Opts = struct {
top: i32,
left: i32,
behavior: []const u8,
};
};
pub fn _scrollTo(_: *const Window, opts: ScrollToOpts, y: ?u32) void {
_ = opts;
_ = y;
}
}; };
const TimerCallback = struct { const TimerCallback = struct {