OLD | NEW |
| (Empty) |
1 This test checks the SVGColor API | |
2 | |
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | |
4 | |
5 | |
6 | |
7 Check initial color values | |
8 PASS (stopColor = stopElement.style.getPropertyCSSValue('stop-color')).toString(
) is "[object SVGColor]" | |
9 PASS stopColor.colorType is SVGColor.SVG_COLORTYPE_RGBCOLOR | |
10 PASS (rgbColor = stopColor.rgbColor).toString() is "[object RGBColor]" | |
11 PASS rgbColor.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255 | |
12 PASS rgbColor.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
13 PASS rgbColor.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
14 PASS stopElement.style.stopColor is "#ff0000" | |
15 PASS document.defaultView.getComputedStyle(stopElement).stopColor is "rgb(255, 0
, 0)" | |
16 | |
17 Try invalid arguments for setColor() | |
18 PASS stopColor.setColor(null, null, null) threw exception NoModificationAllowedE
rror: An attempt was made to modify an object where modifications are not allowe
d.. | |
19 PASS stopColor.setColor(SVGColor.SVG_COLORTYPE_RGBCOLOR, svgElement, ''); threw
exception NoModificationAllowedError: An attempt was made to modify an object wh
ere modifications are not allowed.. | |
20 PASS stopColor.setColor(SVGColor.SVG_COLORTYPE_RGBCOLOR, '', '') threw exception
NoModificationAllowedError: An attempt was made to modify an object where modif
ications are not allowed.. | |
21 PASS stopColor.setColor(SVGColor.SVG_COLORTYPE_CURRENTCOLOR + 1, '', ''); threw
exception NoModificationAllowedError: An attempt was made to modify an object wh
ere modifications are not allowed.. | |
22 PASS stopColor.setColor() threw exception TypeError: Failed to execute 'setColor
' on 'SVGColor': 3 arguments required, but only 0 present.. | |
23 PASS stopColor.setColor(stopColor) threw exception TypeError: Failed to execute
'setColor' on 'SVGColor': 3 arguments required, but only 1 present.. | |
24 | |
25 Try assigning to the readonly colorType property, which silently fails | |
26 PASS stopColor.colorType = SVGColor.SVG_COLORTYPE_UNKKNOWN; is undefined. | |
27 PASS stopColor.colorType is SVGColor.SVG_COLORTYPE_RGBCOLOR | |
28 PASS stopElement.style.stopColor is "#ff0000" | |
29 PASS document.defaultView.getComputedStyle(stopElement).stopColor is "rgb(255, 0
, 0)" | |
30 | |
31 Test using setColor() and SVG_COLORTYPE_UNKNOWN | |
32 PASS stopColor.setColor(SVGColor.SVG_COLORTYPE_UNKKNOWN, '', '') threw exception
NoModificationAllowedError: An attempt was made to modify an object where modif
ications are not allowed.. | |
33 PASS stopColor.setColor(SVGColor.SVG_COLORTYPE_UNKKNOWN, 'rgb(0,128,128)', '') t
hrew exception NoModificationAllowedError: An attempt was made to modify an obje
ct where modifications are not allowed.. | |
34 PASS stopColor.setColor(SVGColor.SVG_COLORTYPE_UNKKNOWN, '', 'icc-color(myRGB, 0
, 1, 2)') threw exception NoModificationAllowedError: An attempt was made to mod
ify an object where modifications are not allowed.. | |
35 PASS stopColor.setColor(SVGColor.SVG_COLORTYPE_UNKKNOWN, 'rgb(0,0,0)', 'icc-colo
r(myRGB, 0, 1, 2)') threw exception NoModificationAllowedError: An attempt was m
ade to modify an object where modifications are not allowed.. | |
36 | |
37 Test using setColor() and SVG_COLORTYPE_RGBCOLOR_ICCCOLOR | |
38 PASS stopColor.setColor(SVGColor.SVG_COLORTYPE_RGBCOLOR_ICCCOLOR, 'rgb(77,0,77)'
, 'icc-color(myRGB, 0, 1, 2)') threw exception NoModificationAllowedError: An at
tempt was made to modify an object where modifications are not allowed.. | |
39 PASS stopColor.colorType is SVGColor.SVG_COLORTYPE_RGBCOLOR | |
40 PASS stopColor.colorType is SVGColor.SVG_COLORTYPE_RGBCOLOR | |
41 PASS (rgbColor = stopColor.rgbColor).toString() is "[object RGBColor]" | |
42 PASS rgbColor.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255 | |
43 PASS rgbColor.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
44 PASS rgbColor.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
45 PASS stopElement.style.stopColor is "#ff0000" | |
46 PASS document.defaultView.getComputedStyle(stopElement).stopColor is "rgb(255, 0
, 0)" | |
47 | |
48 Test using setColor() and SVG_COLORTYPE_CURRENTCOLOR | |
49 PASS stopColor.setColor(SVGColor.SVG_COLORTYPE_CURRENTCOLOR, 'rgb(77,0,77)', 'ic
c-color(myRGB, 0, 1, 2)') threw exception NoModificationAllowedError: An attempt
was made to modify an object where modifications are not allowed.. | |
50 PASS stopColor.colorType is SVGColor.SVG_COLORTYPE_RGBCOLOR | |
51 PASS stopColor.colorType is SVGColor.SVG_COLORTYPE_RGBCOLOR | |
52 PASS (rgbColor = stopColor.rgbColor).toString() is "[object RGBColor]" | |
53 PASS rgbColor.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255 | |
54 PASS rgbColor.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
55 PASS rgbColor.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
56 PASS stopElement.style.stopColor is "#ff0000" | |
57 PASS document.defaultView.getComputedStyle(stopElement).stopColor is "rgb(255, 0
, 0)" | |
58 | |
59 Test using setColor() and SVG_COLORTYPE_RGBCOLOR | |
60 PASS stopColor.setColor(SVGColor.SVG_COLORTYPE_RGBCOLOR, 'rgb(0,77,0)', 'icc-col
or(myRGB, 0, 1, 2)') threw exception NoModificationAllowedError: An attempt was
made to modify an object where modifications are not allowed.. | |
61 PASS stopColor.colorType is SVGColor.SVG_COLORTYPE_RGBCOLOR | |
62 PASS stopColor.colorType is SVGColor.SVG_COLORTYPE_RGBCOLOR | |
63 PASS (rgbColor = stopColor.rgbColor).toString() is "[object RGBColor]" | |
64 PASS rgbColor.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255 | |
65 PASS rgbColor.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
66 PASS rgbColor.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 | |
67 PASS document.defaultView.getComputedStyle(stopElement).stopColor is "rgb(255, 0
, 0)" | |
68 PASS successfullyParsed is true | |
69 | |
70 TEST COMPLETE | |
71 | |
OLD | NEW |