|
@@ -1093,7 +1093,6 @@ WebIDL::ExceptionOr<void> Window::initialize_web_interfaces(Badge<WindowEnvironm
|
|
|
// FIXME: These should be native accessors, not properties
|
|
|
define_native_accessor(realm, "top", top_getter, nullptr, JS::Attribute::Enumerable);
|
|
|
define_native_accessor(realm, "frames", frames_getter, {}, JS::Attribute::Enumerable);
|
|
|
- define_native_accessor(realm, "self", self_getter, {}, JS::Attribute::Enumerable);
|
|
|
define_native_accessor(realm, "parent", parent_getter, {}, JS::Attribute::Enumerable);
|
|
|
define_native_accessor(realm, "document", document_getter, {}, JS::Attribute::Enumerable);
|
|
|
define_native_accessor(realm, "frameElement", frame_element_getter, {}, JS::Attribute::Enumerable);
|
|
@@ -1210,6 +1209,13 @@ JS::NonnullGCPtr<WindowProxy> Window::window() const
|
|
|
return verify_cast<WindowProxy>(relevant_realm(*this).global_environment().global_this_value());
|
|
|
}
|
|
|
|
|
|
+// https://html.spec.whatwg.org/multipage/window-object.html#dom-self
|
|
|
+JS::NonnullGCPtr<WindowProxy> Window::self() const
|
|
|
+{
|
|
|
+ // The window, frames, and self getter steps are to return this's relevant realm.[[GlobalEnv]].[[GlobalThisValue]].
|
|
|
+ return verify_cast<WindowProxy>(relevant_realm(*this).global_environment().global_this_value());
|
|
|
+}
|
|
|
+
|
|
|
// https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator
|
|
|
JS::NonnullGCPtr<Navigator> Window::navigator() const
|
|
|
{
|
|
@@ -1530,14 +1536,6 @@ JS_DEFINE_NATIVE_FUNCTION(Window::top_getter)
|
|
|
return browsing_context->top_level_browsing_context().window_proxy();
|
|
|
}
|
|
|
|
|
|
-// https://html.spec.whatwg.org/multipage/window-object.html#dom-self
|
|
|
-JS_DEFINE_NATIVE_FUNCTION(Window::self_getter)
|
|
|
-{
|
|
|
- auto* impl = TRY(impl_from(vm));
|
|
|
- // The window, frames, and self getter steps are to return this's relevant realm.[[GlobalEnv]].[[GlobalThisValue]].
|
|
|
- return &relevant_realm(*impl).global_environment().global_this_value();
|
|
|
-}
|
|
|
-
|
|
|
// https://html.spec.whatwg.org/multipage/window-object.html#dom-frames
|
|
|
JS_DEFINE_NATIVE_FUNCTION(Window::frames_getter)
|
|
|
{
|