mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibWeb/HTML: Port Window.isSecureContext to IDL
This commit is contained in:
parent
188aac5077
commit
94f1eff291
Notes:
sideshowbarker
2024-07-17 02:39:10 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/94f1eff291 Pull-request: https://github.com/SerenityOS/serenity/pull/17752 Reviewed-by: https://github.com/awesomekling
3 changed files with 1 additions and 10 deletions
|
@ -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));
|
||||
|
|
|
@ -257,7 +257,6 @@ private:
|
|||
|
||||
JS_DECLARE_NATIVE_FUNCTION(local_storage_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(session_storage_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(is_secure_context_getter);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(set_interval);
|
||||
JS_DECLARE_NATIVE_FUNCTION(set_timeout);
|
||||
|
|
|
@ -38,6 +38,7 @@ interface Window : EventTarget {
|
|||
|
||||
// FIXME: Replace these with 'Window includes WindowOrWorkerGlobalScope;' once we have feature parity
|
||||
[Replaceable] readonly attribute USVString origin;
|
||||
readonly attribute boolean isSecureContext;
|
||||
};
|
||||
Window includes GlobalEventHandlers;
|
||||
Window includes WindowEventHandlers;
|
||||
|
|
Loading…
Reference in a new issue