#import #import #import #import #import #import #import #import #import // https://html.spec.whatwg.org/multipage/canvas.html#canvasrenderingcontext2d [Exposed=Window] interface CanvasRenderingContext2D { undefined fillRect(double x, double y, double w, double h); undefined strokeRect(double x, double y, double w, double h); undefined clearRect(double x, double y, double w, double h); undefined beginPath(); // FIXME: `DOMString` should be `CanvasFillRule` undefined fill(optional DOMString fillRule = "nonzero"); // FIXME: `DOMString` should be `CanvasFillRule` undefined fill(Path2D path, optional DOMString fillRule = "nonzero"); undefined stroke(); undefined stroke(Path2D path); undefined fillText(DOMString text, double x, double y, optional double maxWidth); undefined strokeText(DOMString text, double x, double y, optional double maxWidth); undefined drawImage((HTMLImageElement or HTMLCanvasElement) image, double dx, double dy); undefined drawImage((HTMLImageElement or HTMLCanvasElement) image, double dx, double dy, double dw, double dh); undefined drawImage((HTMLImageElement or HTMLCanvasElement) image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh); attribute double lineWidth; ImageData createImageData(long sw, long sh); ImageData getImageData(long sx, long sy, long sw, long sh); undefined putImageData(ImageData imagedata, double dx, double dy); [ImplementedAs=canvas_for_binding] readonly attribute HTMLCanvasElement canvas; TextMetrics measureText(DOMString text); // undefined clip(optional CanvasFillRule fillRule = "nonzero"); // undefined clip(Path2D path, optional CanvasFillRule fillRule = "nonzero"); // FIXME: Replace this with the two definitions above. undefined clip(); }; CanvasRenderingContext2D includes CanvasState; CanvasRenderingContext2D includes CanvasTransform; CanvasRenderingContext2D includes CanvasFillStrokeStyles; CanvasRenderingContext2D includes CanvasPath;