mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:07:35 +00:00
LibWeb/HTML: Port Window.isSecureContext to IDL
This commit is contained in:
parent
188aac5077
commit
94f1eff291
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, "localStorage", local_storage_getter, {}, attr);
|
||||||
define_native_accessor(realm, "sessionStorage", session_storage_getter, {}, attr);
|
define_native_accessor(realm, "sessionStorage", session_storage_getter, {}, attr);
|
||||||
define_native_accessor(realm, "isSecureContext", is_secure_context_getter, {}, attr);
|
|
||||||
|
|
||||||
// Legacy
|
// Legacy
|
||||||
define_native_accessor(realm, "event", event_getter, event_setter, JS::Attribute::Enumerable);
|
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)
|
JS_DEFINE_NATIVE_FUNCTION(Window::local_storage_getter)
|
||||||
{
|
{
|
||||||
auto* impl = TRY(impl_from(vm));
|
auto* impl = TRY(impl_from(vm));
|
||||||
|
|
|
@ -257,7 +257,6 @@ private:
|
||||||
|
|
||||||
JS_DECLARE_NATIVE_FUNCTION(local_storage_getter);
|
JS_DECLARE_NATIVE_FUNCTION(local_storage_getter);
|
||||||
JS_DECLARE_NATIVE_FUNCTION(session_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_interval);
|
||||||
JS_DECLARE_NATIVE_FUNCTION(set_timeout);
|
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
|
// FIXME: Replace these with 'Window includes WindowOrWorkerGlobalScope;' once we have feature parity
|
||||||
[Replaceable] readonly attribute USVString origin;
|
[Replaceable] readonly attribute USVString origin;
|
||||||
|
readonly attribute boolean isSecureContext;
|
||||||
};
|
};
|
||||||
Window includes GlobalEventHandlers;
|
Window includes GlobalEventHandlers;
|
||||||
Window includes WindowEventHandlers;
|
Window includes WindowEventHandlers;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue