mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-28 22:53:28 +00:00
first change to start support frames
This commit is contained in:
@@ -127,7 +127,18 @@ pub const Window = struct {
|
||||
return self;
|
||||
}
|
||||
|
||||
// frames return the window itself, but accessing it via a pseudo
|
||||
// array returns the Window object corresponding to the given frame or
|
||||
// iframe.
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/Window/frames
|
||||
pub fn get_frames(self: *Window) *Window {
|
||||
return self;
|
||||
}
|
||||
// TODO: frames
|
||||
pub fn get_length(_: *Window) u32 {
|
||||
return 0;
|
||||
}
|
||||
|
||||
pub fn get_top(self: *Window) *Window {
|
||||
return self;
|
||||
}
|
||||
@@ -504,6 +515,14 @@ test "Browser.HTML.Window" {
|
||||
.{ "scrollend", "true" },
|
||||
}, .{});
|
||||
|
||||
try runner.testCases(&.{
|
||||
.{ "window == window.self", "true" },
|
||||
.{ "window == window.parent", "true" },
|
||||
.{ "window == window.top", "true" },
|
||||
.{ "window == window.frames", "true" },
|
||||
.{ "window.frames.length", "0" },
|
||||
}, .{});
|
||||
|
||||
try runner.testCases(&.{
|
||||
.{ "var qm = false; window.queueMicrotask(() => {qm = true });", null },
|
||||
.{ "qm", "true" },
|
||||
|
||||
Reference in New Issue
Block a user