mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 22:28:11 +00:00

This one requires drawing to the canvas, so it doesn't make so much sense to move the implementation over.
52 lines
2.2 KiB
Text
52 lines
2.2 KiB
Text
#import <HTML/HTMLCanvasElement.idl>
|
|
#import <HTML/HTMLImageElement.idl>
|
|
#import <HTML/ImageData.idl>
|
|
#import <HTML/TextMetrics.idl>
|
|
#import <HTML/Canvas/CanvasFillStrokeStyles.idl>
|
|
#import <HTML/Canvas/CanvasPath.idl>
|
|
#import <HTML/Canvas/CanvasRect.idl>
|
|
#import <HTML/Canvas/CanvasState.idl>
|
|
#import <HTML/Canvas/CanvasTransform.idl>
|
|
#import <HTML/Path2D.idl>
|
|
|
|
// https://html.spec.whatwg.org/multipage/canvas.html#canvasrenderingcontext2d
|
|
[Exposed=Window]
|
|
interface CanvasRenderingContext2D {
|
|
|
|
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 CanvasRect;
|
|
CanvasRenderingContext2D includes CanvasPath;
|