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

LibWeb/HTML: Port Window.isSecureContext to IDL

This commit is contained in:
Linus Groh 2023-03-06 11:12:48 +00:00
parent 188aac5077
commit 94f1eff291
3 changed files with 1 additions and 10 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, "isSecureContext", is_secure_context_getter, {}, attr);
// Legacy
define_native_accessor(realm, "event", event_getter, event_setter, JS::Attribute::Enumerable);
@ -1829,14 +1828,6 @@ JS_DEFINE_NATIVE_FUNCTION(Window::structured_clone)
}));
}
// https://html.spec.whatwg.org/multipage/webappapis.html#dom-issecurecontext
JS_DEFINE_NATIVE_FUNCTION(Window::is_secure_context_getter)
{
auto* impl = TRY(impl_from(vm));
// The isSecureContext getter steps are to return true if this's relevant settings object is a secure context, or false otherwise.
return JS::Value(HTML::is_secure_context(impl->associated_document().relevant_settings_object()));
}
JS_DEFINE_NATIVE_FUNCTION(Window::local_storage_getter)
{
auto* impl = TRY(impl_from(vm));