mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibWeb/HTML: Port Window.localStorage to IDL
This commit is contained in:
parent
5cc6b1c4db
commit
37e9302dd9
Notes:
sideshowbarker
2024-07-17 05:02:35 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/37e9302dd9 Pull-request: https://github.com/SerenityOS/serenity/pull/17752 Reviewed-by: https://github.com/awesomekling
4 changed files with 8 additions and 8 deletions
|
@ -897,7 +897,6 @@ WebIDL::ExceptionOr<void> Window::initialize_web_interfaces(Badge<WindowEnvironm
|
||||||
|
|
||||||
define_direct_property("CSS", MUST_OR_THROW_OOM(heap().allocate<Bindings::CSSNamespace>(realm, realm)), 0);
|
define_direct_property("CSS", MUST_OR_THROW_OOM(heap().allocate<Bindings::CSSNamespace>(realm, realm)), 0);
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
// FIXME: Implement codegen for readonly properties with [PutForwards]
|
// FIXME: Implement codegen for readonly properties with [PutForwards]
|
||||||
|
@ -1619,12 +1618,6 @@ JS_DEFINE_NATIVE_FUNCTION(Window::structured_clone)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
JS_DEFINE_NATIVE_FUNCTION(Window::local_storage_getter)
|
|
||||||
{
|
|
||||||
auto* impl = TRY(impl_from(vm));
|
|
||||||
return impl->local_storage();
|
|
||||||
}
|
|
||||||
|
|
||||||
JS_DEFINE_NATIVE_FUNCTION(Window::session_storage_getter)
|
JS_DEFINE_NATIVE_FUNCTION(Window::session_storage_getter)
|
||||||
{
|
{
|
||||||
auto* impl = TRY(impl_from(vm));
|
auto* impl = TRY(impl_from(vm));
|
||||||
|
|
|
@ -253,7 +253,6 @@ private:
|
||||||
|
|
||||||
JS_DECLARE_NATIVE_FUNCTION(structured_clone);
|
JS_DECLARE_NATIVE_FUNCTION(structured_clone);
|
||||||
|
|
||||||
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(set_interval);
|
JS_DECLARE_NATIVE_FUNCTION(set_interval);
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#import <HighResolutionTime/Performance.idl>
|
#import <HighResolutionTime/Performance.idl>
|
||||||
#import <HTML/AnimationFrameProvider.idl>
|
#import <HTML/AnimationFrameProvider.idl>
|
||||||
#import <HTML/Navigator.idl>
|
#import <HTML/Navigator.idl>
|
||||||
|
#import <HTML/WindowLocalStorage.idl>
|
||||||
#import <HTML/WindowOrWorkerGlobalScope.idl>
|
#import <HTML/WindowOrWorkerGlobalScope.idl>
|
||||||
#import <RequestIdleCallback/IdleRequest.idl>
|
#import <RequestIdleCallback/IdleRequest.idl>
|
||||||
|
|
||||||
|
@ -96,6 +97,7 @@ interface Window : EventTarget {
|
||||||
Window includes AnimationFrameProvider;
|
Window includes AnimationFrameProvider;
|
||||||
Window includes GlobalEventHandlers;
|
Window includes GlobalEventHandlers;
|
||||||
Window includes WindowEventHandlers;
|
Window includes WindowEventHandlers;
|
||||||
|
Window includes WindowLocalStorage;
|
||||||
Window includes WindowOrWorkerGlobalScope;
|
Window includes WindowOrWorkerGlobalScope;
|
||||||
|
|
||||||
enum ScrollBehavior { "auto", "instant", "smooth" };
|
enum ScrollBehavior { "auto", "instant", "smooth" };
|
||||||
|
|
6
Userland/Libraries/LibWeb/HTML/WindowLocalStorage.idl
Normal file
6
Userland/Libraries/LibWeb/HTML/WindowLocalStorage.idl
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
#import <HTML/Storage.idl>
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/webstorage.html#windowlocalstorage
|
||||||
|
interface mixin WindowLocalStorage {
|
||||||
|
readonly attribute Storage localStorage;
|
||||||
|
};
|
Loading…
Reference in a new issue