diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2022-03-30 23:48:45 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-03-31 01:10:47 +0200 |
commit | 46fa18657c64fe0242d7058176f8887b8a8d7e74 (patch) | |
tree | f94cf955675462ece9ac2fd932a0e412db313b0a | |
parent | b267c4178afb0acba4993676dcc0afc77333058a (diff) | |
download | serenity-46fa18657c64fe0242d7058176f8887b8a8d7e74.zip |
LibWeb: Use a callback function in ResizeObserver IDL
3 files changed, 5 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.cpp b/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.cpp index 65ecd8f1e4..ace98e0743 100644 --- a/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.cpp +++ b/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.cpp @@ -10,7 +10,7 @@ namespace Web::ResizeObserver { // https://drafts.csswg.org/resize-observer/#dom-resizeobserver-resizeobserver -NonnullRefPtr<ResizeObserver> ResizeObserver::create_with_global_object(JS::GlobalObject& global_object, JS::Value callback) +NonnullRefPtr<ResizeObserver> ResizeObserver::create_with_global_object(JS::GlobalObject& global_object, Bindings::CallbackType const& callback) { // FIXME: Implement (void)global_object; diff --git a/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.h b/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.h index a18fd8d189..a95a1c245a 100644 --- a/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.h +++ b/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.h @@ -23,7 +23,7 @@ class ResizeObserver public: using WrapperType = Bindings::ResizeObserverWrapper; - static NonnullRefPtr<ResizeObserver> create_with_global_object(JS::GlobalObject&, JS::Value callback); + static NonnullRefPtr<ResizeObserver> create_with_global_object(JS::GlobalObject&, Bindings::CallbackType const& callback); void observe(DOM::Element& target, ResizeObserverOptions); void unobserve(DOM::Element& target); diff --git a/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.idl b/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.idl index 68d0be6c67..7be9024501 100644 --- a/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.idl +++ b/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.idl @@ -3,14 +3,15 @@ [Exposed=(Window)] interface ResizeObserver { - // FIXME: This should be a ResizeObserverCallback. - constructor(any callback); + constructor(ResizeObserverCallback callback); undefined observe(Element target, optional ResizeObserverOptions options = {}); undefined unobserve(Element target); undefined disconnect(); }; +callback ResizeObserverCallback = void (sequence<ResizeObserverEntry> entries, ResizeObserver observer); + dictionary ResizeObserverOptions { // FIXME: This should be an enum. |