summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/intersection_observer/intersection_observer.idl
blob: f96388ff449f270e57e5e0fd9b08af996c758080 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// https://www.w3.org/TR/intersection-observer/#intersection-observer-interface

callback IntersectionObserverCallback = void (sequence<IntersectionObserverEntry> entries, IntersectionObserver observer);

[
    Exposed=Window,
    ActiveScriptWrappable,
    Constructor(IntersectionObserverCallback callback, optional IntersectionObserverInit options),
    ConstructorCallWith=ScriptState,
    MeasureAs=IntersectionObserver_Constructor,
    RaisesException=Constructor
] interface IntersectionObserver {
    readonly attribute Element? root;
    readonly attribute DOMString rootMargin;
    // https://github.com/WICG/IntersectionObserver/issues/114
    readonly attribute FrozenArray<double> thresholds;
    [RuntimeEnabled=IntersectionObserverV2] readonly attribute DOMHighResTimeStamp delay;
    [RuntimeEnabled=IntersectionObserverV2] readonly attribute boolean trackVisibility;
    [RaisesException] void observe(Element target);
    [RaisesException] void unobserve(Element target);
    [RaisesException] void disconnect();
    [RaisesException] sequence<IntersectionObserverEntry> takeRecords();
};