blob: e4a7712131b1de9504007dfded6d0c32ad37a678 [file] [log] [blame]
zimmermann@webkit.orgbbd697c2010-11-11 11:20:11 +00001This test checks the SVGTransform API
2
3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
7Check initial transform values
8PASS transform.type is SVGTransform.SVG_TRANSFORM_MATRIX
9PASS transform.angle is 0
10PASS transform.matrix.a is 1
11PASS transform.matrix.b is 0
12PASS transform.matrix.c is 0
13PASS transform.matrix.d is 1
14PASS transform.matrix.e is 0
15PASS transform.matrix.f is 0
16
17Change to skewX transformation
18PASS transform.setSkewX(45) is undefined.
19PASS transform.type is SVGTransform.SVG_TRANSFORM_SKEWX
20PASS transform.angle is 45
21PASS transform.matrix.a is 1
22PASS transform.matrix.b is 0
23PASS transform.matrix.c.toFixed(1) is "1.0"
24PASS transform.matrix.d is 1
25PASS transform.matrix.e is 0
26PASS transform.matrix.f is 0
27
28Changing matrix.e to 100, should reset transformation type to MATRIX, and angle should be 0
29PASS transform.matrix.e = 100 is 100
30PASS transform.type is SVGTransform.SVG_TRANSFORM_MATRIX
31PASS transform.angle is 0
32PASS transform.matrix.a is 1
33PASS transform.matrix.b is 0
34PASS transform.matrix.c.toFixed(1) is "1.0"
35PASS transform.matrix.d is 1
36PASS transform.matrix.e is 100
37PASS transform.matrix.f is 0
38
39Now revert to initial matrix
40PASS transform.matrix.c = null is null
41PASS transform.matrix.e = 0 is 0
42PASS transform.type is SVGTransform.SVG_TRANSFORM_MATRIX
43PASS transform.angle is 0
44PASS transform.matrix.a is 1
45PASS transform.matrix.b is 0
46PASS transform.matrix.c is 0
47PASS transform.matrix.d is 1
48PASS transform.matrix.e is 0
49PASS transform.matrix.f is 0
50
51Check passing invalid arguments to 'setMatrix'
abarth@webkit.org0ab1e762011-06-20 23:54:07 +000052PASS transform.setMatrix() threw exception TypeError: Not enough arguments.
oliver@apple.com772177e2014-03-14 20:11:26 +000053PASS transform.setMatrix(transform) threw exception TypeError: Argument 1 ('matrix') to SVGTransform.setMatrix must be an instance of SVGMatrix.
54PASS transform.setMatrix(svgElement) threw exception TypeError: Argument 1 ('matrix') to SVGTransform.setMatrix must be an instance of SVGMatrix.
55PASS transform.setMatrix('aString') threw exception TypeError: Argument 1 ('matrix') to SVGTransform.setMatrix must be an instance of SVGMatrix.
56PASS transform.setMatrix(1) threw exception TypeError: Argument 1 ('matrix') to SVGTransform.setMatrix must be an instance of SVGMatrix.
57PASS transform.setMatrix(false) threw exception TypeError: Argument 1 ('matrix') to SVGTransform.setMatrix must be an instance of SVGMatrix.
zimmermann@webkit.orgbbd697c2010-11-11 11:20:11 +000058
59Check passing invalid arguments to 'setTranslate'
abarth@webkit.org0ab1e762011-06-20 23:54:07 +000060PASS transform.setTranslate() threw exception TypeError: Not enough arguments.
61PASS transform.setTranslate(transform) threw exception TypeError: Not enough arguments.
62PASS transform.setTranslate(svgElement) threw exception TypeError: Not enough arguments.
63PASS transform.setTranslate('aString') threw exception TypeError: Not enough arguments.
kbr@google.comb6fd06a2010-11-16 19:19:17 +000064PASS transform.setTranslate(1, transform) is undefined.
65PASS transform.setTranslate(1, svgElement) is undefined.
66PASS transform.setTranslate(1, 'aString') is undefined.
67PASS transform.setTranslate(transform, 1) is undefined.
68PASS transform.setTranslate(svgElement, 1) is undefined.
69PASS transform.setTranslate('aString', 1) is undefined.
70PASS transform.setTranslate(transform, transform) is undefined.
71PASS transform.setTranslate(svgElement, svgElement) is undefined.
72PASS transform.setTranslate('aString', 'aString') is undefined.
zimmermann@webkit.orgbbd697c2010-11-11 11:20:11 +000073
74Check passing invalid arguments to 'setScale'
abarth@webkit.org0ab1e762011-06-20 23:54:07 +000075PASS transform.setScale() threw exception TypeError: Not enough arguments.
76PASS transform.setScale(transform) threw exception TypeError: Not enough arguments.
77PASS transform.setScale(svgElement) threw exception TypeError: Not enough arguments.
78PASS transform.setScale('aString') threw exception TypeError: Not enough arguments.
kbr@google.comb6fd06a2010-11-16 19:19:17 +000079PASS transform.setScale(1, transform) is undefined.
80PASS transform.setScale(1, svgElement) is undefined.
81PASS transform.setScale(1, 'aString') is undefined.
82PASS transform.setScale(transform, 1) is undefined.
83PASS transform.setScale(svgElement, 1) is undefined.
84PASS transform.setScale('aString', 1) is undefined.
85PASS transform.setScale(transform, transform) is undefined.
86PASS transform.setScale(svgElement, svgElement) is undefined.
87PASS transform.setScale('aString', 'aString') is undefined.
zimmermann@webkit.orgbbd697c2010-11-11 11:20:11 +000088
89Check passing invalid arguments to 'setRotate'
abarth@webkit.org0ab1e762011-06-20 23:54:07 +000090PASS transform.setRotate() threw exception TypeError: Not enough arguments.
91PASS transform.setRotate(transform) threw exception TypeError: Not enough arguments.
92PASS transform.setRotate(svgElement) threw exception TypeError: Not enough arguments.
93PASS transform.setRotate('aString') threw exception TypeError: Not enough arguments.
94PASS transform.setRotate(1, transform) threw exception TypeError: Not enough arguments.
95PASS transform.setRotate(1, svgElement) threw exception TypeError: Not enough arguments.
96PASS transform.setRotate(1, 'aString') threw exception TypeError: Not enough arguments.
kbr@google.comb6fd06a2010-11-16 19:19:17 +000097PASS transform.setRotate(1, 1, transform) is undefined.
98PASS transform.setRotate(1, 1, svgElement) is undefined.
99PASS transform.setRotate(1, 1, 'aString') is undefined.
zimmermann@webkit.orgbbd697c2010-11-11 11:20:11 +0000100
101Check passing invalid arguments to 'setSkewX'
abarth@webkit.org0ab1e762011-06-20 23:54:07 +0000102PASS transform.setSkewX() threw exception TypeError: Not enough arguments.
kbr@google.comb6fd06a2010-11-16 19:19:17 +0000103PASS transform.setSkewX(transform) is undefined.
104PASS transform.setSkewX(svgElement) is undefined.
105PASS transform.setSkewX('aString') is undefined.
zimmermann@webkit.orgbbd697c2010-11-11 11:20:11 +0000106
107Check passing invalid arguments to 'setSkewY'
abarth@webkit.org0ab1e762011-06-20 23:54:07 +0000108PASS transform.setSkewY() threw exception TypeError: Not enough arguments.
kbr@google.comb6fd06a2010-11-16 19:19:17 +0000109PASS transform.setSkewY(transform) is undefined.
110PASS transform.setSkewY(svgElement) is undefined.
111PASS transform.setSkewY('aString') is undefined.
zimmermann@webkit.orgbbd697c2010-11-11 11:20:11 +0000112PASS successfullyParsed is true
113
114TEST COMPLETE
115