chromium/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.idl

// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// https://html.spec.whatwg.org/C/#the-offscreencanvas-interface

[
    Exposed=(Window,Worker),
    Transferable
] interface OffscreenCanvas : EventTarget {
    [CallWith=ScriptState, MeasureAs=OffscreenCanvas] constructor([EnforceRange] unsigned long width, [EnforceRange] unsigned long height);
    attribute [EnforceRange] unsigned long width;
    attribute [EnforceRange] unsigned long height;

    [CallWith=ScriptState, HighEntropy, MeasureAs=OffscreenCanvasTransferToImageBitmap, RaisesException] ImageBitmap transferToImageBitmap();
    [CallWith=ScriptState, HighEntropy, MeasureAs=OffscreenCanvasConvertToBlob, RaisesException] Promise<Blob> convertToBlob(optional ImageEncodeOptions options = {});

    attribute EventHandler oncontextlost;
    attribute EventHandler oncontextrestored;
};