OLD | NEW |
| (Empty) |
1 This test checks the SVGPaint API | |
2 | |
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | |
4 | |
5 | |
6 | |
7 Check initial paint values | |
8 PASS (fillPaint = rectElement.style.getPropertyCSSValue('fill')).toString() is "
[object SVGPaint]" | |
9 PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_RGBCOLOR | |
10 PASS fillPaint.uri is "" | |
11 PASS fillPaint.colorType is SVGColor.SVG_COLORTYPE_RGBCOLOR | |
12 PASS (fillColor = fillPaint.rgbColor).toString() is "[object RGBColor]" | |
13 PASS fillColor.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
14 PASS fillColor.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 128 | |
15 PASS fillColor.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
16 PASS rectElement.style.fill is "#008000" | |
17 PASS document.defaultView.getComputedStyle(rectElement).fill is "#008000" | |
18 | |
19 Try invalid arguments for setPaint() | |
20 PASS fillPaint.setPaint(null, null, null, null) threw exception NoModificationAl
lowedError: An attempt was made to modify an object where modifications are not
allowed.. | |
21 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_RGBCOLOR, svgElement, '', ''); th
rew exception NoModificationAllowedError: An attempt was made to modify an objec
t where modifications are not allowed.. | |
22 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_RGBCOLOR, '', '') threw exception
TypeError: Failed to execute 'setPaint' on 'SVGPaint': 4 arguments required, bu
t only 3 present.. | |
23 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR + 1, '', '', ''
); threw exception NoModificationAllowedError: An attempt was made to modify an
object where modifications are not allowed.. | |
24 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_NONE - 1, '', '', ''); threw exce
ption NoModificationAllowedError: An attempt was made to modify an object where
modifications are not allowed.. | |
25 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_URI + 1, '', '', ''); threw excep
tion NoModificationAllowedError: An attempt was made to modify an object where m
odifications are not allowed.. | |
26 PASS fillPaint.setPaint() threw exception TypeError: Failed to execute 'setPaint
' on 'SVGPaint': 4 arguments required, but only 0 present.. | |
27 PASS fillPaint.setPaint(fillPaint) threw exception TypeError: Failed to execute
'setPaint' on 'SVGPaint': 4 arguments required, but only 1 present.. | |
28 | |
29 Try invalid arguments for setUri() | |
30 PASS fillPaint.setUri() threw exception TypeError: Failed to execute 'setUri' on
'SVGPaint': 1 argument required, but only 0 present.. | |
31 | |
32 Try assigning to the readonly paintType property, which silently fails | |
33 PASS fillPaint.paintType = SVGPaint.SVG_PAINTTYPE_UNKKNOWN; is undefined. | |
34 PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_RGBCOLOR | |
35 PASS rectElement.style.fill is "#008000" | |
36 PASS document.defaultView.getComputedStyle(rectElement).fill is "#008000" | |
37 | |
38 Test using setPaint() and SVG_PAINTTYPE_UNKNOWN | |
39 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_UNKKNOWN, '', '', '') threw excep
tion NoModificationAllowedError: An attempt was made to modify an object where m
odifications are not allowed.. | |
40 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_UNKKNOWN, 'url(#foo)', '', '') th
rew exception NoModificationAllowedError: An attempt was made to modify an objec
t where modifications are not allowed.. | |
41 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_UNKKNOWN, '', 'rgb(0,128,128)', '
') threw exception NoModificationAllowedError: An attempt was made to modify an
object where modifications are not allowed.. | |
42 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_UNKKNOWN, '', '', 'icc-color(myRG
B, 0, 1, 2)') threw exception NoModificationAllowedError: An attempt was made to
modify an object where modifications are not allowed.. | |
43 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_UNKKNOWN, 'url(#foo)', 'rgb(0,0,0
)', 'icc-color(myRGB, 0, 1, 2)') threw exception NoModificationAllowedError: An
attempt was made to modify an object where modifications are not allowed.. | |
44 | |
45 Test using setPaint() and SVG_PAINTTYPE_NONE - a | |
46 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_NONE, '', '', '') threw exception
NoModificationAllowedError: An attempt was made to modify an object where modif
ications are not allowed.. | |
47 PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_RGBCOLOR | |
48 PASS rectElement.style.fill is "#008000" | |
49 PASS document.defaultView.getComputedStyle(rectElement).fill is "#008000" | |
50 | |
51 Reset style to initial value | |
52 PASS (fillPaint = rectElement.style.getPropertyCSSValue('fill')).toString() is "
[object SVGPaint]" | |
53 PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_RGBCOLOR | |
54 PASS rectElement.style.fill is "#008000" | |
55 PASS document.defaultView.getComputedStyle(rectElement).fill is "#008000" | |
56 | |
57 Test using setPaint() and SVG_PAINTTYPE_NONE - b | |
58 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_NONE, 'url(#foo)', '', '') threw
exception NoModificationAllowedError: An attempt was made to modify an object wh
ere modifications are not allowed.. | |
59 PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_RGBCOLOR | |
60 PASS rectElement.style.fill is "#008000" | |
61 PASS document.defaultView.getComputedStyle(rectElement).fill is "#008000" | |
62 | |
63 Reset style to initial value | |
64 PASS (fillPaint = rectElement.style.getPropertyCSSValue('fill')).toString() is "
[object SVGPaint]" | |
65 PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_RGBCOLOR | |
66 PASS rectElement.style.fill is "#008000" | |
67 PASS document.defaultView.getComputedStyle(rectElement).fill is "#008000" | |
68 | |
69 Test using setPaint() and SVG_PAINTTYPE_NONE - c | |
70 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_NONE, '', 'rgb(0,128,128)', '') t
hrew exception NoModificationAllowedError: An attempt was made to modify an obje
ct where modifications are not allowed.. | |
71 PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_RGBCOLOR | |
72 PASS rectElement.style.fill is "#008000" | |
73 PASS document.defaultView.getComputedStyle(rectElement).fill is "#008000" | |
74 | |
75 Reset style to initial value | |
76 PASS (fillPaint = rectElement.style.getPropertyCSSValue('fill')).toString() is "
[object SVGPaint]" | |
77 PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_RGBCOLOR | |
78 PASS rectElement.style.fill is "#008000" | |
79 PASS document.defaultView.getComputedStyle(rectElement).fill is "#008000" | |
80 | |
81 Test using setPaint() and SVG_PAINTTYPE_NONE - d | |
82 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_NONE, '', '', 'icc-color(myRGB, 0
, 1, 2)') threw exception NoModificationAllowedError: An attempt was made to mod
ify an object where modifications are not allowed.. | |
83 PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_RGBCOLOR | |
84 PASS rectElement.style.fill is "#008000" | |
85 PASS document.defaultView.getComputedStyle(rectElement).fill is "#008000" | |
86 | |
87 Reset style to initial value | |
88 PASS (fillPaint = rectElement.style.getPropertyCSSValue('fill')).toString() is "
[object SVGPaint]" | |
89 PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_RGBCOLOR | |
90 PASS rectElement.style.fill is "#008000" | |
91 PASS document.defaultView.getComputedStyle(rectElement).fill is "#008000" | |
92 | |
93 Test using setPaint() and SVG_PAINTTYPE_NONE - e | |
94 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_NONE, 'url(#foo)', 'rgb(0,0,0)',
'icc-color(myRGB, 0, 1, 2)') threw exception NoModificationAllowedError: An atte
mpt was made to modify an object where modifications are not allowed.. | |
95 PASS rectElement.style.fill is "#008000" | |
96 PASS document.defaultView.getComputedStyle(rectElement).fill is "#008000" | |
97 | |
98 Test using setPaint() and SVG_PAINTTYPE_URI - a | |
99 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_URI, '', '', '') threw exception
NoModificationAllowedError: An attempt was made to modify an object where modifi
cations are not allowed.. | |
100 PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_RGBCOLOR | |
101 PASS rectElement.style.fill is "#008000" | |
102 PASS document.defaultView.getComputedStyle(rectElement).fill is "#008000" | |
103 | |
104 Test using setPaint() and SVG_PAINTTYPE_URI - b | |
105 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_URI, '', 'rgb(0,128,128)', '') th
rew exception NoModificationAllowedError: An attempt was made to modify an objec
t where modifications are not allowed.. | |
106 PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_RGBCOLOR | |
107 PASS rectElement.style.fill is "#008000" | |
108 PASS document.defaultView.getComputedStyle(rectElement).fill is "#008000" | |
109 | |
110 Test using setPaint() and SVG_PAINTTYPE_URI - c | |
111 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_URI, '', '', 'icc-color(myRGB, 0,
1, 2)') threw exception NoModificationAllowedError: An attempt was made to modi
fy an object where modifications are not allowed.. | |
112 PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_RGBCOLOR | |
113 PASS rectElement.style.fill is "#008000" | |
114 PASS document.defaultView.getComputedStyle(rectElement).fill is "#008000" | |
115 | |
116 Test using setPaint() and SVG_PAINTTYPE_URI - d | |
117 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_URI, 'url(#test)', '', '') threw
exception NoModificationAllowedError: An attempt was made to modify an object wh
ere modifications are not allowed.. | |
118 PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_RGBCOLOR | |
119 PASS fillPaint.uri is "" | |
120 PASS fillPaint.colorType is SVGColor.SVG_COLORTYPE_RGBCOLOR | |
121 PASS (fillColor = fillPaint.rgbColor).toString() is "[object RGBColor]" | |
122 PASS fillColor.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
123 PASS fillColor.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 128 | |
124 PASS fillColor.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
125 PASS rectElement.style.fill is "#008000" | |
126 PASS document.defaultView.getComputedStyle(rectElement).fill is "#008000" | |
127 | |
128 Reset style to initial value | |
129 PASS (fillPaint = rectElement.style.getPropertyCSSValue('fill')).toString() is "
[object SVGPaint]" | |
130 PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_RGBCOLOR | |
131 PASS rectElement.style.fill is "#008000" | |
132 PASS document.defaultView.getComputedStyle(rectElement).fill is "#008000" | |
133 | |
134 Test using setPaint() and SVG_PAINTTYPE_URI - e | |
135 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_URI, 'url(#foo)', 'rgb(0,0,0)', '
icc-color(myRGB, 0, 1, 2)') threw exception NoModificationAllowedError: An attem
pt was made to modify an object where modifications are not allowed.. | |
136 PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_RGBCOLOR | |
137 PASS fillPaint.uri is "" | |
138 PASS fillPaint.colorType is SVGColor.SVG_COLORTYPE_RGBCOLOR | |
139 PASS (fillColor = fillPaint.rgbColor).toString() is "[object RGBColor]" | |
140 PASS fillColor.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
141 PASS fillColor.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 128 | |
142 PASS fillColor.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
143 PASS rectElement.style.fill is "#008000" | |
144 PASS document.defaultView.getComputedStyle(rectElement).fill is "#008000" | |
145 | |
146 Test using setPaint() and SVG_PAINTTYPE_URI_NONE | |
147 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_URI_NONE, 'url(#test)', 'rgb(0,0,
0)', 'icc-color(myRGB, 0, 1, 2)') threw exception NoModificationAllowedError: An
attempt was made to modify an object where modifications are not allowed.. | |
148 PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_RGBCOLOR | |
149 PASS fillPaint.uri is "" | |
150 PASS fillPaint.colorType is SVGColor.SVG_COLORTYPE_RGBCOLOR | |
151 PASS (fillColor = fillPaint.rgbColor).toString() is "[object RGBColor]" | |
152 PASS fillColor.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
153 PASS fillColor.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 128 | |
154 PASS fillColor.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
155 PASS rectElement.style.fill is "#008000" | |
156 PASS document.defaultView.getComputedStyle(rectElement).fill is "#008000" | |
157 | |
158 Test using setPaint() and SVG_PAINTTYPE_URI_CURRENTCOLOR | |
159 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_URI_CURRENTCOLOR, 'url(#foo)', 'r
gb(0,0,0)', 'icc-color(myRGB, 0, 1, 2)') threw exception NoModificationAllowedEr
ror: An attempt was made to modify an object where modifications are not allowed
.. | |
160 PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_RGBCOLOR | |
161 PASS fillPaint.uri is "" | |
162 PASS fillPaint.colorType is SVGColor.SVG_COLORTYPE_RGBCOLOR | |
163 PASS (fillColor = fillPaint.rgbColor).toString() is "[object RGBColor]" | |
164 PASS fillColor.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
165 PASS fillColor.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 128 | |
166 PASS fillColor.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
167 PASS rectElement.style.fill is "#008000" | |
168 PASS document.defaultView.getComputedStyle(rectElement).fill is "#008000" | |
169 | |
170 Test using setPaint() and SVG_PAINTTYPE_URI_RGBCOLOR | |
171 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_URI_RGBCOLOR, 'url(#test)', 'rgb(
77,0,77)', 'icc-color(myRGB, 0, 1, 2)') threw exception NoModificationAllowedErr
or: An attempt was made to modify an object where modifications are not allowed.
. | |
172 PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_RGBCOLOR | |
173 PASS fillPaint.uri is "" | |
174 PASS fillPaint.colorType is SVGColor.SVG_COLORTYPE_RGBCOLOR | |
175 PASS (fillColor = fillPaint.rgbColor).toString() is "[object RGBColor]" | |
176 PASS fillColor.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
177 PASS fillColor.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 128 | |
178 PASS fillColor.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
179 PASS rectElement.style.fill is "#008000" | |
180 PASS document.defaultView.getComputedStyle(rectElement).fill is "#008000" | |
181 | |
182 Test using setPaint() and SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR | |
183 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR, 'url(#foo)
', 'rgb(77,0,77)', 'icc-color(myRGB, 0, 1, 2)') threw exception NoModificationAl
lowedError: An attempt was made to modify an object where modifications are not
allowed.. | |
184 PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_RGBCOLOR | |
185 PASS fillPaint.uri is "" | |
186 PASS fillPaint.colorType is SVGColor.SVG_COLORTYPE_RGBCOLOR | |
187 PASS (fillColor = fillPaint.rgbColor).toString() is "[object RGBColor]" | |
188 PASS fillColor.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
189 PASS fillColor.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 128 | |
190 PASS fillColor.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
191 PASS rectElement.style.fill is "#008000" | |
192 PASS document.defaultView.getComputedStyle(rectElement).fill is "#008000" | |
193 | |
194 Test using setPaint() and SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR | |
195 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR, 'url(#test)',
'rgb(77,0,77)', 'icc-color(myRGB, 0, 1, 2)') threw exception NoModificationAllow
edError: An attempt was made to modify an object where modifications are not all
owed.. | |
196 PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_RGBCOLOR | |
197 PASS fillPaint.uri is "" | |
198 PASS fillPaint.colorType is SVGColor.SVG_COLORTYPE_RGBCOLOR | |
199 PASS (fillColor = fillPaint.rgbColor).toString() is "[object RGBColor]" | |
200 PASS fillColor.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
201 PASS fillColor.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 128 | |
202 PASS fillColor.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
203 PASS rectElement.style.fill is "#008000" | |
204 PASS document.defaultView.getComputedStyle(rectElement).fill is "#008000" | |
205 | |
206 Test using setPaint() and SVG_PAINTTYPE_CURRENTCOLOR | |
207 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_CURRENTCOLOR, 'url(#foo)', 'rgb(7
7,0,77)', 'icc-color(myRGB, 0, 1, 2)') threw exception NoModificationAllowedErro
r: An attempt was made to modify an object where modifications are not allowed.. | |
208 PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_RGBCOLOR | |
209 PASS fillPaint.uri is "" | |
210 PASS fillPaint.colorType is SVGColor.SVG_COLORTYPE_RGBCOLOR | |
211 PASS (fillColor = fillPaint.rgbColor).toString() is "[object RGBColor]" | |
212 PASS fillColor.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
213 PASS fillColor.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 128 | |
214 PASS fillColor.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
215 PASS rectElement.style.fill is "#008000" | |
216 PASS document.defaultView.getComputedStyle(rectElement).fill is "#008000" | |
217 | |
218 Test using setPaint() and SVG_PAINTTYPE_RGBCOLOR | |
219 PASS fillPaint.setPaint(SVGPaint.SVG_PAINTTYPE_RGBCOLOR, 'url(#test)', 'rgb(0,77
,0)', 'icc-color(myRGB, 0, 1, 2)') threw exception NoModificationAllowedError: A
n attempt was made to modify an object where modifications are not allowed.. | |
220 PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_RGBCOLOR | |
221 PASS fillPaint.uri is "" | |
222 PASS fillPaint.colorType is SVGColor.SVG_COLORTYPE_RGBCOLOR | |
223 PASS (fillColor = fillPaint.rgbColor).toString() is "[object RGBColor]" | |
224 PASS fillColor.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
225 PASS fillColor.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 128 | |
226 PASS fillColor.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
227 PASS rectElement.style.fill is "#008000" | |
228 PASS document.defaultView.getComputedStyle(rectElement).fill is "#008000" | |
229 | |
230 Test using setUri() | |
231 PASS fillPaint.setUri('url(#foobar)'); is undefined. | |
232 PASS fillPaint.paintType is SVGPaint.SVG_PAINTTYPE_RGBCOLOR | |
233 PASS fillPaint.uri is "" | |
234 PASS fillPaint.colorType is SVGColor.SVG_COLORTYPE_RGBCOLOR | |
235 PASS (fillColor = fillPaint.rgbColor).toString() is "[object RGBColor]" | |
236 PASS fillColor.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
237 PASS fillColor.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 128 | |
238 PASS fillColor.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
239 PASS rectElement.style.fill is "#008000" | |
240 PASS document.defaultView.getComputedStyle(rectElement).fill is "#008000" | |
241 PASS successfullyParsed is true | |
242 | |
243 TEST COMPLETE | |
244 | |
OLD | NEW |