blob: a2905466fa7b75162edcea35a81a83f641873123 [file] [log] [blame]
// Copyright 2015 The Chromium Authors. All rights reserved.
// 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/multipage/scripting.html#the-offscreencanvas-interface
[
Constructor([EnforceRange] unsigned long width, [EnforceRange] unsigned long height),
Exposed=(Window,Worker),
RuntimeEnabled=ExperimentalCanvasFeatures,
MeasureAs=OffscreenCanvas
] interface OffscreenCanvas : EventTarget {
[EnforceRange] attribute unsigned long width;
[EnforceRange] attribute unsigned long height;
[CallWith=ScriptState, RaisesException] ImageBitmap transferToImageBitmap();
[MeasureAs=OffscreenCanvasConvertToBlob, RaisesException, CallWith=ScriptState] Promise<Blob> convertToBlob(optional ImageEncodeOptions options);
};