IntersectionObserver.idl 1.2 KB

1234567891011121314151617181920212223242526272829
  1. #import <DOM/Document.idl>
  2. #import <DOM/Element.idl>
  3. #import <DOM/Node.idl>
  4. #import <IntersectionObserver/IntersectionObserverEntry.idl>
  5. // https://w3c.github.io/IntersectionObserver/#intersection-observer-callback
  6. callback IntersectionObserverCallback = undefined (sequence<IntersectionObserverEntry> entries, IntersectionObserver observer);
  7. // https://w3c.github.io/IntersectionObserver/#intersection-observer-interface
  8. [Exposed=(Window)]
  9. interface IntersectionObserver {
  10. constructor(IntersectionObserverCallback callback, optional IntersectionObserverInit options = {});
  11. readonly attribute (Element or Document)? root;
  12. // FIXME: readonly attribute DOMString rootMargin;
  13. // FIXME: `sequence<double>` should be `FrozenArray<double>`
  14. readonly attribute sequence<double> thresholds;
  15. undefined observe(Element target);
  16. undefined unobserve(Element target);
  17. undefined disconnect();
  18. sequence<IntersectionObserverEntry> takeRecords();
  19. };
  20. // https://w3c.github.io/IntersectionObserver/#intersection-observer-init
  21. dictionary IntersectionObserverInit {
  22. (Element or Document)? root = null;
  23. DOMString rootMargin = "0px";
  24. // FIXME: DOMString scrollMargin = "0px";
  25. (double or sequence<double>) threshold = 0;
  26. };