HTMLCanvasElement.idl 836 B

123456789101112131415161718192021222324
  1. #import <FileAPI/Blob.idl>
  2. #import <HTML/CanvasRenderingContext2D.idl>
  3. #import <HTML/HTMLElement.idl>
  4. #import <WebGL/WebGLRenderingContext.idl>
  5. typedef (CanvasRenderingContext2D or WebGLRenderingContext) RenderingContext;
  6. // https://html.spec.whatwg.org/multipage/semantics.html#htmlcanvaselement
  7. [Exposed=Window]
  8. interface HTMLCanvasElement : HTMLElement {
  9. [HTMLConstructor] constructor();
  10. [CEReactions] attribute unsigned long width;
  11. [CEReactions] attribute unsigned long height;
  12. RenderingContext? getContext(DOMString contextId, optional any options = null);
  13. USVString toDataURL(optional DOMString type = "image/png", optional double quality);
  14. undefined toBlob(BlobCallback _callback, optional DOMString type = "image/png", optional double quality);
  15. };
  16. callback BlobCallback = undefined (Blob? blob);