OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 void setTransform(unrestricted double a, unrestricted double b, unrestricted
double c, unrestricted double d, unrestricted double e, unrestricted double f); | 54 void setTransform(unrestricted double a, unrestricted double b, unrestricted
double c, unrestricted double d, unrestricted double e, unrestricted double f); |
55 void resetTransform(); | 55 void resetTransform(); |
56 | 56 |
57 // compositing | 57 // compositing |
58 attribute unrestricted double globalAlpha; // (default 1.0) | 58 attribute unrestricted double globalAlpha; // (default 1.0) |
59 attribute DOMString globalCompositeOperation; // (default source-over) | 59 attribute DOMString globalCompositeOperation; // (default source-over) |
60 attribute DOMString filter; // (default 'none') | 60 attribute DOMString filter; // (default 'none') |
61 | 61 |
62 // image smoothing | 62 // image smoothing |
63 [MeasureAs=UnprefixedImageSmoothingEnabled] attribute boolean imageSmoothing
Enabled; // (default True) | 63 [MeasureAs=UnprefixedImageSmoothingEnabled] attribute boolean imageSmoothing
Enabled; // (default True) |
64 attribute ImageSmoothingQuality imageSmoothingQuality; // (default "low") | 64 [Measure] attribute ImageSmoothingQuality imageSmoothingQuality; // (default
"low") |
65 | 65 |
66 // colors and styles (see also the CanvasDrawingStyles interface) | 66 // colors and styles (see also the CanvasDrawingStyles interface) |
67 attribute (DOMString or CanvasGradient or CanvasPattern) strokeStyle; // (de
fault black) | 67 attribute (DOMString or CanvasGradient or CanvasPattern) strokeStyle; // (de
fault black) |
68 attribute (DOMString or CanvasGradient or CanvasPattern) fillStyle; // (defa
ult black) | 68 attribute (DOMString or CanvasGradient or CanvasPattern) fillStyle; // (defa
ult black) |
69 CanvasGradient createLinearGradient(double x0, double y0, double x1, double
y1); | 69 CanvasGradient createLinearGradient(double x0, double y0, double x1, double
y1); |
70 [RaisesException] CanvasGradient createRadialGradient(double x0, double y0,
double r0, double x1, double y1, double r1); | 70 [RaisesException] CanvasGradient createRadialGradient(double x0, double y0,
double r0, double x1, double y1, double r1); |
71 [CallWith=ExecutionContext, RaisesException] CanvasPattern? createPattern(Ca
nvasImageSource image, [TreatNullAs=NullString] DOMString repetitionType); | 71 [CallWith=ExecutionContext, RaisesException] CanvasPattern? createPattern(Ca
nvasImageSource image, [TreatNullAs=NullString] DOMString repetitionType); |
72 | 72 |
73 // shadows | 73 // shadows |
74 attribute unrestricted double shadowOffsetX; | 74 attribute unrestricted double shadowOffsetX; |
75 attribute unrestricted double shadowOffsetY; | 75 attribute unrestricted double shadowOffsetY; |
76 attribute unrestricted double shadowBlur; | 76 attribute unrestricted double shadowBlur; |
77 attribute DOMString shadowColor; | 77 attribute DOMString shadowColor; |
78 | 78 |
79 // rects | 79 // rects |
80 void clearRect(unrestricted double x, unrestricted double y, unrestricted do
uble width, unrestricted double height); | 80 void clearRect(unrestricted double x, unrestricted double y, unrestricted do
uble width, unrestricted double height); |
81 void fillRect(unrestricted double x, unrestricted double y, unrestricted dou
ble width, unrestricted double height); | 81 void fillRect(unrestricted double x, unrestricted double y, unrestricted dou
ble width, unrestricted double height); |
82 void strokeRect(unrestricted double x, unrestricted double y, unrestricted d
ouble width, unrestricted double height); | 82 void strokeRect(unrestricted double x, unrestricted double y, unrestricted d
ouble width, unrestricted double height); |
83 | 83 |
84 // path API (see also CanvasPathMethods) | 84 // path API (see also CanvasPathMethods) |
85 void beginPath(); | 85 void beginPath(); |
86 void fill(optional CanvasFillRule winding); | 86 void fill(optional CanvasFillRule winding); |
87 void fill(Path2D path, optional CanvasFillRule winding); | 87 [Measure] void fill(Path2D path, optional CanvasFillRule winding); |
88 void stroke(); | 88 void stroke(); |
89 void stroke(Path2D path); | 89 [Measure] void stroke(Path2D path); |
90 // Focus rings | 90 // Focus rings |
91 void drawFocusIfNeeded(Element element); | 91 [Measure] void drawFocusIfNeeded(Element element); |
92 void drawFocusIfNeeded(Path2D path, Element element); | 92 [Measure] void drawFocusIfNeeded(Path2D path, Element element); |
93 | 93 |
94 [RuntimeEnabled=ExperimentalCanvasFeatures] void scrollPathIntoView(optional
Path2D path); | 94 [RuntimeEnabled=ExperimentalCanvasFeatures] void scrollPathIntoView(optional
Path2D path); |
95 void clip(optional CanvasFillRule winding); | 95 void clip(optional CanvasFillRule winding); |
96 void clip(Path2D path, optional CanvasFillRule winding); | 96 [Measure] void clip(Path2D path, optional CanvasFillRule winding); |
97 boolean isPointInPath(unrestricted double x, unrestricted double y, optional
CanvasFillRule winding); | 97 boolean isPointInPath(unrestricted double x, unrestricted double y, optional
CanvasFillRule winding); |
98 boolean isPointInPath(Path2D path, unrestricted double x, unrestricted doubl
e y, optional CanvasFillRule winding); | 98 [Measure] boolean isPointInPath(Path2D path, unrestricted double x, unrestri
cted double y, optional CanvasFillRule winding); |
99 boolean isPointInStroke(unrestricted double x, unrestricted double y); | 99 [Measure] boolean isPointInStroke(unrestricted double x, unrestricted double
y); |
100 boolean isPointInStroke(Path2D path, unrestricted double x, unrestricted dou
ble y); | 100 [Measure] boolean isPointInStroke(Path2D path, unrestricted double x, unrest
ricted double y); |
101 | 101 |
102 // text (see also the CanvasDrawingStyles interface) | 102 // text (see also the CanvasDrawingStyles interface) |
103 void fillText(DOMString text, unrestricted double x, unrestricted double y,
optional unrestricted double maxWidth); | 103 [Measure] void fillText(DOMString text, unrestricted double x, unrestricted
double y, optional unrestricted double maxWidth); |
104 void strokeText(DOMString text, unrestricted double x, unrestricted double y
, optional unrestricted double maxWidth); | 104 [Measure] void strokeText(DOMString text, unrestricted double x, unrestricte
d double y, optional unrestricted double maxWidth); |
105 TextMetrics measureText(DOMString text); | 105 [Measure] TextMetrics measureText(DOMString text); |
106 | 106 |
107 // drawing images | 107 // drawing images |
108 [CallWith=ExecutionContext, RaisesException] void drawImage(CanvasImageSourc
e image, unrestricted double x, unrestricted double y); | 108 [CallWith=ExecutionContext, RaisesException] void drawImage(CanvasImageSourc
e image, unrestricted double x, unrestricted double y); |
109 [CallWith=ExecutionContext, RaisesException] void drawImage(CanvasImageSourc
e image, unrestricted double x, unrestricted double y, unrestricted double width
, unrestricted double height); | 109 [CallWith=ExecutionContext, RaisesException] void drawImage(CanvasImageSourc
e image, unrestricted double x, unrestricted double y, unrestricted double width
, unrestricted double height); |
110 [CallWith=ExecutionContext, RaisesException] void drawImage(CanvasImageSourc
e image, unrestricted double sx, unrestricted double sy, unrestricted double sw,
unrestricted double sh, unrestricted double dx, unrestricted double dy, unrestr
icted double dw, unrestricted double dh); | 110 [CallWith=ExecutionContext, RaisesException] void drawImage(CanvasImageSourc
e image, unrestricted double sx, unrestricted double sy, unrestricted double sw,
unrestricted double sh, unrestricted double dx, unrestricted double dy, unrestr
icted double dw, unrestricted double dh); |
111 | 111 |
112 // hit regions | 112 // hit regions |
113 [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] void addHitRegi
on(optional HitRegionOptions options); | 113 [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] void addHitRegi
on(optional HitRegionOptions options); |
114 [RuntimeEnabled=ExperimentalCanvasFeatures] void removeHitRegion(DOMString i
d); | 114 [RuntimeEnabled=ExperimentalCanvasFeatures] void removeHitRegion(DOMString i
d); |
115 [RuntimeEnabled=ExperimentalCanvasFeatures] void clearHitRegions(); | 115 [RuntimeEnabled=ExperimentalCanvasFeatures] void clearHitRegions(); |
(...skipping 12 matching lines...) Expand all Loading... |
128 Canvas2DContextAttributes getContextAttributes(); | 128 Canvas2DContextAttributes getContextAttributes(); |
129 | 129 |
130 // FIXME: factor out to CanvasDrawingStyles | 130 // FIXME: factor out to CanvasDrawingStyles |
131 // line caps/joins | 131 // line caps/joins |
132 attribute unrestricted double lineWidth; // (default 1) | 132 attribute unrestricted double lineWidth; // (default 1) |
133 attribute DOMString lineCap; // "butt", "round", "square" (default "butt") | 133 attribute DOMString lineCap; // "butt", "round", "square" (default "butt") |
134 attribute DOMString lineJoin; // "round", "bevel", "miter" (default "miter") | 134 attribute DOMString lineJoin; // "round", "bevel", "miter" (default "miter") |
135 attribute unrestricted double miterLimit; // (default 10) | 135 attribute unrestricted double miterLimit; // (default 10) |
136 | 136 |
137 // dashed lines | 137 // dashed lines |
138 void setLineDash(sequence<unrestricted double> dash); | 138 [Measure] void setLineDash(sequence<unrestricted double> dash); |
139 sequence<unrestricted double> getLineDash(); | 139 [Measure] sequence<unrestricted double> getLineDash(); |
140 attribute unrestricted double lineDashOffset; | 140 [Measure] attribute unrestricted double lineDashOffset; |
141 | 141 |
142 // text | 142 // text |
143 attribute DOMString font; // (default 10px sans-serif) | 143 [Measure] attribute DOMString font; // (default 10px sans-serif) |
144 attribute DOMString textAlign; // "start", "end", "left", "right", "center"
(default: "start") | 144 [Measure] attribute DOMString textAlign; // "start", "end", "left", "right",
"center" (default: "start") |
145 attribute DOMString textBaseline; // "top", "hanging", "middle", "alphabetic
", "ideographic", "bottom" (default: "alphabetic") | 145 [Measure] attribute DOMString textBaseline; // "top", "hanging", "middle", "
alphabetic", "ideographic", "bottom" (default: "alphabetic") |
146 [RuntimeEnabled=ExperimentalCanvasFeatures] attribute DOMString direction; /
/ "inherit", "rtl", "ltr" (default: "inherit") | 146 [Measure, RuntimeEnabled=ExperimentalCanvasFeatures] attribute DOMString direc
tion; // "inherit", "rtl", "ltr" (default: "inherit") |
147 | 147 |
148 }; | 148 }; |
149 | 149 |
150 CanvasRenderingContext2D implements CanvasPathMethods; | 150 CanvasRenderingContext2D implements CanvasPathMethods; |
OLD | NEW |