interface CanvasRenderingContext2D {  // back-reference to the canvas  readonly attribute HTMLCanvasElement canvas;  // state  void save(); // push state on state stack  void restore(); // pop state stack and restore state  // transformations (default transform is the identity matrix)  void scale(in float x, in float y);  void rotate(in float angle);  void translate(in float x, in float y);  void transform(in float m11, in float m12, in float m21, in float m22, in float dx, in float dy);  void setTransform(in float m11, in float m12, in float m21, in float m22, in float dx, in float dy);  // compositing  attribute float globalAlpha; // (default 1.0)  attribute DOMString globalCompositeOperation; // (default source-over)  // colors and styles  attribute DOMObject strokeStyle; // (default black)  attribute DOMObject fillStyle; // (default black)  CanvasGradient createLinearGradient(in float x0, in float y0, in float x1, in float y1);  CanvasGradient createRadialGradient(in float x0, in float y0, in float r0, in float x1, in float y1, in float r1);  CanvasPattern createPattern(in HTMLImageElement image, DOMString repetition);  CanvasPattern createPattern(in HTMLCanvasElement image, DOMString repetition);  // line caps/joins  attribute float lineWidth; // (default 1)  attribute DOMString lineCap; // "butt", "round", "square" (default "butt")  attribute DOMString lineJoin; // "round", "bevel", "miter" (default "miter")  attribute float miterLimit; // (default 10)  // shadows  attribute float shadowOffsetX; // (default 0)  attribute float shadowOffsetY; // (default 0)  attribute float shadowBlur; // (default 0)  attribute DOMString shadowColor; // (default transparent black)  // rects  void clearRect(in float x, in float y, in float w, in float h);  void fillRect(in float x, in float y, in float w, in float h);  void strokeRect(in float x, in float y, in float w, in float h);  // path API  void beginPath();  void closePath();  void moveTo(in float x, in float y);  void lineTo(in float x, in float y);  void quadraticCurveTo(in float cpx, in float cpy, in float x, in float y);  void bezierCurveTo(in float cp1x, in float cp1y, in float cp2x, in float cp2y, in float x, in float y);  void arcTo(in float x1, in float y1, in float x2, in float y2, in float radius);  void rect(in float x, in float y, in float w, in float h);  void arc(in float x, in float y, in float radius, in float startAngle, in float endAngle, in boolean anticlockwise);  void fill();  void stroke();  void clip();  boolean isPointInPath(in float x, in float y);  // drawing images  void drawImage(in HTMLImageElement image, in float dx, in float dy);  void drawImage(in HTMLImageElement image, in float dx, in float dy, in float dw, in float dh);  void drawImage(in HTMLImageElement image, in float sx, in float sy, in float sw, in float sh, in float dx, in float dy, in float dw, in float dh);  void drawImage(in HTMLCanvasElement image, in float dx, in float dy);  void drawImage(in HTMLCanvasElement image, in float dx, in float dy, in float dw, in float dh);  void drawImage(in HTMLCanvasElement image, in float sx, in float sy, in float sw, in float sh, in float dx, in float dy, in float dw, in float dh);  // pixel manipulation  ImageData getImageData(in float sx, in float sy, in float sw, in float sh);  void putImageData(in ImageData image, in float dx, in float dy);  // drawing text is not supported in this version of the API  // (there is no way to predict what metrics the fonts will have,  // which makes fonts very hard to use for painting)};interface CanvasGradient {  // opaque object  void addColorStop(in float offset, in DOMString color);};interface CanvasPattern {  // opaque object};interface ImageData {  readonly attribute long int width;  readonly attribute long int height;  readonly attribute int[] data;};