|
| 1 | +callback IntersectionObserverCallback = void (sequence<IntersectionObserverEntry> entries, IntersectionObserver observer); |
| 2 | + |
| 3 | +[Constructor(IntersectionObserverCallback callback, optional IntersectionObserverInit options), |
| 4 | + Exposed=Window] |
| 5 | +interface IntersectionObserver { |
| 6 | + readonly attribute Element? root; |
| 7 | + readonly attribute DOMString rootMargin; |
| 8 | + readonly attribute FrozenArray<double> thresholds; |
| 9 | + void observe(Element target); |
| 10 | + void unobserve(Element target); |
| 11 | + void disconnect(); |
| 12 | + sequence<IntersectionObserverEntry> takeRecords(); |
| 13 | +}; |
| 14 | + |
| 15 | +[Constructor(IntersectionObserverEntryInit intersectionObserverEntryInit)] |
| 16 | +interface IntersectionObserverEntry { |
| 17 | + readonly attribute DOMHighResTimeStamp time; |
| 18 | + readonly attribute DOMRectReadOnly? rootBounds; |
| 19 | + readonly attribute DOMRectReadOnly boundingClientRect; |
| 20 | + readonly attribute DOMRectReadOnly intersectionRect; |
| 21 | + readonly attribute boolean isIntersecting; |
| 22 | + readonly attribute double intersectionRatio; |
| 23 | + readonly attribute Element target; |
| 24 | +}; |
| 25 | + |
| 26 | +dictionary IntersectionObserverEntryInit { |
| 27 | + required DOMHighResTimeStamp time; |
| 28 | + required DOMRectInit? rootBounds; |
| 29 | + required DOMRectInit boundingClientRect; |
| 30 | + required DOMRectInit intersectionRect; |
| 31 | + required boolean isIntersecting; |
| 32 | + required double intersectionRatio; |
| 33 | + required Element target; |
| 34 | +}; |
| 35 | + |
| 36 | +dictionary IntersectionObserverInit { |
| 37 | + Element? root = null; |
| 38 | + DOMString rootMargin = "0px"; |
| 39 | + (double or sequence<double>) threshold = 0; |
| 40 | +}; |
0 commit comments