aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_bindings
diff options
context:
space:
mode:
Diffstat (limited to 'components/script_bindings')
-rw-r--r--components/script_bindings/codegen/Bindings.conf4
-rw-r--r--components/script_bindings/webidls/Clipboard.webidl26
2 files changed, 30 insertions, 0 deletions
diff --git a/components/script_bindings/codegen/Bindings.conf b/components/script_bindings/codegen/Bindings.conf
index b6105c2d43a..5a95a6131a6 100644
--- a/components/script_bindings/codegen/Bindings.conf
+++ b/components/script_bindings/codegen/Bindings.conf
@@ -87,6 +87,10 @@ DOMInterfaces = {
'canGc': ['Before', 'After', 'Remove', 'ReplaceWith']
},
+'ClipboardItem': {
+ 'canGc': ['Types']
+},
+
'CountQueuingStrategy': {
'canGc': ['GetSize'],
},
diff --git a/components/script_bindings/webidls/Clipboard.webidl b/components/script_bindings/webidls/Clipboard.webidl
new file mode 100644
index 00000000000..2d2bb409e1a
--- /dev/null
+++ b/components/script_bindings/webidls/Clipboard.webidl
@@ -0,0 +1,26 @@
+/* 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/. */
+
+// https://w3c.github.io/clipboard-apis/#clipboard-item-interface
+
+typedef Promise<(DOMString or Blob)> ClipboardItemData;
+
+[SecureContext, Exposed=Window, Pref="dom_async_clipboard_enabled"]
+interface ClipboardItem {
+ [Throws] constructor(record<DOMString, ClipboardItemData> items,
+ optional ClipboardItemOptions options = {});
+
+ readonly attribute PresentationStyle presentationStyle;
+ readonly attribute /* FrozenArray<DOMString> */ any types;
+
+ // Promise<Blob> getType(DOMString type);
+
+ // static boolean supports(DOMString type);
+};
+
+enum PresentationStyle { "unspecified", "inline", "attachment" };
+
+dictionary ClipboardItemOptions {
+ PresentationStyle presentationStyle = "unspecified";
+};