File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,11 @@ pub const Window = struct {
117117 return self ;
118118 }
119119
120+ // TODO: frames
121+ pub fn get_top (self : * Window ) * Window {
122+ return self ;
123+ }
124+
120125 pub fn get_document (self : * Window ) ? * parser.DocumentHTML {
121126 return self .document ;
122127 }
@@ -292,6 +297,11 @@ test "Browser.HTML.Window" {
292297 var runner = try testing .jsRunner (testing .tracking_allocator , .{});
293298 defer runner .deinit ();
294299
300+ try runner .testCases (&.{
301+ .{ "window.parent === window" , "true" },
302+ .{ "window.top === window" , "true" },
303+ }, .{});
304+
295305 // requestAnimationFrame should be able to wait by recursively calling itself
296306 // Note however that we in this test do not wait as the request is just send to the browser
297307 try runner .testCases (&.{
You can’t perform that action at this time.
0 commit comments