| 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 |
| 11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
| 12 * | 12 * |
| 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY | 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY |
| 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
| 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 enum CanvasWindingRule { "nonzero", "evenodd" }; | 26 // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-elemen
t.html#canvasrenderingcontext2d |
| 27 | 27 |
| 28 interface CanvasRenderingContext2D : CanvasRenderingContext { | 28 // FIXME: float => double throughout |
| 29 // FIXME: Use union type in drawImage and createPattern once supported: |
| 30 // http://crbug.com/372891 |
| 31 typedef (HTMLImageElement or |
| 32 HTMLVideoElement or |
| 33 HTMLCanvasElement // or |
| 34 // CanvasRenderingContext2D or |
| 35 // ImageBitmap |
| 36 ) CanvasImageSource; |
| 29 | 37 |
| 30 void save(); | 38 enum CanvasFillRule { "nonzero", "evenodd" }; |
| 31 void restore(); | |
| 32 | 39 |
| 33 [RuntimeEnabled=ExperimentalCanvasFeatures, Immutable] attribute SVGMatrix c
urrentTransform; | 40 [ |
| 34 void scale(float sx, float sy); | 41 TypeChecking=Interface|Nullable|Unrestricted, |
| 35 void rotate(float angle); | 42 WillBeGarbageCollected, |
| 36 void translate(float tx, float ty); | 43 ] interface CanvasRenderingContext2D { |
| 37 void transform(float m11, float m12, float m21, float m22, float dx, float d
y); | 44 // back-reference to the canvas |
| 38 void setTransform(float m11, float m12, float m21, float m22, float dx, floa
t dy); | 45 readonly attribute HTMLCanvasElement canvas; |
| 46 |
| 47 // state |
| 48 void save(); // push state on state stack |
| 49 void restore(); // pop state stack and restore state |
| 50 |
| 51 // transformations (default transform is the identity matrix) |
| 52 [RuntimeEnabled=ExperimentalCanvasFeatures] attribute SVGMatrix currentTrans
form; |
| 53 void scale(unrestricted float x, unrestricted float y); |
| 54 void rotate(unrestricted float angle); |
| 55 void translate(unrestricted float x, unrestricted float y); |
| 56 void transform(unrestricted float a, unrestricted float b, unrestricted floa
t c, unrestricted float d, unrestricted float e, unrestricted float f); |
| 57 void setTransform(unrestricted float a, unrestricted float b, unrestricted f
loat c, unrestricted float d, unrestricted float e, unrestricted float f); |
| 39 void resetTransform(); | 58 void resetTransform(); |
| 40 | 59 |
| 41 attribute float globalAlpha; | 60 // compositing |
| 42 [TreatNullAs=NullString] attribute DOMString globalCompositeOperation; | 61 attribute unrestricted float globalAlpha; // (default 1.0) |
| 62 [TreatNullAs=NullString] attribute DOMString globalCompositeOperation; // (d
efault source-over) |
| 43 | 63 |
| 44 [RaisesException] CanvasGradient createLinearGradient(float x0, float y0, fl
oat x1, float y1); | 64 // image smoothing |
| 65 [ImplementedAs=imageSmoothingEnabled, MeasureAs=PrefixedImageSmoothingEnable
d, DartSuppress] attribute boolean webkitImageSmoothingEnabled; |
| 66 [MeasureAs=UnprefixedImageSmoothingEnabled] attribute boolean imageSmoothing
Enabled; |
| 67 |
| 68 // colors and styles (see also the CanvasDrawingStyles interface) |
| 69 // FIXME: Use union types when supported: http://crbug.com/372891 |
| 70 [Custom] attribute object strokeStyle; // (default black) |
| 71 [Custom] attribute object fillStyle; // (default black) |
| 72 CanvasGradient createLinearGradient(float x0, float y0, float x1, float y1); |
| 45 [RaisesException] CanvasGradient createRadialGradient(float x0, float y0, fl
oat r0, float x1, float y1, float r1); | 73 [RaisesException] CanvasGradient createRadialGradient(float x0, float y0, fl
oat r0, float x1, float y1, float r1); |
| 74 [RaisesException] CanvasPattern createPattern(HTMLCanvasElement canvas, [Tre
atNullAs=NullString] DOMString repetitionType); |
| 75 [RaisesException] CanvasPattern createPattern(HTMLImageElement image, [Treat
NullAs=NullString] DOMString repetitionType); |
| 76 [RaisesException] CanvasPattern createPattern(HTMLVideoElement image, [Treat
NullAs=NullString] DOMString repetitionType); |
| 46 | 77 |
| 47 attribute float lineWidth; | 78 // shadows |
| 48 [TreatNullAs=NullString] attribute DOMString lineCap; | 79 attribute unrestricted float shadowOffsetX; |
| 49 [TreatNullAs=NullString] attribute DOMString lineJoin; | 80 attribute unrestricted float shadowOffsetY; |
| 50 attribute float miterLimit; | 81 attribute unrestricted float shadowBlur; |
| 51 | |
| 52 attribute float shadowOffsetX; | |
| 53 attribute float shadowOffsetY; | |
| 54 attribute float shadowBlur; | |
| 55 [TreatNullAs=NullString] attribute DOMString shadowColor; | 82 [TreatNullAs=NullString] attribute DOMString shadowColor; |
| 56 | 83 |
| 57 void setLineDash(sequence<float> dash); | 84 // rects |
| 58 sequence<float> getLineDash(); | 85 void clearRect(unrestricted float x, unrestricted float y, unrestricted floa
t width, unrestricted float height); |
| 59 attribute float lineDashOffset; | 86 void fillRect(unrestricted float x, unrestricted float y, unrestricted float
width, unrestricted float height); |
| 87 void strokeRect(unrestricted float x, unrestricted float y, unrestricted flo
at width, unrestricted float height); |
| 60 | 88 |
| 61 void clearRect(float x, float y, float width, float height); | 89 // path API (see also CanvasPathMethods) |
| 62 void fillRect(float x, float y, float width, float height); | 90 void beginPath(); |
| 91 void fill(optional CanvasFillRule winding); |
| 92 [RuntimeEnabled=Path2D] void fill(Path2D path, optional CanvasFillRule windi
ng); |
| 93 void stroke(); |
| 94 [RuntimeEnabled=Path2D] void stroke(Path2D path); |
| 95 // Focus rings |
| 96 void drawFocusIfNeeded(Element element); |
| 97 [RuntimeEnabled=Path2D] void drawFocusIfNeeded(Path2D path, Element element)
; |
| 63 | 98 |
| 64 void beginPath(); | 99 [RuntimeEnabled=ExperimentalCanvasFeatures] void scrollPathIntoView(optional
Path2D path); |
| 100 void clip(optional CanvasFillRule winding); |
| 101 [RuntimeEnabled=Path2D] void clip(Path2D path, optional CanvasFillRule windi
ng); |
| 102 boolean isPointInPath(unrestricted float x, unrestricted float y, optional C
anvasFillRule winding); |
| 103 [RuntimeEnabled=Path2D] boolean isPointInPath(Path2D path, unrestricted floa
t x, unrestricted float y, optional CanvasFillRule winding); |
| 104 boolean isPointInStroke(unrestricted float x, unrestricted float y); |
| 105 [RuntimeEnabled=Path2D] boolean isPointInStroke(Path2D path, unrestricted fl
oat x, unrestricted float y); |
| 65 | 106 |
| 66 attribute Path currentPath; | 107 // text (see also the CanvasDrawingStyles interface) |
| 108 void fillText(DOMString text, unrestricted float x, unrestricted float y, op
tional unrestricted float maxWidth); |
| 109 void strokeText(DOMString text, unrestricted float x, unrestricted float y,
optional unrestricted float maxWidth); |
| 110 TextMetrics measureText(DOMString text); |
| 67 | 111 |
| 68 // FIXME: These methods should be shared with CanvasRenderingContext2D in th
e CanvasPathMethods interface. | 112 // drawing images |
| 69 void closePath(); | 113 [RaisesException] void drawImage(HTMLImageElement image, unrestricted float
x, unrestricted float y); |
| 70 void moveTo(float x, float y); | 114 [RaisesException] void drawImage(HTMLImageElement image, unrestricted float
x, unrestricted float y, unrestricted float width, unrestricted float height); |
| 71 void lineTo(float x, float y); | 115 [RaisesException] void drawImage(HTMLImageElement image, unrestricted float
sx, unrestricted float sy, unrestricted float sw, unrestricted float sh, unrestr
icted float dx, unrestricted float dy, unrestricted float dw, unrestricted float
dh); |
| 72 void quadraticCurveTo(float cpx, float cpy, float x, float y); | 116 [RaisesException] void drawImage(HTMLCanvasElement canvas, unrestricted floa
t x, unrestricted float y); |
| 73 void bezierCurveTo(float cp1x, float cp1y, float cp2x, float cp2y, float x,
float y); | 117 [RaisesException] void drawImage(HTMLCanvasElement canvas, unrestricted floa
t x, unrestricted float y, unrestricted float width, unrestricted float height); |
| 74 [RaisesException] void arcTo(float x1, float y1, float x2, float y2, float r
adius); | 118 [RaisesException] void drawImage(HTMLCanvasElement canvas, unrestricted floa
t sx, unrestricted float sy, unrestricted float sw, unrestricted float sh, unres
tricted float dx, unrestricted float dy, unrestricted float dw, unrestricted flo
at dh); |
| 75 void rect(float x, float y, float width, float height); | 119 [RaisesException] void drawImage(HTMLVideoElement video, unrestricted float
x, unrestricted float y); |
| 76 [RaisesException] void arc(float x, float y, float radius, float startAngle,
float endAngle, [Default=Undefined] optional boolean anticlockwise); | 120 [RaisesException] void drawImage(HTMLVideoElement video, unrestricted float
x, unrestricted float y, unrestricted float width, unrestricted float height); |
| 77 [RaisesException] void ellipse(float x, float y, float radiusX, float radius
Y, float rotation, float startAngle, float endAngle, [Default=Undefined] optiona
l boolean anticlockwise); | 121 [RaisesException] void drawImage(HTMLVideoElement video, unrestricted float
sx, unrestricted float sy, unrestricted float sw, unrestricted float sh, unrestr
icted float dx, unrestricted float dy, unrestricted float dw, unrestricted float
dh); |
| 122 [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] void drawImage(
ImageBitmap imageBitmap, unrestricted float x, unrestricted float y); |
| 123 [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] void drawImage(
ImageBitmap imageBitmap, unrestricted float x, unrestricted float y, unrestricte
d float width, unrestricted float height); |
| 124 [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] void drawImage(
ImageBitmap imageBitmap, unrestricted float sx, unrestricted float sy, unrestric
ted float sw, unrestricted float sh, unrestricted float dx, unrestricted float d
y, unrestricted float dw, unrestricted float dh); |
| 78 | 125 |
| 79 void fill(optional CanvasWindingRule winding); | 126 // pixel manipulation |
| 80 void stroke(); | 127 [DartName=createImageDataFromImageData] ImageData createImageData(ImageData
imagedata); |
| 81 void clip(optional CanvasWindingRule winding); | 128 [RaisesException] ImageData createImageData(float sw, float sh); |
| 82 boolean isPointInPath(float x, float y, optional CanvasWindingRule winding); | 129 [RaisesException] ImageData getImageData(float sx, float sy, float sw, float
sh); |
| 83 boolean isPointInStroke(float x, float y); | 130 void putImageData(ImageData imagedata, float dx, float dy); |
| 131 void putImageData(ImageData imagedata, float dx, float dy, float dirtyX, flo
at dirtyY, float dirtyWidth, float dirtyHeight); |
| 132 |
| 133 // Context state |
| 134 // Should be merged with WebGL counterpart in CanvasRenderingContext, once n
o-longer experimental |
| 135 [RuntimeEnabled=ExperimentalCanvasFeatures] boolean isContextLost(); |
| 136 |
| 137 Canvas2DContextAttributes getContextAttributes(); |
| 138 |
| 139 // FIXME: factor out to CanvasDrawingStyles |
| 140 // line caps/joins |
| 141 attribute unrestricted float lineWidth; // (default 1) |
| 142 [TreatNullAs=NullString] attribute DOMString lineCap; // "butt", "round", "s
quare" (default "butt") |
| 143 [TreatNullAs=NullString] attribute DOMString lineJoin; // "round", "bevel",
"miter" (default "miter") |
| 144 attribute unrestricted float miterLimit; // (default 10) |
| 145 |
| 146 // dashed lines |
| 147 void setLineDash(sequence<unrestricted float> dash); |
| 148 sequence<unrestricted float> getLineDash(); |
| 149 attribute unrestricted float lineDashOffset; |
| 84 | 150 |
| 85 // text | 151 // text |
| 86 attribute DOMString font; | 152 attribute DOMString font; // (default 10px sans-serif) |
| 87 attribute DOMString textAlign; | 153 attribute DOMString textAlign; // "start", "end", "left", "right", "center"
(default: "start") |
| 88 attribute DOMString textBaseline; | 154 attribute DOMString textBaseline; // "top", "hanging", "middle", "alphabetic
", "ideographic", "bottom" (default: "alphabetic") |
| 89 | 155 |
| 90 TextMetrics measureText(DOMString text); | 156 // Non-standard APIs. Candidates for deprecation |
| 91 | 157 // https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D |
| 92 // other | 158 [MeasureAs=CanvasRenderingContext2DSetAlpha] void setAlpha(unrestricted floa
t alpha); |
| 93 | 159 [MeasureAs=CanvasRenderingContext2DSetCompositeOperation] void setCompositeO
peration(DOMString compositeOperation); |
| 94 void setAlpha(float alpha); | 160 [MeasureAs=CanvasRenderingContext2DSetLineWidth] void setLineWidth(unrestric
ted float width); |
| 95 void setCompositeOperation(DOMString compositeOperation); | 161 [MeasureAs=CanvasRenderingContext2DSetLineCap] void setLineCap(DOMString cap
); |
| 96 | 162 [MeasureAs=CanvasRenderingContext2DSetLineJoin] void setLineJoin(DOMString j
oin); |
| 97 void setLineWidth(float width); | 163 [MeasureAs=CanvasRenderingContext2DSetMiterLimit] void setMiterLimit(unrestr
icted float limit); |
| 98 void setLineCap(DOMString cap); | 164 [MeasureAs=CanvasRenderingContext2DClearShadow] void clearShadow(); |
| 99 void setLineJoin(DOMString join); | 165 [MeasureAs=CanvasRenderingContext2DSetStrokeColor] void setStrokeColor(DOMSt
ring color, optional unrestricted float alpha); |
| 100 void setMiterLimit(float limit); | 166 [MeasureAs=CanvasRenderingContext2DSetStrokeColor] void setStrokeColor(unres
tricted float grayLevel, optional unrestricted float alpha); |
| 101 | 167 [MeasureAs=CanvasRenderingContext2DSetStrokeColor] void setStrokeColor(unres
tricted float r, unrestricted float g, unrestricted float b, unrestricted float
a); |
| 102 void clearShadow(); | 168 [MeasureAs=CanvasRenderingContext2DSetStrokeColor] void setStrokeColor(unres
tricted float c, unrestricted float m, unrestricted float y, unrestricted float
k, unrestricted float a); |
| 103 | 169 [MeasureAs=CanvasRenderingContext2DSetFillColor] void setFillColor(DOMString
color, optional unrestricted float alpha); |
| 104 void fillText(DOMString text, float x, float y, optional float maxWidth); | 170 [MeasureAs=CanvasRenderingContext2DSetFillColor] void setFillColor(unrestric
ted float grayLevel, optional unrestricted float alpha); |
| 105 void strokeText(DOMString text, float x, float y, optional float maxWidth); | 171 [MeasureAs=CanvasRenderingContext2DSetFillColor] void setFillColor(unrestric
ted float r, unrestricted float g, unrestricted float b, unrestricted float a); |
| 106 | 172 [MeasureAs=CanvasRenderingContext2DSetFillColor] void setFillColor(unrestric
ted float c, unrestricted float m, unrestricted float y, unrestricted float k, u
nrestricted float a); |
| 107 void setStrokeColor([StrictTypeChecking] DOMString color, optional float alp
ha); | 173 [MeasureAs=CanvasRenderingContext2DDrawImageFromRect] void drawImageFromRect
( |
| 108 void setStrokeColor(float grayLevel, optional float alpha); | 174 HTMLImageElement? image, optional unrestricted float sx, optional unrest
ricted float sy, optional unrestricted float sw, optional unrestricted float sh, |
| 109 void setStrokeColor(float r, float g, float b, float a); | 175 optional unrestricted float dx, optional unrestricted float dy, optional
unrestricted float dw, optional unrestricted float dh, optional DOMString compo
siteOperation); |
| 110 void setStrokeColor(float c, float m, float y, float k, float a); | 176 [MeasureAs=CanvasRenderingContext2DSetShadow] void setShadow(unrestricted fl
oat width, unrestricted float height, unrestricted float blur, optional DOMStrin
g color, optional unrestricted float alpha); |
| 111 | 177 [MeasureAs=CanvasRenderingContext2DSetShadow] void setShadow(unrestricted fl
oat width, unrestricted float height, unrestricted float blur, unrestricted floa
t grayLevel, optional unrestricted float alpha); |
| 112 void setFillColor([StrictTypeChecking] DOMString color, optional float alpha
); | 178 [MeasureAs=CanvasRenderingContext2DSetShadow] void setShadow(unrestricted fl
oat width, unrestricted float height, unrestricted float blur, unrestricted floa
t r, unrestricted float g, unrestricted float b, unrestricted float a); |
| 113 void setFillColor(float grayLevel, optional float alpha); | 179 [MeasureAs=CanvasRenderingContext2DSetShadow] void setShadow(unrestricted fl
oat width, unrestricted float height, unrestricted float blur, unrestricted floa
t c, unrestricted float m, unrestricted float y, unrestricted float k, unrestric
ted float a); |
| 114 void setFillColor(float r, float g, float b, float a); | |
| 115 void setFillColor(float c, float m, float y, float k, float a); | |
| 116 | |
| 117 void strokeRect(float x, float y, float width, float height); | |
| 118 | |
| 119 [RaisesException] void drawImage(HTMLImageElement? image, float x, float y); | |
| 120 [RaisesException] void drawImage(HTMLImageElement? image, float x, float y,
float width, float height); | |
| 121 [RaisesException] void drawImage(HTMLImageElement? image, float sx, float sy
, float sw, float sh, float dx, float dy, float dw, float dh); | |
| 122 [RaisesException] void drawImage(HTMLCanvasElement? canvas, float x, float y
); | |
| 123 [RaisesException] void drawImage(HTMLCanvasElement? canvas, float x, float y
, float width, float height); | |
| 124 [RaisesException] void drawImage(HTMLCanvasElement? canvas, float sx, float
sy, float sw, float sh, float dx, float dy, float dw, float dh); | |
| 125 [RaisesException] void drawImage(HTMLVideoElement? video, float x, float y); | |
| 126 [RaisesException] void drawImage(HTMLVideoElement? video, float x, float y,
float width, float height); | |
| 127 [RaisesException] void drawImage(HTMLVideoElement? video, float sx, float sy
, float sw, float sh, float dx, float dy, float dw, float dh); | |
| 128 [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] void drawImage(
ImageBitmap? imageBitmap, float x, float y); | |
| 129 [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] void drawImage(
ImageBitmap? imageBitmap, float x, float y, float width, float height); | |
| 130 [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException] void drawImage(
ImageBitmap? imageBitmap, float sx, float sy, float sw, float sh, float dx, floa
t dy, float dw, float dh); | |
| 131 | |
| 132 void drawImageFromRect(HTMLImageElement image, | |
| 133 optional float sx, optional float sy, optional float
sw, optional float sh, | |
| 134 optional float dx, optional float dy, optional float
dw, optional float dh, | |
| 135 optional DOMString compositeOperation); | |
| 136 | |
| 137 void setShadow(float width, float height, float blur, [StrictTypeChecking] o
ptional DOMString color, optional float alpha); | |
| 138 void setShadow(float width, float height, float blur, float grayLevel, optio
nal float alpha); | |
| 139 void setShadow(float width, float height, float blur, float r, float g, floa
t b, float a); | |
| 140 void setShadow(float width, float height, float blur, float c, float m, floa
t y, float k, float a); | |
| 141 | |
| 142 [RaisesException] void putImageData(ImageData? imagedata, float dx, float dy
); | |
| 143 [RaisesException] void putImageData(ImageData? imagedata, float dx, float dy
, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight); | |
| 144 | |
| 145 [RaisesException, DeprecateAs=PrefixedPutImageDataHD] void webkitPutImageDat
aHD(ImageData? imagedata, float dx, float dy); | |
| 146 [RaisesException, DeprecateAs=PrefixedPutImageDataHD] void webkitPutImageDat
aHD(ImageData? imagedata, float dx, float dy, float dirtyX, float dirtyY, float
dirtyWidth, float dirtyHeight); | |
| 147 | |
| 148 [RaisesException] CanvasPattern createPattern(HTMLCanvasElement? canvas, [Tr
eatNullAs=NullString] DOMString repetitionType); | |
| 149 [RaisesException] CanvasPattern createPattern(HTMLImageElement? image, [Trea
tNullAs=NullString] DOMString repetitionType); | |
| 150 [RaisesException] ImageData createImageData(ImageData? imagedata); | |
| 151 [RaisesException] ImageData createImageData(float sw, float sh); | |
| 152 | |
| 153 [Custom] attribute object strokeStyle; | |
| 154 [Custom] attribute object fillStyle; | |
| 155 | |
| 156 // pixel manipulation | |
| 157 [RaisesException] ImageData getImageData(float sx, float sy, float sw, float
sh); | |
| 158 | |
| 159 [RaisesException, DeprecateAs=PrefixedGetImageDataHD] ImageData webkitGetIma
geDataHD(float sx, float sy, float sw, float sh); | |
| 160 | |
| 161 // Focus rings | |
| 162 [RuntimeEnabled=ExperimentalCanvasFeatures] void drawSystemFocusRing(Element
element); | |
| 163 [RuntimeEnabled=ExperimentalCanvasFeatures] boolean drawCustomFocusRing(Elem
ent element); | |
| 164 | |
| 165 readonly attribute float webkitBackingStorePixelRatio; | |
| 166 | |
| 167 [ImplementedAs=imageSmoothingEnabled, MeasureAs=PrefixedImageSmoothingEnable
d] attribute boolean webkitImageSmoothingEnabled; | |
| 168 [MeasureAs=UnprefixedImageSmoothingEnabled] attribute boolean imageSmoothing
Enabled; | |
| 169 | |
| 170 Canvas2DContextAttributes getContextAttributes(); | |
| 171 }; | 180 }; |
| 172 | 181 |
| 182 CanvasRenderingContext2D implements CanvasPathMethods; |
| OLD | NEW |