1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:38:11 +00:00

LibWeb/HTML: Port Window.origin to IDL

This commit is contained in:
Linus Groh 2023-03-06 11:11:17 +00:00
parent 376fb9ae40
commit 188aac5077
3 changed files with 3 additions and 16 deletions

View file

@ -1102,7 +1102,6 @@ WebIDL::ExceptionOr<void> Window::initialize_web_interfaces(Badge<WindowEnvironm
define_native_accessor(realm, "localStorage", local_storage_getter, {}, attr);
define_native_accessor(realm, "sessionStorage", session_storage_getter, {}, attr);
define_native_accessor(realm, "origin", origin_getter, {}, attr);
define_native_accessor(realm, "isSecureContext", is_secure_context_getter, {}, attr);
// Legacy
@ -1118,11 +1117,6 @@ WebIDL::ExceptionOr<void> Window::initialize_web_interfaces(Badge<WindowEnvironm
return {};
}
HTML::Origin Window::origin() const
{
return associated_document().origin();
}
// https://webidl.spec.whatwg.org/#platform-object-setprototypeof
JS::ThrowCompletionOr<bool> Window::internal_set_prototype_of(JS::Object* prototype)
{
@ -1835,13 +1829,6 @@ JS_DEFINE_NATIVE_FUNCTION(Window::structured_clone)
}));
}
// https://html.spec.whatwg.org/multipage/webappapis.html#dom-origin
JS_DEFINE_NATIVE_FUNCTION(Window::origin_getter)
{
auto* impl = TRY(impl_from(vm));
return JS::PrimitiveString::create(vm, impl->associated_document().origin().serialize());
}
// https://html.spec.whatwg.org/multipage/webappapis.html#dom-issecurecontext
JS_DEFINE_NATIVE_FUNCTION(Window::is_secure_context_getter)
{