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

Also add support for HTMLCanvasElement for the image parameter, leading to replacing HTMLImageElement with the CanvasImageSource Variant type. Also stub out the 'check the usability of the image argument' and 'is not origin-clean' operations, while taking into consideration that these can throw (and require DOM::ExceptionOr).
55 lines
2.2 KiB
Text
55 lines
2.2 KiB
Text
#import <HTML/HTMLCanvasElement.idl>
|
|
#import <HTML/HTMLImageElement.idl>
|
|
#import <HTML/ImageData.idl>
|
|
#import <HTML/TextMetrics.idl>
|
|
#import <HTML/CanvasGradient.idl>
|
|
|
|
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 scale(double x, double y);
|
|
undefined translate(double x, double y);
|
|
undefined rotate(double radians);
|
|
|
|
undefined beginPath();
|
|
undefined closePath();
|
|
undefined fill(optional DOMString fillRule = "nonzero");
|
|
undefined stroke();
|
|
undefined moveTo(double x, double y);
|
|
undefined lineTo(double x, double y);
|
|
undefined quadraticCurveTo(double cpx, double cpy, double x, double y);
|
|
undefined bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y);
|
|
|
|
undefined arc(double x, double y, double radius, double startAngle, double endAngle, optional boolean counterclockwise = false);
|
|
undefined ellipse(double x, double y, double radiusX, double radiusY, double rotation, double startAngle, double endAngle, optional boolean counterclockwise = false);
|
|
undefined rect(double x, double y, double width, double height);
|
|
|
|
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);
|
|
|
|
attribute DOMString fillStyle;
|
|
attribute DOMString strokeStyle;
|
|
attribute double lineWidth;
|
|
|
|
ImageData createImageData(double sw, double sh);
|
|
undefined putImageData(ImageData imagedata, double dx, double dy);
|
|
|
|
undefined save();
|
|
undefined restore();
|
|
undefined reset();
|
|
boolean isContextLost();
|
|
|
|
readonly attribute HTMLCanvasElement canvas;
|
|
|
|
TextMetrics measureText(DOMString text);
|
|
|
|
CanvasGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1);
|
|
CanvasGradient createLinearGradient(double x0, double y0, double x1, double y1);
|
|
CanvasGradient createConicGradient(double startAngle, double x, double y);
|
|
|
|
};
|