summaryrefslogtreecommitdiff
path: root/dom/webidl/ResizeObserver.webidl
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-09-16 16:39:15 +0000
committerMoonchild <moonchild@palemoon.org>2020-09-16 16:39:15 +0000
commit1b73824161e6cd2f5d2f63bc323b4e8a607207d0 (patch)
tree714feb5d5e361e2321a1289d94c49fd22ebf19f5 /dom/webidl/ResizeObserver.webidl
parentb4eda697ce275dbd2143e490d29e2664057b6315 (diff)
downloaduxp-1b73824161e6cd2f5d2f63bc323b4e8a607207d0.tar.gz
Issue #1643 - Part 2: Implement ResizeObserver API
Implements ResizeObserver, ResizeObserverEntry and ResizeObservation
Diffstat (limited to 'dom/webidl/ResizeObserver.webidl')
-rw-r--r--dom/webidl/ResizeObserver.webidl39
1 files changed, 39 insertions, 0 deletions
diff --git a/dom/webidl/ResizeObserver.webidl b/dom/webidl/ResizeObserver.webidl
new file mode 100644
index 0000000000..98700f53c6
--- /dev/null
+++ b/dom/webidl/ResizeObserver.webidl
@@ -0,0 +1,39 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * The origin of this IDL file is
+ * https://wicg.github.io/ResizeObserver/
+ */
+
+[Constructor(ResizeObserverCallback callback),
+ Exposed=Window,
+ Pref="layout.css.resizeobserver.enabled"]
+interface ResizeObserver {
+ [Throws]
+ void observe(Element? target);
+ [Throws]
+ void unobserve(Element? target);
+ void disconnect();
+};
+
+callback ResizeObserverCallback = void (sequence<ResizeObserverEntry> entries, ResizeObserver observer);
+
+[Constructor(Element? target),
+ ChromeOnly,
+ Pref="layout.css.resizeobserver.enabled"]
+interface ResizeObserverEntry {
+ readonly attribute Element target;
+ readonly attribute DOMRectReadOnly? contentRect;
+};
+
+[Constructor(Element? target),
+ ChromeOnly,
+ Pref="layout.css.resizeobserver.enabled"]
+interface ResizeObservation {
+ readonly attribute Element target;
+ readonly attribute long broadcastWidth;
+ readonly attribute long broadcastHeight;
+ boolean isActive();
+};