tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

OffscreenCanvas.webidl (1666B)


      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://html.spec.whatwg.org/#the-offscreencanvas-interface
      8 */
      9 
     10 typedef (OffscreenCanvasRenderingContext2D or ImageBitmapRenderingContext or WebGLRenderingContext or WebGL2RenderingContext or GPUCanvasContext) OffscreenRenderingContext;
     11 
     12 dictionary ImageEncodeOptions {
     13  DOMString type = "image/png";
     14  unrestricted double quality;
     15 };
     16 
     17 enum OffscreenRenderingContextId { "2d", "bitmaprenderer", "webgl", "webgl2", "webgpu" };
     18 
     19 [Exposed=(Window,Worker)]
     20 interface OffscreenCanvas : EventTarget {
     21  [Throws]
     22  constructor([EnforceRange] unsigned long width, [EnforceRange] unsigned long height);
     23 
     24  [Pure, SetterThrows]
     25  attribute [EnforceRange] unsigned long width;
     26  [Pure, SetterThrows]
     27  attribute [EnforceRange] unsigned long height;
     28 
     29  [Throws]
     30  OffscreenRenderingContext? getContext(OffscreenRenderingContextId contextId,
     31                                        optional any contextOptions = null);
     32 
     33  [Throws]
     34  ImageBitmap transferToImageBitmap();
     35  [NewObject]
     36  Promise<Blob> convertToBlob(optional ImageEncodeOptions options = {});
     37 
     38  attribute EventHandler oncontextlost;
     39  attribute EventHandler oncontextrestored;
     40 
     41  // Deprecated by convertToBlob
     42  [Deprecated="OffscreenCanvasToBlob", NewObject]
     43  Promise<Blob> toBlob(optional DOMString type = "",
     44                       optional any encoderOptions);
     45 };