| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 boolean isPointInStroke(float x, float y); | 88 boolean isPointInStroke(float x, float y); |
| 89 [RuntimeEnabled=Path2D, StrictTypeChecking] boolean isPointInStroke(Path2D p
ath, float x, float y); | 89 [RuntimeEnabled=Path2D, StrictTypeChecking] boolean isPointInStroke(Path2D p
ath, float x, float y); |
| 90 | 90 |
| 91 [RuntimeEnabled=ExperimentalCanvasFeatures] void scrollPathIntoView(); | 91 [RuntimeEnabled=ExperimentalCanvasFeatures] void scrollPathIntoView(); |
| 92 [RuntimeEnabled=ExperimentalCanvasFeatures, StrictTypeChecking] void scrollP
athIntoView(Path2D path); | 92 [RuntimeEnabled=ExperimentalCanvasFeatures, StrictTypeChecking] void scrollP
athIntoView(Path2D path); |
| 93 | 93 |
| 94 // text | 94 // text |
| 95 attribute DOMString font; | 95 attribute DOMString font; |
| 96 attribute DOMString textAlign; | 96 attribute DOMString textAlign; |
| 97 attribute DOMString textBaseline; | 97 attribute DOMString textBaseline; |
| 98 void fillText(DOMString text, float x, float y, optional float maxWidth); |
| 99 void strokeText(DOMString text, float x, float y, optional float maxWidth); |
| 98 | 100 |
| 99 TextMetrics measureText(DOMString text); | 101 TextMetrics measureText(DOMString text); |
| 100 | 102 |
| 101 // Context state | 103 // Context state |
| 102 // Should be merged with WebGL counterpart in CanvasRenderingContext, once n
o-longer experimental | 104 // Should be merged with WebGL counterpart in CanvasRenderingContext, once n
o-longer experimental |
| 103 [RuntimeEnabled=ExperimentalCanvasFeatures] boolean isContextLost(); | 105 [RuntimeEnabled=ExperimentalCanvasFeatures] boolean isContextLost(); |
| 104 | 106 |
| 105 // other | |
| 106 | |
| 107 void setAlpha(float alpha); | |
| 108 void setCompositeOperation(DOMString compositeOperation); | |
| 109 | |
| 110 void setLineWidth(float width); | |
| 111 void setLineCap(DOMString cap); | |
| 112 void setLineJoin(DOMString join); | |
| 113 void setMiterLimit(float limit); | |
| 114 | |
| 115 void clearShadow(); | |
| 116 | |
| 117 void fillText(DOMString text, float x, float y, optional float maxWidth); | |
| 118 void strokeText(DOMString text, float x, float y, optional float maxWidth); | |
| 119 | |
| 120 void setStrokeColor([StrictTypeChecking] DOMString color, optional float alp
ha); | |
| 121 void setStrokeColor(float grayLevel, optional float alpha); | |
| 122 void setStrokeColor(float r, float g, float b, float a); | |
| 123 void setStrokeColor(float c, float m, float y, float k, float a); | |
| 124 | |
| 125 void setFillColor([StrictTypeChecking] DOMString color, optional float alpha
); | |
| 126 void setFillColor(float grayLevel, optional float alpha); | |
| 127 void setFillColor(float r, float g, float b, float a); | |
| 128 void setFillColor(float c, float m, float y, float k, float a); | |
| 129 | |
| 130 void strokeRect(float x, float y, float width, float height); | 107 void strokeRect(float x, float y, float width, float height); |
| 131 | 108 |
| 132 [RaisesException, StrictTypeChecking] void drawImage(HTMLImageElement image,
float x, float y); | 109 [RaisesException, StrictTypeChecking] void drawImage(HTMLImageElement image,
float x, float y); |
| 133 [RaisesException, StrictTypeChecking] void drawImage(HTMLImageElement image,
float x, float y, float width, float height); | 110 [RaisesException, StrictTypeChecking] void drawImage(HTMLImageElement image,
float x, float y, float width, float height); |
| 134 [RaisesException, StrictTypeChecking] void drawImage(HTMLImageElement image,
float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh)
; | 111 [RaisesException, StrictTypeChecking] void drawImage(HTMLImageElement image,
float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh)
; |
| 135 [RaisesException, StrictTypeChecking] void drawImage(HTMLCanvasElement canva
s, float x, float y); | 112 [RaisesException, StrictTypeChecking] void drawImage(HTMLCanvasElement canva
s, float x, float y); |
| 136 [RaisesException, StrictTypeChecking] void drawImage(HTMLCanvasElement canva
s, float x, float y, float width, float height); | 113 [RaisesException, StrictTypeChecking] void drawImage(HTMLCanvasElement canva
s, float x, float y, float width, float height); |
| 137 [RaisesException, StrictTypeChecking] void drawImage(HTMLCanvasElement canva
s, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float d
h); | 114 [RaisesException, StrictTypeChecking] void drawImage(HTMLCanvasElement canva
s, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float d
h); |
| 138 [RaisesException, StrictTypeChecking] void drawImage(HTMLVideoElement video,
float x, float y); | 115 [RaisesException, StrictTypeChecking] void drawImage(HTMLVideoElement video,
float x, float y); |
| 139 [RaisesException, StrictTypeChecking] void drawImage(HTMLVideoElement video,
float x, float y, float width, float height); | 116 [RaisesException, StrictTypeChecking] void drawImage(HTMLVideoElement video,
float x, float y, float width, float height); |
| 140 [RaisesException, StrictTypeChecking] void drawImage(HTMLVideoElement video,
float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh)
; | 117 [RaisesException, StrictTypeChecking] void drawImage(HTMLVideoElement video,
float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh)
; |
| 141 [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException, StrictTypeCheck
ing] void drawImage(ImageBitmap imageBitmap, float x, float y); | 118 [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException, StrictTypeCheck
ing] void drawImage(ImageBitmap imageBitmap, float x, float y); |
| 142 [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException, StrictTypeCheck
ing] void drawImage(ImageBitmap imageBitmap, float x, float y, float width, floa
t height); | 119 [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException, StrictTypeCheck
ing] void drawImage(ImageBitmap imageBitmap, float x, float y, float width, floa
t height); |
| 143 [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException, StrictTypeCheck
ing] void drawImage(ImageBitmap imageBitmap, float sx, float sy, float sw, float
sh, float dx, float dy, float dw, float dh); | 120 [RuntimeEnabled=ExperimentalCanvasFeatures, RaisesException, StrictTypeCheck
ing] void drawImage(ImageBitmap imageBitmap, float sx, float sy, float sw, float
sh, float dx, float dy, float dw, float dh); |
| 144 | 121 |
| 145 [StrictTypeChecking] void drawImageFromRect(HTMLImageElement? image, | |
| 146 optional float sx, optional floa
t sy, optional float sw, optional float sh, | |
| 147 optional float dx, optional floa
t dy, optional float dw, optional float dh, | |
| 148 optional DOMString compositeOper
ation); | |
| 149 | |
| 150 void setShadow(float width, float height, float blur, [StrictTypeChecking] o
ptional DOMString color, optional float alpha); | |
| 151 void setShadow(float width, float height, float blur, float grayLevel, optio
nal float alpha); | |
| 152 void setShadow(float width, float height, float blur, float r, float g, floa
t b, float a); | |
| 153 void setShadow(float width, float height, float blur, float c, float m, floa
t y, float k, float a); | |
| 154 | |
| 155 [RaisesException, StrictTypeChecking] void putImageData(ImageData imagedata,
float dx, float dy); | 122 [RaisesException, StrictTypeChecking] void putImageData(ImageData imagedata,
float dx, float dy); |
| 156 [RaisesException, StrictTypeChecking] void putImageData(ImageData imagedata,
float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHe
ight); | 123 [RaisesException, StrictTypeChecking] void putImageData(ImageData imagedata,
float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHe
ight); |
| 157 | 124 |
| 158 [RaisesException, StrictTypeChecking] CanvasPattern createPattern(HTMLCanvas
Element canvas, [TreatNullAs=NullString] DOMString repetitionType); | 125 [RaisesException, StrictTypeChecking] CanvasPattern createPattern(HTMLCanvas
Element canvas, [TreatNullAs=NullString] DOMString repetitionType); |
| 159 [RaisesException, StrictTypeChecking] CanvasPattern createPattern(HTMLImageE
lement image, [TreatNullAs=NullString] DOMString repetitionType); | 126 [RaisesException, StrictTypeChecking] CanvasPattern createPattern(HTMLImageE
lement image, [TreatNullAs=NullString] DOMString repetitionType); |
| 160 [RaisesException, StrictTypeChecking] CanvasPattern createPattern(HTMLVideoE
lement image, [TreatNullAs=NullString] DOMString repetitionType); | 127 [RaisesException, StrictTypeChecking] CanvasPattern createPattern(HTMLVideoE
lement image, [TreatNullAs=NullString] DOMString repetitionType); |
| 161 [StrictTypeChecking] ImageData createImageData(ImageData imagedata); | 128 [StrictTypeChecking] ImageData createImageData(ImageData imagedata); |
| 162 [RaisesException] ImageData createImageData(float sw, float sh); | 129 [RaisesException] ImageData createImageData(float sw, float sh); |
| 163 | 130 |
| 164 [Custom] attribute object strokeStyle; | 131 [Custom] attribute object strokeStyle; |
| 165 [Custom] attribute object fillStyle; | 132 [Custom] attribute object fillStyle; |
| 166 | 133 |
| 167 // pixel manipulation | 134 // pixel manipulation |
| 168 [RaisesException] ImageData getImageData(float sx, float sy, float sw, float
sh); | 135 [RaisesException] ImageData getImageData(float sx, float sy, float sw, float
sh); |
| 169 | 136 |
| 170 // Focus rings | 137 // Focus rings |
| 171 [RuntimeEnabled=ExperimentalCanvasFeatures, StrictTypeChecking] void drawFoc
usIfNeeded(Element element); | 138 [RuntimeEnabled=ExperimentalCanvasFeatures, StrictTypeChecking] void drawFoc
usIfNeeded(Element element); |
| 172 [RuntimeEnabled=ExperimentalCanvasFeatures, StrictTypeChecking] void drawFoc
usIfNeeded(Path2D path, Element element); | 139 [RuntimeEnabled=ExperimentalCanvasFeatures, StrictTypeChecking] void drawFoc
usIfNeeded(Path2D path, Element element); |
| 173 [RuntimeEnabled=ExperimentalCanvasFeatures, StrictTypeChecking] boolean draw
CustomFocusRing(Element element); | 140 [RuntimeEnabled=ExperimentalCanvasFeatures, StrictTypeChecking] boolean draw
CustomFocusRing(Element element); |
| 174 | 141 |
| 175 [ImplementedAs=imageSmoothingEnabled, MeasureAs=PrefixedImageSmoothingEnable
d] attribute boolean webkitImageSmoothingEnabled; | 142 [ImplementedAs=imageSmoothingEnabled, MeasureAs=PrefixedImageSmoothingEnable
d] attribute boolean webkitImageSmoothingEnabled; |
| 176 [MeasureAs=UnprefixedImageSmoothingEnabled] attribute boolean imageSmoothing
Enabled; | 143 [MeasureAs=UnprefixedImageSmoothingEnabled] attribute boolean imageSmoothing
Enabled; |
| 177 | 144 |
| 178 Canvas2DContextAttributes getContextAttributes(); | 145 Canvas2DContextAttributes getContextAttributes(); |
| 146 |
| 147 // Non-standard APIs. Candidates for deprecation |
| 148 [MeasureAs=CanvasRenderingContext2DSetAlpha] void setAlpha(float alpha); |
| 149 [MeasureAs=CanvasRenderingContext2DSetCompositeOperation] void setCompositeO
peration(DOMString compositeOperation); |
| 150 [MeasureAs=CanvasRenderingContext2DSetLineWidth] void setLineWidth(float wid
th); |
| 151 [MeasureAs=CanvasRenderingContext2DSetLineCap] void setLineCap(DOMString cap
); |
| 152 [MeasureAs=CanvasRenderingContext2DSetLineJoin] void setLineJoin(DOMString j
oin); |
| 153 [MeasureAs=CanvasRenderingContext2DSetMiterLimit] void setMiterLimit(float l
imit); |
| 154 [MeasureAs=CanvasRenderingContext2DClearShadow] void clearShadow(); |
| 155 [MeasureAs=CanvasRenderingContext2DSetStrokeColor] void setStrokeColor([Stri
ctTypeChecking] DOMString color, optional float alpha); |
| 156 [MeasureAs=CanvasRenderingContext2DSetStrokeColor] void setStrokeColor(float
grayLevel, optional float alpha); |
| 157 [MeasureAs=CanvasRenderingContext2DSetStrokeColor] void setStrokeColor(float
r, float g, float b, float a); |
| 158 [MeasureAs=CanvasRenderingContext2DSetStrokeColor] void setStrokeColor(float
c, float m, float y, float k, float a); |
| 159 [MeasureAs=CanvasRenderingContext2DSetFillColor] void setFillColor([StrictTy
peChecking] DOMString color, optional float alpha); |
| 160 [MeasureAs=CanvasRenderingContext2DSetFillColor] void setFillColor(float gra
yLevel, optional float alpha); |
| 161 [MeasureAs=CanvasRenderingContext2DSetFillColor] void setFillColor(float r,
float g, float b, float a); |
| 162 [MeasureAs=CanvasRenderingContext2DSetFillColor] void setFillColor(float c,
float m, float y, float k, float a); |
| 163 [StrictTypeChecking, MeasureAs=CanvasRenderingContext2DDrawImageFromRect] vo
id drawImageFromRect( |
| 164 HTMLImageElement? image, optional float sx, optional float sy, optional
float sw, optional float sh, |
| 165 optional float dx, optional float dy, optional float dw, optional float
dh, optional DOMString compositeOperation); |
| 166 [MeasureAs=CanvasRenderingContext2DSetShadow] void setShadow(float width, fl
oat height, float blur, [StrictTypeChecking] optional DOMString color, optional
float alpha); |
| 167 [MeasureAs=CanvasRenderingContext2DSetShadow] void setShadow(float width, fl
oat height, float blur, float grayLevel, optional float alpha); |
| 168 [MeasureAs=CanvasRenderingContext2DSetShadow] void setShadow(float width, fl
oat height, float blur, float r, float g, float b, float a); |
| 169 [MeasureAs=CanvasRenderingContext2DSetShadow] void setShadow(float width, fl
oat height, float blur, float c, float m, float y, float k, float a); |
| 179 }; | 170 }; |
| 180 | 171 |
| 181 CanvasRenderingContext2D implements CanvasPathMethods; | 172 CanvasRenderingContext2D implements CanvasPathMethods; |
| OLD | NEW |