zimmermann@webkit.org | bbd697c | 2010-11-11 11:20:11 +0000 | [diff] [blame] | 1 | This test checks the SVGTransform API |
| 2 | |
| 3 | On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". |
| 4 | |
| 5 | |
| 6 | |
| 7 | Check initial transform values |
| 8 | PASS transform.type is SVGTransform.SVG_TRANSFORM_MATRIX |
| 9 | PASS transform.angle is 0 |
| 10 | PASS transform.matrix.a is 1 |
| 11 | PASS transform.matrix.b is 0 |
| 12 | PASS transform.matrix.c is 0 |
| 13 | PASS transform.matrix.d is 1 |
| 14 | PASS transform.matrix.e is 0 |
| 15 | PASS transform.matrix.f is 0 |
| 16 | |
| 17 | Change to skewX transformation |
| 18 | PASS transform.setSkewX(45) is undefined. |
| 19 | PASS transform.type is SVGTransform.SVG_TRANSFORM_SKEWX |
| 20 | PASS transform.angle is 45 |
| 21 | PASS transform.matrix.a is 1 |
| 22 | PASS transform.matrix.b is 0 |
| 23 | PASS transform.matrix.c.toFixed(1) is "1.0" |
| 24 | PASS transform.matrix.d is 1 |
| 25 | PASS transform.matrix.e is 0 |
| 26 | PASS transform.matrix.f is 0 |
| 27 | |
| 28 | Changing matrix.e to 100, should reset transformation type to MATRIX, and angle should be 0 |
| 29 | PASS transform.matrix.e = 100 is 100 |
| 30 | PASS transform.type is SVGTransform.SVG_TRANSFORM_MATRIX |
| 31 | PASS transform.angle is 0 |
| 32 | PASS transform.matrix.a is 1 |
| 33 | PASS transform.matrix.b is 0 |
| 34 | PASS transform.matrix.c.toFixed(1) is "1.0" |
| 35 | PASS transform.matrix.d is 1 |
| 36 | PASS transform.matrix.e is 100 |
| 37 | PASS transform.matrix.f is 0 |
| 38 | |
| 39 | Now revert to initial matrix |
| 40 | PASS transform.matrix.c = null is null |
| 41 | PASS transform.matrix.e = 0 is 0 |
| 42 | PASS transform.type is SVGTransform.SVG_TRANSFORM_MATRIX |
| 43 | PASS transform.angle is 0 |
| 44 | PASS transform.matrix.a is 1 |
| 45 | PASS transform.matrix.b is 0 |
| 46 | PASS transform.matrix.c is 0 |
| 47 | PASS transform.matrix.d is 1 |
| 48 | PASS transform.matrix.e is 0 |
| 49 | PASS transform.matrix.f is 0 |
| 50 | |
| 51 | Check passing invalid arguments to 'setMatrix' |
abarth@webkit.org | 0ab1e76 | 2011-06-20 23:54:07 +0000 | [diff] [blame] | 52 | PASS transform.setMatrix() threw exception TypeError: Not enough arguments. |
oliver@apple.com | 772177e | 2014-03-14 20:11:26 +0000 | [diff] [blame] | 53 | PASS transform.setMatrix(transform) threw exception TypeError: Argument 1 ('matrix') to SVGTransform.setMatrix must be an instance of SVGMatrix. |
| 54 | PASS transform.setMatrix(svgElement) threw exception TypeError: Argument 1 ('matrix') to SVGTransform.setMatrix must be an instance of SVGMatrix. |
| 55 | PASS transform.setMatrix('aString') threw exception TypeError: Argument 1 ('matrix') to SVGTransform.setMatrix must be an instance of SVGMatrix. |
| 56 | PASS transform.setMatrix(1) threw exception TypeError: Argument 1 ('matrix') to SVGTransform.setMatrix must be an instance of SVGMatrix. |
| 57 | PASS transform.setMatrix(false) threw exception TypeError: Argument 1 ('matrix') to SVGTransform.setMatrix must be an instance of SVGMatrix. |
zimmermann@webkit.org | bbd697c | 2010-11-11 11:20:11 +0000 | [diff] [blame] | 58 | |
| 59 | Check passing invalid arguments to 'setTranslate' |
abarth@webkit.org | 0ab1e76 | 2011-06-20 23:54:07 +0000 | [diff] [blame] | 60 | PASS transform.setTranslate() threw exception TypeError: Not enough arguments. |
| 61 | PASS transform.setTranslate(transform) threw exception TypeError: Not enough arguments. |
| 62 | PASS transform.setTranslate(svgElement) threw exception TypeError: Not enough arguments. |
| 63 | PASS transform.setTranslate('aString') threw exception TypeError: Not enough arguments. |
kbr@google.com | b6fd06a | 2010-11-16 19:19:17 +0000 | [diff] [blame] | 64 | PASS transform.setTranslate(1, transform) is undefined. |
| 65 | PASS transform.setTranslate(1, svgElement) is undefined. |
| 66 | PASS transform.setTranslate(1, 'aString') is undefined. |
| 67 | PASS transform.setTranslate(transform, 1) is undefined. |
| 68 | PASS transform.setTranslate(svgElement, 1) is undefined. |
| 69 | PASS transform.setTranslate('aString', 1) is undefined. |
| 70 | PASS transform.setTranslate(transform, transform) is undefined. |
| 71 | PASS transform.setTranslate(svgElement, svgElement) is undefined. |
| 72 | PASS transform.setTranslate('aString', 'aString') is undefined. |
zimmermann@webkit.org | bbd697c | 2010-11-11 11:20:11 +0000 | [diff] [blame] | 73 | |
| 74 | Check passing invalid arguments to 'setScale' |
abarth@webkit.org | 0ab1e76 | 2011-06-20 23:54:07 +0000 | [diff] [blame] | 75 | PASS transform.setScale() threw exception TypeError: Not enough arguments. |
| 76 | PASS transform.setScale(transform) threw exception TypeError: Not enough arguments. |
| 77 | PASS transform.setScale(svgElement) threw exception TypeError: Not enough arguments. |
| 78 | PASS transform.setScale('aString') threw exception TypeError: Not enough arguments. |
kbr@google.com | b6fd06a | 2010-11-16 19:19:17 +0000 | [diff] [blame] | 79 | PASS transform.setScale(1, transform) is undefined. |
| 80 | PASS transform.setScale(1, svgElement) is undefined. |
| 81 | PASS transform.setScale(1, 'aString') is undefined. |
| 82 | PASS transform.setScale(transform, 1) is undefined. |
| 83 | PASS transform.setScale(svgElement, 1) is undefined. |
| 84 | PASS transform.setScale('aString', 1) is undefined. |
| 85 | PASS transform.setScale(transform, transform) is undefined. |
| 86 | PASS transform.setScale(svgElement, svgElement) is undefined. |
| 87 | PASS transform.setScale('aString', 'aString') is undefined. |
zimmermann@webkit.org | bbd697c | 2010-11-11 11:20:11 +0000 | [diff] [blame] | 88 | |
| 89 | Check passing invalid arguments to 'setRotate' |
abarth@webkit.org | 0ab1e76 | 2011-06-20 23:54:07 +0000 | [diff] [blame] | 90 | PASS transform.setRotate() threw exception TypeError: Not enough arguments. |
| 91 | PASS transform.setRotate(transform) threw exception TypeError: Not enough arguments. |
| 92 | PASS transform.setRotate(svgElement) threw exception TypeError: Not enough arguments. |
| 93 | PASS transform.setRotate('aString') threw exception TypeError: Not enough arguments. |
| 94 | PASS transform.setRotate(1, transform) threw exception TypeError: Not enough arguments. |
| 95 | PASS transform.setRotate(1, svgElement) threw exception TypeError: Not enough arguments. |
| 96 | PASS transform.setRotate(1, 'aString') threw exception TypeError: Not enough arguments. |
kbr@google.com | b6fd06a | 2010-11-16 19:19:17 +0000 | [diff] [blame] | 97 | PASS transform.setRotate(1, 1, transform) is undefined. |
| 98 | PASS transform.setRotate(1, 1, svgElement) is undefined. |
| 99 | PASS transform.setRotate(1, 1, 'aString') is undefined. |
zimmermann@webkit.org | bbd697c | 2010-11-11 11:20:11 +0000 | [diff] [blame] | 100 | |
| 101 | Check passing invalid arguments to 'setSkewX' |
abarth@webkit.org | 0ab1e76 | 2011-06-20 23:54:07 +0000 | [diff] [blame] | 102 | PASS transform.setSkewX() threw exception TypeError: Not enough arguments. |
kbr@google.com | b6fd06a | 2010-11-16 19:19:17 +0000 | [diff] [blame] | 103 | PASS transform.setSkewX(transform) is undefined. |
| 104 | PASS transform.setSkewX(svgElement) is undefined. |
| 105 | PASS transform.setSkewX('aString') is undefined. |
zimmermann@webkit.org | bbd697c | 2010-11-11 11:20:11 +0000 | [diff] [blame] | 106 | |
| 107 | Check passing invalid arguments to 'setSkewY' |
abarth@webkit.org | 0ab1e76 | 2011-06-20 23:54:07 +0000 | [diff] [blame] | 108 | PASS transform.setSkewY() threw exception TypeError: Not enough arguments. |
kbr@google.com | b6fd06a | 2010-11-16 19:19:17 +0000 | [diff] [blame] | 109 | PASS transform.setSkewY(transform) is undefined. |
| 110 | PASS transform.setSkewY(svgElement) is undefined. |
| 111 | PASS transform.setSkewY('aString') is undefined. |
zimmermann@webkit.org | bbd697c | 2010-11-11 11:20:11 +0000 | [diff] [blame] | 112 | PASS successfullyParsed is true |
| 113 | |
| 114 | TEST COMPLETE |
| 115 | |