diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2022-03-30 23:45:36 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-03-31 01:10:47 +0200 |
commit | b267c4178afb0acba4993676dcc0afc77333058a (patch) | |
tree | 2a2dee5b814af70a1e1b094353308f1cd512b544 /Userland | |
parent | f45d361f037509edc653e29c88ce591678e562fa (diff) | |
download | serenity-b267c4178afb0acba4993676dcc0afc77333058a.zip |
LibWeb: Use a callback function in IntersectionObserver IDL
Diffstat (limited to 'Userland')
3 files changed, 5 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.cpp b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.cpp index 7a4bea157a..bd21e60034 100644 --- a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.cpp +++ b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.cpp @@ -10,7 +10,7 @@ namespace Web::IntersectionObserver { // https://w3c.github.io/IntersectionObserver/#dom-intersectionobserver-intersectionobserver -NonnullRefPtr<IntersectionObserver> IntersectionObserver::create_with_global_object(JS::GlobalObject& global_object, JS::Value callback, IntersectionObserverInit const& options) +NonnullRefPtr<IntersectionObserver> IntersectionObserver::create_with_global_object(JS::GlobalObject& global_object, Bindings::CallbackType const& callback, IntersectionObserverInit const& options) { // FIXME: Implement (void)global_object; diff --git a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.h b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.h index 122db71c96..0edc146398 100644 --- a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.h +++ b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.h @@ -25,7 +25,7 @@ class IntersectionObserver public: using WrapperType = Bindings::IntersectionObserverWrapper; - static NonnullRefPtr<IntersectionObserver> create_with_global_object(JS::GlobalObject&, JS::Value callback, IntersectionObserverInit const& options = {}); + static NonnullRefPtr<IntersectionObserver> create_with_global_object(JS::GlobalObject&, Bindings::CallbackType const& callback, IntersectionObserverInit const& options = {}); void observe(DOM::Element& target); void unobserve(DOM::Element& target); diff --git a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.idl b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.idl index c5d2a4bbfc..1cc24b6a93 100644 --- a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.idl +++ b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.idl @@ -1,10 +1,11 @@ #import <DOM/Element.idl> #import <DOM/Node.idl> +callback IntersectionObserverCallback = undefined (sequence<IntersectionObserverEntry> entries, IntersectionObserver observer); + [Exposed=(Window)] interface IntersectionObserver { - // FIXME: Should be: IntersectionObserverCallback - constructor(any callback, optional IntersectionObserverInit options = {}); + constructor(IntersectionObserverCallback callback, optional IntersectionObserverInit options = {}); undefined observe(Element target); undefined unobserve(Element target); |