html

view tests/submission/PhilipTaylor/tools/canvas/spec.yaml @ 429:a85fcfbbf6b9

Add a few async tests now that the delay.php has been added and works.
author kkrueger@ip-208-109-98-22.ip.secureserver.net
date Fri, 19 Aug 2011 18:27:56 -0700
parents 9869aaee0eb6
children
line source
1 # Extracts from http://www.whatwg.org/specs/web-apps/current-work/
2 #
3 # (c) Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and Opera Software ASA.
4 # You are granted a license to use, reproduce and create derivative works of this document.
6 assertions:
7 - id: canvas.type
8 text: "interface HTMLCanvasElement<^> : HTMLElement {"
9 - id: size.width
10 text: "interface HTMLCanvasElement<...>attribute unsigned long width;<^>"
11 - id: size.height
12 text: "interface HTMLCanvasElement<...>attribute unsigned long height;<^>"
13 - id: canvas.getContext
14 text: "interface HTMLCanvasElement<...>object\\? getContext(in DOMString contextId, in any... args);<^>"
15 - id: fallback
16 text: "The contents of the canvas element, if any, are the element's fallback content<^>."
17 - id: size.nonnegativeinteger
18 text: "The rules for parsing non-negative integers *must* be used to obtain their numeric values<^>."
19 - id: size.missing
20 text: "If an attribute is missing<^>, <...> then the default value *must* be used instead."
21 - id: size.error
22 text: "if parsing its value returns an error<^>, then the default value *must* be used instead."
23 - id: size.default
24 text: "The width attribute defaults to 300, and the height attribute defaults to 150<^>."
25 - id: size.css
26 text: "the element can be sized arbitrarily by a style sheet. During rendering, the image is scaled to fit this layout size<^>."
27 - id: initial.reset
28 text: "When the canvas element is created, and subsequently whenever the width and height attributes are set (whether to a new value or to the previous value), the bitmap and any associated contexts *must* be cleared back to their initial state <...><^>."
29 - id: initial.colour
30 text: "When the canvas is initialized, its bitmap *must* be cleared to transparent black<^>."
31 - id: size.reflect
32 text: "The width and height IDL attributes *must* reflect the respective content attributes of the same name<^>,"
34 - id: context.unrecognised
35 text: "If contextId is not the name of a context supported by the user agent, return null and abort these steps<^>."
36 - id: context.unique
37 text: "If the getContext() method has already been invoked on this element for the same contextId, return the same object as was returned that time, and abort these steps<^>."
38 - id: context.2d
39 text: "When the getContext() method of a canvas element is to return a new object for the contextId 2d, the user agent *must* return a new CanvasRenderingContext2D object<^>."
40 - id: context.2d.extraargs
41 text: "When the getContext() method of a canvas element is to return a new object for the contextId 2d, the user agent *must* return a new CanvasRenderingContext2D object. Any additional arguments are ignored<^>."
43 - id: toDataURL.noarguments
44 text: "When a user agent is to create a serialization of the image as a file, <...> if there are no arguments, in the PNG format<^>."
45 - id: toDataURL.zerosize
46 text: "If the canvas has no pixels (i.e. either its horizontal dimension or its vertical dimension is zero) then return the string \"data:,\"<^> and abort these steps."
47 - id: toDataURL.witharguments
48 text: "If arguments is not empty, the first value must be interpreted as a MIME type giving the format to use<^>."
49 - id: toDataURL.noalpha
50 text: "For image types that do not support an alpha channel, the serialized image *must* be the canvas image composited onto a solid black background using the source-over operator<^>."
51 - id: toDataURL.png
52 text: "User agents *must* support PNG (\"image/png\")<^>."
53 - id: toDataURL.unrecognised
54 text: "If the user agent does not support the requested type, it *must* create the file using the PNG format<^>."
55 - id: toDataURL.lowercase
56 text: "User agents *must* convert the provided type to ASCII lowercase before establishing if they support that type<^>."
57 - id: toDataURL.jpeg
58 previously: [ 0, "image/png", false ]
59 text: "image/jpeg<^>"
60 - id: toDataURL.jpeg.quality
61 text: "The second argument, if it is a number in the range 0.0 to 1.0 inclusive, *must* be treated as the desired quality level<^>."
62 - id: toDataURL.jpeg.nan
63 text: "If it is not a number<^> <...>, the user agent *must* use its default value, as if the argument had been omitted."
64 - id: toDataURL.jpeg.range
65 text: "If it is <...> outside that range<^>, the user agent *must* use its default value, as if the argument had been omitted."
66 - id: toDataURL.arguments
67 text: "Other arguments *must* be ignored and must not cause the user agent to raise an exception<^>."
69 - id: 2d.coordinatespace
70 text: "flat Cartesian surface whose origin (0,0) is at the top left corner, with the coordinate space having x values increasing when going right, and y values increasing when going down<^>."
71 - id: context.2d.type
72 text: "interface CanvasRenderingContext2D<^> {"
73 - id: 2d.canvasGradient.type
74 text: "interface CanvasGradient<^> {"
75 - id: 2d.imageData.type
76 text: "interface ImageData<^> {"
77 - id: 2d.canvas.attribute
78 text: "readonly<^> attribute HTMLCanvasElement canvas;"
79 - id: 2d.canvas
80 text: "The canvas attribute *must* return the canvas element that the context paints on<^>."
81 - id: 2d.nonfinite
82 text: "Except where otherwise specified, for the 2D context interface, any method call with a numeric argument whose value is infinite or a NaN value *must* be ignored<^>."
84 - id: 2d.currentColor.onset
85 text: "Whenever the CSS value currentColor is used as a color in this API, the \"computed value of the 'color' property\" for the purposes of determining the computed value of the currentColor keyword is the computed value of the 'color' property on the element in question at the time that the color is specified<^>"
86 - id: 2d.currentColor.outofdoc
87 text: "If the computed value of the 'color' property is undefined for a particular case (e.g. because the element is not in a Document), then the \"computed value of the 'color' property\" for the purposes of determining the computed value of the currentColor keyword is fully opaque black<^>."
88 - id: 2d.currentColor.gradient
89 text: "In the case of addColorStop() on CanvasGradient, the \"computed value of the 'color' property\" for the purposes of determining the computed value of the currentColor keyword is always fully opaque black<^> (there is no associated element)."
91 - id: 2d.state.transformation
92 text: "The current transformation matrix<^>."
93 - id: 2d.state.clip
94 text: "The current clipping region<^>."
95 - meta: |
96 for s in [
97 'strokeStyle', 'fillStyle', 'globalAlpha',
98 'lineWidth', 'lineCap', 'lineJoin', 'miterLimit',
99 'shadowOffsetX', 'shadowOffsetY', 'shadowBlur', 'shadowColor',
100 'globalCompositeOperation',
101 'font', 'textAlign', 'textBaseline'
102 ]:
103 assertions.append( {
104 'id': '2d.state.%s' % s,
105 'text': 'The current values of the following attributes:<...>%s<^>' % s
106 } )
107 - id: 2d.state.path
108 text: "The current path<^> <...> are not part of the drawing state."
109 - id: 2d.state.bitmap
110 text: "The <...> current bitmap<^> are not part of the drawing state."
112 - id: 2d.state.save
113 text: "The save() method *must* push a copy of the current drawing state onto the drawing state stack<^>."
114 - id: 2d.state.restore
115 text: "The restore() method *must* pop the top entry in the drawing state stack, and reset the drawing state it describes<^>."
116 - id: 2d.state.restore.underflow
117 text: "If there is no saved state, the method *must* do nothing<^>."
119 - id: 2d.transformation.initial
120 text: "When the context is created, the transformation matrix *must* initially be the identity transform<^>."
121 - id: 2d.transformation.order
122 text: "The transformations *must* be performed in reverse order<^>."
123 - id: 2d.transformation.scale
124 text: "The scale(x, y) method *must* add the scaling transformation described by the arguments to the transformation matrix<^>."
125 - id: 2d.transformation.scale.multiple
126 text: "The factors are multiples<^>."
127 - id: 2d.transformation.rotate
128 text: "The rotate(angle) method *must* add the rotation transformation described by the argument to the transformation matrix<^>."
129 - id: 2d.transformation.rotate.direction
130 text: "The angle argument represents a clockwise rotation angle<^>"
131 - id: 2d.transformation.rotate.radians
132 text: "The angle argument <...> expressed in radians<^>."
133 - id: 2d.transformation.translate
134 text: "The translate(x, y) method *must* add the translation transformation described by the arguments to the transformation matrix<^>."
135 - id: 2d.transformation.transform
136 text: "The transform(a, b, c, d, e, f) method *must* replace the current transformation matrix with the result of multiplying the current transformation matrix with the matrix described by<^>:"
137 - id: 2d.transformation.transform.multiply
138 text: "The transform(a, b, c, d, e, f) method *must* replace the current transformation matrix with the result of multiplying<^> the current transformation matrix with the matrix described by:"
139 - id: 2d.transformation.setTransform
140 text: "The setTransform(a, b, c, d, e, f) method *must* <...> invoke the transform(a, b, c, d, e, f) method with the same arguments<^>"
141 - id: 2d.transformation.setTransform.identity
142 text: "The setTransform(a, b, c, d, e, f) method *must* reset the current transform to the identity matrix<^>, "
145 - id: 2d.composite.operation
146 text: "All drawing operations are affected by the global compositing attributes, globalAlpha and globalCompositeOperation<^>."
148 - id: 2d.composite.globalAlpha.shape
149 text: "The globalAlpha attribute gives an alpha value that is applied to shapes<^> and images before they are composited onto the canvas."
150 - id: 2d.composite.globalAlpha.image
151 text: "The globalAlpha attribute gives an alpha value that is applied to shapes and images<^> before they are composited onto the canvas."
152 - id: 2d.composite.globalAlpha.range
153 text: "The value must be in the range from 0.0 (fully transparent) to 1.0 (no additional transparency). If an attempt is made to set the attribute to a value outside this range, including Infinity and Not-a-Number (NaN) values, the attribute *must* retain its previous value<^>."
154 - id: 2d.composite.globalAlpha.default
155 text: "When the context is created, the globalAlpha attribute *must* initially have the value 1.0<^>."
157 - id: 2d.composite.operation.shape
158 text: "The globalCompositeOperation attribute sets how shapes<^> and images are drawn onto the existing bitmap,"
159 - id: 2d.composite.operation.image
160 text: "The globalCompositeOperation attribute sets how shapes and images<^> are drawn onto the existing bitmap,"
162 - id: 2d.composite.source-atop
163 text: "source-atop<^><eol>"
164 - id: 2d.composite.source-in
165 text: "source-in<^><eol>"
166 - id: 2d.composite.source-out
167 text: "source-out<^><eol>"
168 - id: 2d.composite.source-over
169 text: "source-over (default)<^><eol>"
170 - id: 2d.composite.destination-atop
171 text: "destination-atop<^><eol>"
172 - id: 2d.composite.destination-in
173 text: "destination-in<^><eol>"
174 - id: 2d.composite.destination-out
175 text: "destination-out<^><eol>"
176 - id: 2d.composite.destination-over
177 text: "destination-over<^><eol>"
178 - id: 2d.composite.lighter
179 text: "lighter<^><eol>"
180 - id: 2d.composite.copy
181 text: "copy<^><eol>"
182 - id: 2d.composite.xor
183 text: "xor<^><eol>"
185 - id: 2d.composite.operation.casesensitive
186 text: "These values are all case-sensitive<^> <...> they *must* be used exactly as shown."
187 - id: 2d.composite.operation.exact
188 text: "User agents *must* not recognize values that are not a case-sensitive match for one of the values given above<^>."
189 - id: 2d.composite.operation.porterduff
190 text: "The operators in the above list *must* be treated as described by the Porter-Duff operator given at the start of their description (e.g. A over B)<^>."
191 - id: 2d.composite.operation.unrecognised
192 text: "On setting, if the user agent does not recognize the specified value, it *must* be ignored, leaving the value of globalCompositeOperation unaffected<^>."
193 - id: 2d.composite.operation.default
194 text: "When the context is created, the globalCompositeOperation attribute *must* initially have the value source-over<^>."
197 - id: 2d.colours.parse
198 text: "On setting, strings *must* be parsed as CSS <color> values and the color assigned<^>,"
199 - id: 2d.gradient.assign
200 text: "On setting, <...> CanvasGradient<^> and CanvasPattern objects *must* be assigned themselves."
201 - id: 2d.pattern.assign
202 text: "On setting, <...> CanvasGradient and CanvasPattern<^> objects *must* be assigned themselves."
203 - id: 2d.colours.invalidstring
204 text: "If the value is a string but cannot be parsed as a CSS <color> value<^>, <...> then it *must* be ignored, and the attribute must retain its previous value."
205 - id: 2d.colours.invalidtype
206 text: "If the value is <...> neither a string, a CanvasGradient, nor a CanvasPattern<^>, then it *must* be ignored, and the attribute must retain its previous value."
207 - id: 2d.colours.getcolour
208 text: "On getting, if the value is a color, then the serialization of the color *must* be returned<^>."
209 - id: 2d.gradient.object
210 text: "if it is not a color but a CanvasGradient<^> or CanvasPattern, then the respective object *must* be returned."
211 - id: 2d.pattern.object
212 text: "if it is not a color but a CanvasGradient or CanvasPattern<^>, then the respective object *must* be returned."
213 - id: 2d.serializecolour.solid
214 text: "if it has alpha equal to 1.0, then the string is a lowercase six-digit hex value<^>"
215 - id: 2d.serializecolour.transparent
216 text: "Otherwise, the color value has alpha less than 1.0, and the string is the color value in the CSS rgba() functional-notation format<^>:"
217 - id: 2d.colours.default
218 text: "When the context is created, the strokeStyle and fillStyle attributes *must* initially have the string value #000000<^>."
220 - id: 2d.gradient.interpolate.linear
221 text: "Between each such stop, the colors and the alpha component *must* be linearly interpolated<^> over the RGBA space without premultiplying the alpha value to find the color to use at that offset."
222 - id: 2d.gradient.interpolate.alpha
223 text: "Between each such stop, the colors and the alpha component *must* be linearly interpolated over the RGBA space without premultiplying the alpha value<^> to find the color to use at that offset."
224 - id: 2d.gradient.outside.first
225 text: "Before the first stop, the color *must* be the color of the first stop<^>."
226 - id: 2d.gradient.outside.last
227 text: "After the last stop, the color *must* be the color of the last stop<^>."
228 - id: 2d.gradient.empty
229 text: "When there are no stops, the gradient is transparent black<^>."
232 - id: 2d.gradient.invalidoffset
233 text: "If the offset is less than 0, greater than 1, infinite, or NaN, then an INDEX_SIZE_ERR exception *must* be raised<^>."
234 - id: 2d.gradient.invalidcolour
235 text: "If the color cannot be parsed as a CSS <color> value, then a SYNTAX_ERR exception *must* be raised<^>."
236 - id: 2d.gradient.update
237 text: "Otherwise, the gradient *must* have a new stop placed, at offset offset relative to the whole gradient, and with the color obtained by parsing color as a CSS <color> value<^>."
238 - id: 2d.gradient.interpolate.overlap
239 text: "If multiple stops are added at the same offset on a gradient, they *must* be placed in the order added, with the first one closest to the start of the gradient, <...><^>."
241 - id: 2d.gradient.linear.nonfinite
242 text: "If any of the arguments to createLinearGradient() are infinite or NaN, the method *must* raise a NOT_SUPPORTED_ERR exception<^>."
243 - id: 2d.gradient.linear.return
244 text: "Otherwise, the method *must* return a linear CanvasGradient initialized with the specified line<^>."
245 - id: 2d.gradient.linear.rendering
246 text: "Linear gradients *must* be rendered such that all points on a line perpendicular to the line that crosses the start and end points have the color at the point where those two lines cross (with the colors coming from the interpolation and extrapolation described above)<^>."
247 - id: 2d.gradient.linear.transform
248 text: "The points in the linear gradient *must* be transformed as described by the current transformation matrix when rendering<^>."
249 - id: 2d.gradient.linear.zerosize
250 text: "If x0 = x1 and y0 = y1, then the linear gradient *must* paint nothing<^>."
252 - id: 2d.gradient.radial.nonfinite
253 text: "If any of the arguments are infinite or NaN, a NOT_SUPPORTED_ERR exception *must* be raised<^>."
254 - id: 2d.gradient.radial.negative
255 text: "If either of r0 or r1 are negative, an INDEX_SIZE_ERR exception *must* be raised<^>."
256 - id: 2d.gradient.radial.return
257 text: "Otherwise, the method *must* return a radial CanvasGradient initialized with the two specified circles<^>."
258 - id: 2d.gradient.radial.rendering
259 text: "Radial gradients *must* be rendered by following these steps<^>:"
260 - id: 2d.gradient.radial.equal
261 text: "If x0 = x1 and y0 = y1 and r0 = r1, then the radial gradient *must* paint nothing<^>."
262 - id: 2d.gradient.extent
263 text: "Gradients *must* be painted only where the relevant stroking or filling effects requires that they be drawn<^>."
264 - id: 2d.gradient.radial.transform
265 text: "The points in the radial gradient *must* be transformed as described by the current transformation matrix when rendering<^>."
268 - id: 2d.pattern.modify
269 text: "Modifying this image after calling the createPattern() method *must* not affect the pattern<^>."
270 - id: 2d.pattern.missing
271 text: "If the empty string is specified, repeat *must* be assumed<^>."
272 - id: 2d.pattern.unrecognised
273 text: "If an unrecognized value is given, then the user agent *must* raise a SYNTAX_ERR exception<^>."
274 - id: 2d.pattern.exact
275 text: "User agents *must* recognize the four values described above exactly (e.g. they must not do case folding)<^>."
276 - id: 2d.pattern.return
277 text: "the method *must* return a CanvasPattern object suitably initialized<^>."
278 - id: 2d.pattern.IDL
279 text: "CanvasPattern createPattern(in HTMLImageElement image, in DOMString repetition);<...>CanvasPattern createPattern(in HTMLCanvasElement image, in DOMString repetition);<...>CanvasPattern createPattern(in HTMLVideoElement image, in DOMString repetition);<^>"
280 - id: 2d.pattern.incomplete.image
281 text: "If the image argument is an HTMLImageElement object that is not fully decodable<^><...> then the implementation *must* return null."
282 - id: 2d.pattern.incomplete.video
283 previously: [ 6, "createPattern" ]
284 text: "If the image argument is <...> an HTMLVideoElement object whose readyState attribute is either HAVE_NOTHING or HAVE_METADATA<^>, then the implementation *must* return null."
285 - id: 2d.pattern.zerocanvas
286 previously: [ 10, "createPattern" ]
287 text: "If the image argument is an HTMLCanvasElement object with either a horizontal dimension or a vertical dimension equal to zero, then the implementation *must* raise an INVALID_STATE_ERR exception<^>."
288 - id: 2d.pattern.painting
289 text: "Patterns *must* be painted so that the top left of the first image is anchored at the origin of the coordinate space, and images are then repeated horizontally to the left and right (if the repeat-x string was specified) or vertically up and down (if the repeat-y string was specified) or in all four directions all over the canvas (if the repeat string was specified)<^>."
290 - id: 2d.pattern.unscaled
291 text: "The images are not scaled by this process; one CSS pixel of the image *must* be painted on one coordinate space unit<^>."
292 - id: 2d.pattern.extent
293 text: "patterns *must* actually be painted only where the stroking or filling effect requires that they be drawn<^>, and are affected by the current transformation matrix."
294 - id: 2d.pattern.animated.image
295 text: "When the createPattern() method is passed an animated image as its image argument, the user agent must use the poster frame of the animation, or, if there is no poster frame, the first frame of the animation<^>."
296 - id: 2d.pattern.animated.video
297 previously: [ 4, "createPattern" ]
298 text: "When the image argument is an HTMLVideoElement, then the frame at the current playback position *must* be used as the source image<^>,"
299 - id: 2d.pattern.video.size
300 previously: [ 4, "createPattern" ]
301 text: "When the image argument is an HTMLVideoElement, <...> the source image's dimensions *must* be the intrinsic width and intrinsic height of the media resource (i.e. after any aspect-ratio correction has been applied)<^>."
304 - id: 2d.lineWidth
305 text: "The lineWidth attribute gives the width of lines, in coordinate space units<^>."
306 - id: 2d.lineWidth.get
307 text: "The lineWidth attribute <...>. On getting, it *must* return the current value<^>."
308 - id: 2d.lineWidth.invalid
309 text: "The lineWidth attribute <...>. On setting, zero, negative, infinite, and NaN values *must* be ignored, leaving the value unchanged<^>;"
310 - id: 2d.lineWidth.set
311 text: "The lineWidth attribute <...>. On setting, <...> other values *must* change the current value to the new value<^>."
312 - id: 2d.lineWidth.default
313 text: "the lineWidth attribute *must* initially have the value 1.0<^>."
314 - id: 2d.lineCap.end
315 text: "The lineCap attribute defines the type of endings that UAs will place on the end of lines<^>."
316 - id: 2d.lineCap.butt
317 text: "The butt value means that the end of each line has a flat edge perpendicular to the direction of the line (and that no additional line cap is added)<^>."
318 - id: 2d.lineCap.round
319 text: "The round value means that a semi-circle with the diameter equal to the width of the line *must* then be added on to the end of the line<^>."
320 - id: 2d.lineCap.square
321 text: "The square value means that a rectangle with the length of the line width and the width of half the line width, placed flat against the edge perpendicular to the direction of the line, *must* be added at the end of each line<^>."
322 - id: 2d.lineCap.get
323 previously: [ 2, "The lineCap attribute" ]
324 text: "On getting, it *must* return the current value<^>."
325 - id: 2d.lineCap.set
326 text: "On setting, if the new value is one of the literal strings butt, round, and square, then the current value *must* be changed to the new value<^>;"
327 - id: 2d.lineCap.invalid
328 text: "On setting, if the new value is one of the literal strings butt, round, and square, then <...>; other values *must* ignored, leaving the value unchanged<^>."
329 - id: 2d.lineCap.default
330 text: "When the context is created, the lineCap attribute *must* initially have the value butt<^>."
331 - id: 2d.lineJoin.get
332 previously: [ 2, "lineJoin" ]
333 text: "On getting, it *must* return the current value<^>."
334 - id: 2d.lineJoin.set
335 text: "On setting, if the new value is one of the literal strings bevel, round, and miter, then the current value *must* be changed to the new value<^>;"
336 - id: 2d.lineJoin.invalid
337 text: "On setting, if the new value is one of the literal strings bevel, round, and miter, then <...>; other values *must* be ignored, leaving the value unchanged<^>."
338 - id: 2d.lineJoin.default
339 text: "When the context is created, the lineJoin attribute *must* initially have the value miter<^>."
340 - id: 2d.lineJoin.joins
341 text: "A join exists at any point in a subpath shared by two consecutive lines<^>."
342 - id: 2d.lineJoin.joinclosed
343 text: "When a subpath is closed, then a join also exists at its first point (equivalent to its last point) connecting the first and last lines in the subpath<^>."
344 - id: 2d.lineJoin.common
345 text: "A filled triangle connecting these two opposite corners with a straight line, with the third point of the triangle being the join point, *must* be rendered at all joins<^>."
346 - id: 2d.lineJoin.round
347 text: "The round value means that a filled arc connecting the two aforementioned corners of the join, abutting (and not overlapping) the aforementioned triangle, with the diameter equal to the line width and the origin at the point of the join, *must* be rendered at joins<^>."
348 - id: 2d.lineJoin.bevel
349 text: "The bevel value means that this is all that is rendered at joins<^>."
350 - id: 2d.lineJoin.miter
351 text: "The miter value means that a second filled triangle *must* (if it can given the miter length) be rendered at the join, with one line being the line between the two aforementioned corners, abutting the first triangle, and the other two being continuations of the outside edges of the two joining lines, as long as required to intersect without going over the miter length<^>."
352 - id: 2d.lineJoin.miterLimit
353 text: "If the miter length would cause the miter limit ratio to be exceeded, this second triangle *must* not be rendered<^>."
354 - id: 2d.miterLimit.get
355 text: "The miter limit <...>. On getting, it *must* return the current value<^>."
356 - id: 2d.miterLimit.invalid
357 text: "The miter limit <...>. On setting, zero, negative, infinite, and NaN values *must* be ignored, leaving the value unchanged<^>;"
358 - id: 2d.miterLimit.set
359 text: "The miter limit <...>. On setting, <...>; other values *must* change the current value to the new value<^>."
360 - id: 2d.miterLimit.default
361 text: "When the context is created, the miterLimit attribute *must* initially have the value 10.0<^>."
364 - id: 2d.shadow.color.initial
365 text: "When the context is created, the shadowColor attribute initially *must* be fully-transparent black<^>."
366 - id: 2d.shadow.color.get
367 text: "On getting, the serialization of the color *must* be returned<^>."
368 - id: 2d.shadow.color.set
369 text: "On setting, the new value *must* be parsed as a CSS <color> value and the color assigned<^>."
370 - id: 2d.shadow.color.invalid
371 text: "If the value cannot be parsed as a CSS <color> value then it *must* be ignored, and the attribute must retain its previous value<^>."
372 - id: 2d.shadow.offset.initial
373 text: "When the context is created, the shadow offset attributes *must* initially have the value 0<^>."
374 - id: 2d.shadow.offset.get
375 text: "On getting, they *must* return their current value<^>."
376 - id: 2d.shadow.offset.set
377 text: "On setting, the attribute being set *must* be set to the new value<^>,"
378 - id: 2d.shadow.offset.invalid
379 text: "On setting, <...> if the value is infinite or NaN, in which case the new value *must* be ignored<^>."
380 - id: 2d.shadow.blur.initial
381 text: "When the context is created, the shadowBlur attribute *must* initially have the value 0<^>."
382 - id: 2d.shadow.blur.get
383 text: "On getting, the attribute *must* return its current value<^>."
384 - id: 2d.shadow.blur.set
385 text: "On setting the attribute *must* be set to the new value<^>,"
386 - id: 2d.shadow.blur.invalid
387 text: "On setting <...> if the value is negative, infinite or NaN, in which case the new value *must* be ignored<^>."
388 - id: 2d.shadow.enable
389 text: "Shadows are only drawn if the opacity component of the alpha component of the color of shadowColor is non-zero and either the shadowBlur is non-zero, or the shadowOffsetX is non-zero, or the shadowOffsetY is non-zero<^>."
390 - id: 2d.shadow.render
391 text: "When shadows are drawn, they *must* be rendered as follows<^>:"
393 - id: 2d.rect.transform
394 text: "The current transformation matrix *must* be applied to the following four coordinates<^>,"
395 - id: 2d.rect.closed
396 text: "the following four coordinates, which form the path that *must* then be closed to get the specified rectangle<^>:"
397 - id: 2d.clearRect
398 text: "The clearRect(x, y, w, h) method *must* clear the pixels in the specified rectangle that also intersect the current clipping region to a fully transparent black, erasing any previous image<^>."
399 - id: 2d.fillRect
400 text: "The fillRect(x, y, w, h) method *must* paint the specified rectangular area using the fillStyle<^>."
401 - id: 2d.strokeRect
402 text: "The strokeRect(x, y, w, h) method *must* stroke the specified rectangle's path using the strokeStyle, lineWidth, lineJoin, and (if appropriate) miterLimit attributes<^>."
405 - id: 2d.path.initial
406 text: "Initially, the context's path *must* have zero subpaths<^>."
407 - id: 2d.path.transformation
408 text: "The points and lines added to the path by these methods *must* be transformed according to the current transformation matrix as they are added<^>."
409 - id: 2d.path.beginPath
410 text: "The beginPath() method *must* empty the list of subpaths so that the context once again has zero subpaths<^>."
411 - id: 2d.path.moveTo
412 text: "The moveTo(x, y) method *must* create a new subpath with the specified point as its first (and only) point<^>."
413 - id: 2d.path.ensure
414 text: "When the user agent is to ensure there is a subpath for a coordinate (x, y), the user agent must check to see if the context has any subpaths, and if it does not, then the user agent *must* create a new subpath with the point (x, y) as its first (and only) point, as if the moveTo() method had been called<^>."
415 - id: 2d.path.closePath.empty
416 text: "The closePath() method *must* do nothing if the context has no subpaths<^>."
417 - id: 2d.path.closePath.nonempty
418 text: "The closePath() method <...> *must* mark the last subpath as closed, create a new subpath whose first point is the same as the previous subpath's first point, and finally add this new subpath to the path<^>."
419 - id: 2d.path.lineTo.empty
420 text: "The lineTo(x, y) method *must* ensure there is a subpath for (x, y) if the context has no subpaths<^>."
421 - id: 2d.path.lineTo.nonempty
422 text: "The lineTo(x, y) method <...> *must* connect the last point in the subpath to the given point (x, y) using a straight line, and must then add the given point (x, y) to the subpath<^>."
423 - id: 2d.path.quadratic.empty
424 text: "The quadraticCurveTo(cpx, cpy, x, y) method *must* ensure there is a subpath for (cpx, cpy)<^>,"
425 - id: 2d.path.quadratic.nonempty
426 text: "The quadraticCurveTo(cpx, cpy, x, y) method <...> *must* connect the last point in the subpath to the given point (x, y) using a quadratic B<...>zier curve with control point (cpx, cpy), and must then add the given point (x, y) to the subpath<^>."
427 - id: 2d.path.bezier.empty
428 text: "The bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) method *must* ensure there is a subpath for (cp1x, cp1y)<^>,"
429 - id: 2d.path.bezier.nonempty
430 text: "The bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) method <...> *must* connect the last point in the subpath to the given point (x, y) using a cubic B<...>zier curve with control points (cp1x, cp1y) and (cp2x, cp2y). Then, it must add the point (x, y) to the subpath<^>."
431 - id: 2d.path.arcTo.empty
432 text: "The arcTo(x1, y1, x2, y2, radius) method *must* first ensure there is a subpath for (x1, y1)<^>."
433 - id: 2d.path.arcTo.negative
434 previously: [ 2, "arcTo(" ]
435 text: "Negative values for radius *must* cause the implementation to raise an INDEX_SIZE_ERR exception<^>."
436 - id: 2d.path.arcTo.coincide.01
437 text: "If the point (x0, y0) is equal to the point (x1, y1)<^>, or if the point (x1, y1) is equal to the point (x2, y2), or if the radius radius is zero, then the method *must* add the point (x1, y1) to the subpath, and connect that point to the previous point (x0, y0) by a straight line."
438 - id: 2d.path.arcTo.coincide.12
439 text: "If the point (x0, y0) is equal to the point (x1, y1), or if the point (x1, y1) is equal to the point (x2, y2)<^>, or if the radius radius is zero, then the method *must* add the point (x1, y1) to the subpath, and connect that point to the previous point (x0, y0) by a straight line."
440 - id: 2d.path.arcTo.zeroradius
441 text: "If the point (x0, y0) is equal to the point (x1, y1), or if the point (x1, y1) is equal to the point (x2, y2), or if the radius radius is zero<^>, then the method *must* add the point (x1, y1) to the subpath, and connect that point to the previous point (x0, y0) by a straight line."
442 - id: 2d.path.arcTo.collinear
443 text: "if the points (x0, y0), (x1, y1), and (x2, y2) all lie on a single straight line, then the method *must* add the point (x1, y1) to the subpath, and connect that point to the previous point (x0, y0) by a straight line<^>."
444 - id: 2d.path.arcTo.shape
445 text: "The method *must* connect the point (x0, y0) to the start tangent point by a straight line, adding the start tangent point to the subpath, and then must connect the start tangent point to the end tangent point by The Arc, adding the end tangent point to the subpath<^>."
447 - id: 2d.path.arc.nonempty
448 text: "If the context has any subpaths, then the method *must* add a straight line from the last point in the subpath to the start point of the arc<^>."
449 - id: 2d.path.arc.draw
450 text: "it *must* draw the arc between the start point of the arc and the end point of the arc, and add the start and end points of the arc to the subpath<^>."
451 - id: 2d.path.arc.zero
452 text: "If the two points are the same, or if the radius is zero<^>, then the arc is defined as being of zero length in both directions."
453 - id: 2d.path.arc.negative
454 previously: [ 2, "anticlockwise" ]
455 text: "Negative values for radius *must* cause the implementation to raise an INDEX_SIZE_ERR exception<^>."
457 - id: 2d.path.rect.subpath
458 text: "The rect(x, y, w, h) method *must* create a new subpath containing just the four points (x, y), (x+w, y), (x+w, y+h), (x, y+h), with those four points connected by straight lines<^>"
459 - id: 2d.path.rect.closed
460 text: "The rect(x, y, w, h) method <...> *must* then mark the subpath as closed<^>."
461 - id: 2d.path.rect.newsubpath
462 text: "The rect(x, y, w, h) method <...> *must* then create a new subpath with the point (x, y) as the only point in the subpath<^>."
464 - id: 2d.path.fill.basic
465 text: "The fill() method *must* fill all the subpaths of the current path, using fillStyle, and using the non-zero winding number rule<^>."
466 - id: 2d.path.fill.closed
467 text: "Open subpaths *must* be implicitly closed when being filled (without affecting the actual subpaths)<^>."
468 - id: 2d.path.stroke.basic
469 text: "The stroke() method *must* calculate the strokes of all the subpaths of the current path, using the lineWidth, lineCap, lineJoin, and (if appropriate) miterLimit attributes, and then fill the combined stroke area using the strokeStyle attribute<^>."
470 - id: 2d.path.unaffected
471 text: "Paths, when filled or stroked, *must* be painted without affecting the current path<^>"
472 - id: 2d.path.subjected
473 text: "Paths, when filled or stroked, <...> *must* be subject to shadow effects, global alpha, the clipping region, and global composition operators<^>."
475 - id: 2d.path.stroke.prune
476 text: "Zero-length line segments *must* be pruned before stroking a path<^>."
477 - id: 2d.path.stroke.empty
478 text: "Empty subpaths *must* be ignored<^>."
480 - id: 2d.path.clip.basic
481 text: "The clip() method *must* create a new clipping region by calculating the intersection of the current clipping region and the area described by the current path, using the non-zero winding number rule<^>."
482 - id: 2d.path.clip.closed
483 text: "Open subpaths *must* be implicitly closed when computing the clipping region, without affecting the actual subpaths<^>."
484 - id: 2d.path.clip.initial
485 text: "When the context is initialized, the clipping region *must* be set to the rectangle with the top left corner at (0,0) and the width and height of the coordinate space<^>."
486 - id: 2d.path.isPointInPath
487 text: "The isPointInPath(x, y) method *must* return true if the point given by the x and y coordinates passed to the method, when treated as coordinates in the canvas coordinate space unaffected by the current transformation, is inside the current path as determined by the non-zero winding number rule; and must return false otherwise<^>."
488 - id: 2d.path.isPointInPath.edge
489 text: "The isPointInPath(x, y) method *must* return true if <...>. Points on the path itself are considered to be inside the path<^>."
490 - id: 2d.path.isPointInPath.nonfinite
491 text: "If either of the arguments is infinite or NaN, then the method *must* return false<^>."
493 # TODO: Focus management
495 - id: 2d.text.font.parse
496 text: "The font IDL attribute, on setting, *must* be parsed the same way as the 'font' property of CSS (but without supporting property-independent style sheet syntax like 'inherit')<^>,"
497 - id: 2d.text.font.lineheight
498 text: "The font IDL attribute, on setting, *must* be parsed <...> with the 'line-height' component forced to 'normal'<^>,"
499 - id: 2d.text.font.fontsize
500 text: "The font IDL attribute, on setting, *must* be parsed <...> with the 'font-size' component converted to CSS pixels<^>,"
501 - id: 2d.text.font.systemfonts
502 text: "The font IDL attribute, on setting, *must* be parsed <...> with system fonts being computed to explicit values<^>."
503 - id: 2d.text.font.invalid
504 text: "If the new value is syntactically incorrect (including using property-independent style sheet syntax like 'inherit' or 'initial'), then it *must* be ignored, without assigning a new font value<^>."
506 - id: 2d.text.font.fontface
507 text: "Font names must be interpreted in the context of the canvas element's stylesheets; any fonts embedded using @font-face *must* therefore be available once they are loaded<^>."
508 - id: 2d.text.font.notfullyloaded
509 text: "If a font is referenced before it is fully loaded, then it *must* be treated as if it was an unknown font, falling back to another as described by the relevant CSS specifications<^>."
510 - id: 2d.text.font.get
511 text: "On getting, the font attribute *must* return the serialized form of the current font of the context (with no 'line-height' component)<^>."
512 - id: 2d.text.font.default
513 text: "When the context is created, the font of the context *must* be set to 10px sans-serif<^>."
514 - id: 2d.text.font.size
515 text: "When the 'font-size' component is set to lengths using percentages, 'em' or 'ex' units, or the 'larger' or 'smaller' keywords, these *must* be interpreted relative to the computed value of the 'font-size' property of the corresponding canvas element at the time that the attribute is set<^>."
516 - id: 2d.text.font.weight
517 text: "When the 'font-weight' component is set to the relative values 'bolder' and 'lighter', these *must* be interpreted relative to the computed value of the 'font-weight' property of the corresponding canvas element at the time that the attribute is set<^>."
518 - id: 2d.text.font.undefined
519 text: "If the computed values are undefined for a particular case (e.g. because the canvas element is not in a Document), then the relative keywords *must* be interpreted relative to the normal-weight 10px sans-serif default<^>."
520 - id: 2d.text.align.get
521 text: "The textAlign IDL attribute, on getting, *must* return the current value<^>."
522 - id: 2d.text.align.set
523 text: "On setting, if the value is one of start, end, left, right, or center, then the value *must* be changed to the new value<^>."
524 - id: 2d.text.align.invalid
525 text: "The textAlign IDL attribute, <...> Otherwise, the new value *must* be ignored<^>."
526 - id: 2d.text.align.default
527 text: "When the context is created, the textAlign attribute *must* initially have the value start<^>."
528 - id: 2d.text.baseline.get
529 text: "The textBaseline IDL attribute, on getting, *must* return the current value<^>."
530 - id: 2d.text.baseline.set
531 text: "On setting, if the value is one of top, hanging, middle, alphabetic, ideographic, or bottom, then the value *must* be changed to the new value<^>."
532 - id: 2d.text.baseline.invalid
533 text: "The textBaseline IDL attribute, <...> Otherwise, the new value *must* be ignored<^>."
534 - id: 2d.text.baseline.default
535 text: "When the context is created, the textBaseline attribute *must* initially have the value alphabetic<^>."
537 - id: 2d.text.draw
538 text: "The fillText() and strokeText() methods <...> when the methods are called, the user agent *must* run the following steps<^>:"
539 - id: 2d.text.draw.spaces
540 text: "Replace all the space characters in text with U+0020 SPACE characters<^>."
541 - id: 2d.text.draw.direction
542 text: "the 'direction' property of the inline box set to the directionality of the canvas element<^>,"
543 - id: 2d.text.draw.maxwidth
544 text: "If the maxWidth argument was specified and the hypothetical width of the inline box in the hypothetical line box is greater than maxWidth CSS pixels, then change font to have a more condensed font (if one is available or if a reasonably readable one can be synthesized by applying a horizontal scale factor to the font) or a smaller font, and return to the previous step<^>."
545 - id: 2d.text.align.left
546 text: "Let the anchor point's horizontal position be the left edge of the inline box<^>."
547 - id: 2d.text.align.right
548 text: "Let the anchor point's horizontal position be the right edge of the inline box<^>."
549 - id: 2d.text.align.center
550 text: "Let the anchor point's horizontal position be half way between the left and right edges of the inline box<^>."
552 - id: 2d.text.baseline.top
553 text: "Let the anchor point's vertical position be the top of the em box of the first available font of the inline box<^>."
554 - id: 2d.text.baseline.hanging
555 text: "Let the anchor point's vertical position be the hanging baseline of the first available font of the inline box<^>."
556 - id: 2d.text.baseline.middle
557 text: "Let the anchor point's vertical position be half way between the bottom and the top of the em box of the first available font of the inline box<^>."
558 - id: 2d.text.baseline.alphabetic
559 text: "Let the anchor point's vertical position be the alphabetic baseline of the first available font of the inline box<^>."
560 - id: 2d.text.baseline.ideographic
561 text: "Let the anchor point's vertical position be the ideographic baseline of the first available font of the inline box<^>."
562 - id: 2d.text.baseline.bottom
563 text: "Let the anchor point's vertical position be the bottom of the em box of the first available font of the inline box<^>."
565 - id: 2d.text.draw.fill
566 text: "For fillText() fillStyle must be applied to the glyphs and strokeStyle *must* be ignored<^>."
567 - id: 2d.text.draw.stroke
568 text: "For strokeText() the reverse holds and strokeStyle must be applied to the glyph outlines and fillStyle *must* be ignored<^>."
569 - id: 2d.text.measure.spaces
570 text: "When the method is invoked, the user agent *must* replace all the space characters in text with U+0020 SPACE characters<^>,"
571 - id: 2d.text.measure
572 text: "When the method is invoked, the user agent <...> *must* form a hypothetical infinitely wide CSS line box containing a single inline box containing the text text, with all the properties at their initial values except the 'white-space' property of the inline element set to 'pre' and the 'font' property of the inline element set to the current font of the context as given by the font attribute, and must then return a new TextMetrics object with its width attribute set to the width of that inline box, in CSS pixels<^>."
574 - id: 2d.drawImage.defaultdest
575 text: "If not specified, the dw and dh arguments *must* default to the values of sw and sh, interpreted such that one CSS pixel in the image is treated as one unit in the canvas coordinate space<^>."
576 - id: 2d.drawImage.defaultsource
577 text: "If the sx, sy, sw, and sh arguments are omitted, they *must* default to 0, 0, the image's intrinsic width in image pixels, and the image's intrinsic height in image pixels, respectively<^>."
578 - id: 2d.drawImage.IDL
579 text: "void drawImage(in HTMLVideoElement image, in double sx, in double sy, in double sw, in double sh, in double dx, in double dy, in double dw, in double dh);<^>"
580 - id: 2d.drawImage.incomplete.image
581 text: "If the image argument is an HTMLImageElement object that is not fully decodable<^><...> then the implementation *must* return without drawing anything."
582 - id: 2d.drawImage.incomplete.video
583 previously: [ 6, "dw and dh" ]
584 text: "If the image argument is <...> an HTMLVideoElement object whose readyState attribute is either HAVE_NOTHING or HAVE_METADATA<^>, then the implementation *must* return without drawing anything."
585 - id: 2d.drawImage.zerocanvas
586 previously: [ 10, "dw and dh" ]
587 text: "If the image argument is an HTMLCanvasElement object with either a horizontal dimension or a vertical dimension equal to zero, then the implementation *must* raise an INVALID_STATE_ERR exception<^>."
588 - id: 2d.drawImage.zerosource
589 text: "If one of the sw or sh arguments is zero<^>, the implementation *must* raise an INDEX_SIZE_ERR exception."
590 - id: 2d.drawImage.paint
591 text: "When drawImage() is invoked, the region of the image specified by the source rectangle *must* be painted on the region of the canvas specified by the destination rectangle<^>, after applying the current transformation matrix to the points of the destination rectangle."
592 - id: 2d.drawImage.original
593 text: "The original image data of the source image *must* be used, not the image as it is rendered (e.g. width and height attributes on the source element have no effect)<^>."
594 - id: 2d.drawImage.direction
595 text: "The image data *must* be processed in the original direction, even if the dimensions given are negative<^>."
596 - id: 2d.drawImage.self
597 text: "When a canvas is drawn onto itself, the drawing model requires the source to be copied before the image is drawn back onto the canvas, so it is possible to copy parts of a canvas onto overlapping parts of itself<^>."
598 - id: 2d.drawImage.animated.image
599 text: "When the drawImage() method is passed an animated image as its image argument, the user agent *must* use the poster frame of the animation, or, if there is no poster frame, the first frame of the animation<^>."
600 - id: 2d.drawImage.animated.video
601 previously: [ 4, "drawImage" ]
602 text: "When the image argument is an HTMLVideoElement, then the frame at the current playback position *must* be used as the source image<^>,"
603 - id: 2d.drawImage.video.size
604 previously: [ 4, "drawImage" ]
605 text: "When the image argument is an HTMLVideoElement, <...> the source image's dimensions *must* be the intrinsic width and intrinsic height of the media resource (i.e. after any aspect-ratio correction has been applied)<^>."
606 - id: 2d.drawImage.unaffect
607 text: "Images are painted without affecting the current path<^>"
608 - id: 2d.drawImage.subject
609 text: "Images are painted without affecting the current path, and are subject to shadow effects, global alpha, the clipping region, and global composition operators<^>."
612 - id: 2d.imageData.create2.object
613 text: "When the method is invoked with two arguments sw and sh, it *must* return an ImageData object<^>"
614 - id: 2d.imageData.create2.size
615 text: "When the method is invoked with two arguments sw and sh, it *must* return an ImageData object representing a rectangle with a width in CSS pixels equal to the absolute magnitude of sw and a height in CSS pixels equal to the absolute magnitude of sh<^>."
616 - id: 2d.imageData.create1.object
617 text: "When invoked with a single imagedata argument, it *must* return an ImageData object<^>"
618 - id: 2d.imageData.create1.size
619 text: "When invoked with a single imagedata argument, it *must* return an ImageData object representing a rectangle with the same dimensions as the ImageData object passed as the argument<^>."
620 - id: 2d.imageData.create.initial
621 text: "The ImageData object returned must be filled with transparent black<^>."
623 - id: 2d.imageData.get.object
624 text: "The getImageData(sx, sy, sw, sh) method *must* return an ImageData object<^>"
625 - id: 2d.imageData.get.basic
626 text: "The getImageData(sx, sy, sw, sh) method *must* return an ImageData object representing the underlying pixel data for the area of the canvas denoted by the rectangle whose corners are the four points (sx, sy), (sx+sw, sy), (sx+sw, sy+sh), (sx, sy+sh), in canvas coordinate space units<^>."
627 - id: 2d.imageData.get.outside
628 text: "Pixels outside the canvas *must* be returned as transparent black<^>."
629 - id: 2d.imageData.get.premul
630 text: "Pixels *must* be returned as non-premultiplied alpha values<^>."
632 - id: 2d.imageData.getcreate.nonfinite
633 text: "If any of the arguments to createImageData() or getImageData() are infinite or NaN<^>, the method *must* instead raise a NOT_SUPPORTED_ERR exception."
634 - id: 2d.imageData.create.null
635 text: "ImageData createImageData(in ImageData imagedata);<^>"
636 - id: 2d.imageData.getcreate.zero
637 text: "If either the sw or sh arguments are zero, the method *must* instead raise an INDEX_SIZE_ERR exception<^>."
639 - id: 2d.imageData.initial
640 text: "ImageData objects *must* be initialized so that their width attribute is set to w, the number of physical device pixels per row in the image data, their height attribute is set to h, the number of rows in the image data, and their data attribute is initialized to a CanvasPixelArray object holding the image data<^>."
641 - id: 2d.imageData.one
642 text: "At least one pixel's worth of image data *must* be returned<^>."
643 - id: 2d.pixelarray.order
644 text: "The data *must* be represented in left-to-right order, row by row top to bottom, starting with the top left, with each pixel's red, green, blue, and alpha components being given in that order for each pixel<^>."
645 - id: 2d.pixelarray.range
646 text: "Each component of each device pixel represented in this array *must* be in the range 0..255, representing the 8 bit value for that component<^>."
647 - id: 2d.pixelarray.indexes
648 text: "The components *must* be assigned consecutive indices starting with 0 for the top left pixel's red component<^>."
649 - id: 2d.pixelarray.length
650 text: "The length attribute of a CanvasPixelArray object *must* return this number<^>."
651 - id: 2d.pixelarray.retrieve
652 text: "To determine the value of an indexed property index, the user agent *must* return the value of the indexth component in the array<^>."
653 - id: 2d.pixelarray.modify
654 text: "To set the value of an existing indexed property index to value value, the value of the indexth component in the array *must* be set to value<^>."
656 - id: 2d.imageData.put.nonfinite
657 text: "If any of the arguments to the method are infinite or NaN, the method *must* raise a NOT_SUPPORTED_ERR exception<^>."
658 - id: 2d.imageData.put.wrongtype
659 text: "void putImageData(in ImageData imagedata, in double dx, in double dy);<...>void putImageData(in ImageData imagedata, in double dx, in double dy, in double dirtyX, in double dirtyY, in double dirtyWidth, in double dirtyHeight);<^>"
660 - id: 2d.imageData.put.3arg
661 text: "When the last four arguments are omitted, they *must* be assumed to have the values 0, 0, the width member of the imagedata structure, and the height member of the imagedata structure, respectively<^>."
662 - id: 2d.imageData.put.normal
663 text: "When invoked with arguments that do not, per the last few paragraphs, cause an exception to be raised, the putImageData() method *must* act as follows<^>:"
665 - id: 2d.imageData.unchanged
666 text: "the following *must* result in no visible changes to the rendering<^>:"
667 - id: 2d.imageData.createround
668 text: "...*must* return ImageData objects with the same dimensions, for any value of w and h<^>."
669 - id: 2d.imageData.unaffected
670 text: "The current path, transformation matrix, shadow attributes, global alpha, the clipping region, and global composition operator *must* not affect the getImageData() and putImageData() methods<^>."
672 - id: 2d.drawingmodel
673 text: "When a shape or image is painted, user agents *must* follow these steps, in the order given (or act as if they do)<^>:"
675 - id: 2d.colorspace.correction
676 text: "The canvas APIs *must* perform color correction at only two points: when rendering images with their own gamma correction and color space information onto the canvas, to convert the image to the color space used by the canvas (e.g. using the 2D Context's drawImage() method with an HTMLImageElement object)<^>,"
677 - id: 2d.colorspace.toDataURL.info
678 text: "The toDataURL() method *must* not include color space information in the resource returned<^>."
679 - id: 2d.colorspace.toDataURL.equal
680 text: "Where the output format allows it, the color of pixels in resources created by toDataURL() *must* match those returned by the getImageData() method<^>."
681 - id: 2d.colorspace.match
682 text: "In user agents that support CSS, the color space used by a canvas element *must* match the color space used for processing any colors for that element in CSS<^>."
683 - id: 2d.colorspace.img.equal
684 text: "The gamma correction and color space information of images *must* be handled in such a way that an image rendered directly using an img element would use the same colors as one painted on a canvas element that is then itself rendered<^>."
685 - id: 2d.colorspace.img.noinfo
686 text: "Furthermore, the rendering of images that have no color correction information (such as those returned by the toDataURL() method) *must* be rendered with no color correction<^>."
688 - id: security.start
689 text: "All canvas elements *must* start with their origin-clean set to true<^>."
690 - id: security.drawImage.image
691 keyword: must
692 text: "The element's 2D context's drawImage() method is called with an HTMLImageElement or an HTMLVideoElement whose origin is not the same as that of the Document object that owns the canvas element<^>."
693 - id: security.drawImage.canvas
694 keyword: must
695 text: "The element's 2D context's drawImage() method is called with an HTMLCanvasElement whose origin-clean flag is false<^>."
696 - id: security.fillStyle.image
697 keyword: must
698 text: "The element's 2D context's fillStyle attribute is set to a CanvasPattern object that was created from an HTMLImageElement<^> or an HTMLVideoElement whose origin was not the same as that of the Document object that owns the canvas element when the pattern was created."
699 - id: security.fillStyle.video
700 keyword: must
701 text: "The element's 2D context's fillStyle attribute is set to a CanvasPattern object that was created from an HTMLImageElement or an HTMLVideoElement<^> whose origin was not the same as that of the Document object that owns the canvas element when the pattern was created."
702 - id: security.fillStyle.canvas
703 keyword: must
704 text: "The element's 2D context's fillStyle attribute is set to a CanvasPattern object that was created from an HTMLCanvasElement whose origin-clean flag was false when the pattern was created<^>."
705 - id: security.strokeStyle.image
706 keyword: must
707 text: "The element's 2D context's strokeStyle attribute is set to a CanvasPattern object that was created from an HTMLImageElement<^> or an HTMLVideoElement whose origin was not the same as that of the Document object that owns the canvas element when the pattern was created."
708 - id: security.strokeStyle.video
709 keyword: must
710 text: "The element's 2D context's strokeStyle attribute is set to a CanvasPattern object that was created from an HTMLImageElement or an HTMLVideoElement<^> whose origin was not the same as that of the Document object that owns the canvas element when the pattern was created."
711 - id: security.strokeStyle.canvas
712 keyword: must
713 text: "The element's 2D context's strokeStyle attribute is set to a CanvasPattern object that was created from an HTMLCanvasElement whose origin-clean flag was false when the pattern was created<^>."
714 - id: security.toDataURL
715 text: "Whenever the toDataURL() method of a canvas element whose origin-clean flag is set to false is called, the method *must* raise a SECURITY_ERR exception<^>."
716 - id: security.getImageData
717 text: "Whenever the getImageData() method of the 2D context of a canvas element whose origin-clean flag is set to false is called with otherwise correct arguments, the method *must* raise a SECURITY_ERR exception<^>."
Set up and maintained by W3C Systems Team, please report bugs to sysreq@w3.org.

W3C would like to thank Microsoft who donated the server that allows us to run this service.