Backed out 4 changesets (bug 1879154) for causing bustage on nsUserCharacteristics...
[gecko.git] / dom / webidl / IntersectionObserver.webidl
blobf28240df7d2fae943cad238c0d6653436bb9e24d
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4  * You can obtain one at http://mozilla.org/MPL/2.0/.
5  *
6  * The origin of this IDL file is
7  * https://w3c.github.io/IntersectionObserver/
8  */
10 [ProbablyShortLivingWrapper, Exposed=Window]
11 interface IntersectionObserverEntry {
12   [Constant]
13   readonly attribute DOMHighResTimeStamp time;
14   [Constant]
15   readonly attribute DOMRectReadOnly? rootBounds;
16   [Constant]
17   readonly attribute DOMRectReadOnly boundingClientRect;
18   [Constant]
19   readonly attribute DOMRectReadOnly intersectionRect;
20   [Constant]
21   readonly attribute boolean isIntersecting;
22   [Constant]
23   readonly attribute double intersectionRatio;
24   [Constant]
25   readonly attribute Element target;
28 [Exposed=Window]
29 interface IntersectionObserver {
30   [Throws]
31   constructor(IntersectionCallback intersectionCallback,
32               optional IntersectionObserverInit options = {});
34   [Constant]
35   readonly attribute Node? root;
36   [Constant]
37   readonly attribute UTF8String rootMargin;
38   [Constant,Cached]
39   readonly attribute sequence<double> thresholds;
40   undefined observe(Element target);
41   undefined unobserve(Element target);
42   undefined disconnect();
43   sequence<IntersectionObserverEntry> takeRecords();
46 callback IntersectionCallback =
47   undefined (sequence<IntersectionObserverEntry> entries, IntersectionObserver observer);
49 dictionary IntersectionObserverEntryInit {
50   required DOMHighResTimeStamp time;
51   required DOMRectInit rootBounds;
52   required DOMRectInit boundingClientRect;
53   required DOMRectInit intersectionRect;
54   required Element target;
57 dictionary IntersectionObserverInit {
58   (Element or Document)? root = null;
59   UTF8String rootMargin = "0px";
60   (double or sequence<double>) threshold = 0;