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/.
6 * The origin of this IDL file is
7 * https://drafts.csswg.org/resize-observer/
10 enum ResizeObserverBoxOptions {
13 "device-pixel-content-box"
16 dictionary ResizeObserverOptions {
17 ResizeObserverBoxOptions box = "content-box";
21 interface ResizeObserver {
23 constructor(ResizeObserverCallback callback);
25 undefined observe(Element target, optional ResizeObserverOptions options = {});
26 undefined unobserve(Element target);
27 undefined disconnect();
30 callback ResizeObserverCallback = undefined (sequence<ResizeObserverEntry> entries, ResizeObserver observer);
33 interface ResizeObserverEntry {
34 readonly attribute Element target;
35 readonly attribute DOMRectReadOnly contentRect;
36 // We are using [Pure, Cached, Frozen] sequence until `FrozenArray` is implemented.
37 // See https://bugzilla.mozilla.org/show_bug.cgi?id=1236777 for more details.
38 [Frozen, Cached, Pure]
39 readonly attribute sequence<ResizeObserverSize> borderBoxSize;
40 [Frozen, Cached, Pure]
41 readonly attribute sequence<ResizeObserverSize> contentBoxSize;
42 [Frozen, Cached, Pure]
43 readonly attribute sequence<ResizeObserverSize> devicePixelContentBoxSize;
47 interface ResizeObserverSize {
48 readonly attribute unrestricted double inlineSize;
49 readonly attribute unrestricted double blockSize;