File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,18 @@ pub const Window = struct {
127127 return self ;
128128 }
129129
130+ // frames return the window itself, but accessing it via a pseudo
131+ // array returns the Window object corresponding to the given frame or
132+ // iframe.
133+ // https://developer.mozilla.org/en-US/docs/Web/API/Window/frames
134+ pub fn get_frames (self : * Window ) * Window {
135+ return self ;
136+ }
130137 // TODO: frames
138+ pub fn get_length (_ : * Window ) u32 {
139+ return 0 ;
140+ }
141+
131142 pub fn get_top (self : * Window ) * Window {
132143 return self ;
133144 }
@@ -504,6 +515,14 @@ test "Browser.HTML.Window" {
504515 .{ "scrollend" , "true" },
505516 }, .{});
506517
518+ try runner .testCases (&.{
519+ .{ "window == window.self" , "true" },
520+ .{ "window == window.parent" , "true" },
521+ .{ "window == window.top" , "true" },
522+ .{ "window == window.frames" , "true" },
523+ .{ "window.frames.length" , "0" },
524+ }, .{});
525+
507526 try runner .testCases (&.{
508527 .{ "var qm = false; window.queueMicrotask(() => {qm = true });" , null },
509528 .{ "qm" , "true" },
You can’t perform that action at this time.
0 commit comments