blob: f55852bbbd81e51cf52be6c7afe375b67e218b2f [file] [log] [blame]
// 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
] interface IntersectionObserver {
[CallWith=ScriptState, RaisesException, MeasureAs=IntersectionObserver_Constructor] constructor(IntersectionObserverCallback callback, optional IntersectionObserverInit options = {});
readonly attribute Node? 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();
};