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
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 *
6 * For more information on this interface, please see
7 * https://wiki.whatwg.org/wiki/OffscreenCanvas
8 */
9
10[Constructor(unsigned long width, unsigned long height),
11 Exposed=(Window,Worker),
12 Func="mozilla::dom::DOMPrefs::OffscreenCanvasEnabled"]
13interface OffscreenCanvas : EventTarget {
14  [Pure, SetterThrows]
15  attribute unsigned long width;
16  [Pure, SetterThrows]
17  attribute unsigned long height;
18
19  [Throws]
20  nsISupports? getContext(DOMString contextId,
21                          optional any contextOptions = null);
22
23  [Throws]
24  ImageBitmap transferToImageBitmap();
25  [Throws]
26  Promise<Blob> toBlob(optional DOMString type = "",
27                       optional any encoderOptions);
28};
29
30// OffscreenCanvas includes Transferable;
31