ladybird/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.idl
Luke Wilde 165abafb80 LibWeb: Add initial implementation of IntersectionObserver
The main missing features are rootMargin, proper nested browsing
context support and content clip/clip-path support.

This makes images appear on some sites, such as YouTube and
howstuffworks.com.
2023-07-07 05:27:25 +02:00

25 lines
993 B
Text

#import <DOM/Document.idl>
#import <DOM/Element.idl>
#import <DOM/Node.idl>
#import <IntersectionObserver/IntersectionObserverEntry.idl>
callback IntersectionObserverCallback = undefined (sequence<IntersectionObserverEntry> entries, IntersectionObserver observer);
[Exposed=(Window), UseNewAKString]
interface IntersectionObserver {
constructor(IntersectionObserverCallback callback, optional IntersectionObserverInit options = {});
readonly attribute (Element or Document)? root;
// FIXME: readonly attribute DOMString rootMargin;
// FIXME: `sequence<double>` should be `FrozenArray<double>`
readonly attribute sequence<double> thresholds;
undefined observe(Element target);
undefined unobserve(Element target);
undefined disconnect();
sequence<IntersectionObserverEntry> takeRecords();
};
dictionary IntersectionObserverInit {
(Element or Document)? root = null;
DOMString rootMargin = "0px";
(double or sequence<double>) threshold = 0;
};