LibWeb: Use a callback function in IntersectionObserver IDL
This commit is contained in:
parent
f45d361f03
commit
b267c4178a
Notes:
sideshowbarker
2024-07-17 16:26:41 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/b267c4178a Pull-request: https://github.com/SerenityOS/serenity/pull/13369 Reviewed-by: https://github.com/alimpfard ✅
3 changed files with 5 additions and 4 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue