blob: 95abe52de3561d6fe3b1b8c28359d3a35f9ac625 [file] [log] [blame]
This test exercises the CSSMatrix 3D interface
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
CSSMatrix constructors
PASS default constructor
PASS object constructor
PASS string constructor
Test toString
PASS a[0] is "matrix3d"
PASS parseFloat(a2[0]) is 1
PASS parseFloat(a2[1]) is 0
PASS parseFloat(a2[2]) is 0
PASS parseFloat(a2[3]) is 1
PASS parseFloat(a2[4]) is 0
PASS parseFloat(a2[5]) is 1
PASS parseFloat(a2[6]) is 0
PASS parseFloat(a2[7]) is 0
PASS parseFloat(a2[8]) is 0
PASS parseFloat(a2[9]) is 0
PASS parseFloat(a2[10]) is 1
PASS parseFloat(a2[11]) is 0
PASS parseFloat(a2[12]) is 0
PASS parseFloat(a2[13]) is 0
PASS parseFloat(a2[14]) is 0
PASS parseFloat(a3[0]) is 1
PASS a3[1] is ""
Test bad input to string constructor
PASS new WebKitCSSMatrix("banana") threw exception Error: SYNTAX_ERR: DOM Exception 12.
Test attributes on default matrix
PASS m.m11 is 1
PASS m.m12 is 0
PASS m.m13 is 0
PASS m.m14 is 0
PASS m.m21 is 0
PASS m.m22 is 1
PASS m.m23 is 0
PASS m.m24 is 0
PASS m.m31 is 0
PASS m.m32 is 0
PASS m.m33 is 1
PASS m.m34 is 0
PASS m.m41 is 0
PASS m.m42 is 0
PASS m.m43 is 0
PASS m.m44 is 1
Test attributes on custom matrix
PASS m.m11 is 11
PASS m.m12 is 12
PASS m.m13 is 13
PASS m.m14 is 14
PASS m.m21 is 21
PASS m.m22 is 22
PASS m.m23 is 23
PASS m.m24 is 24
PASS m.m31 is 31
PASS m.m32 is 32
PASS m.m33 is 33
PASS m.m34 is 34
PASS m.m41 is 41
PASS m.m42 is 42
PASS m.m43 is 43
PASS m.m44 is 44
Test setMatrixValue - set to matrix()
PASS m.m11 is 11
PASS m.m12 is 12
PASS m.m13 is 13
PASS m.m14 is 14
PASS m.m21 is 21
PASS m.m22 is 22
PASS m.m23 is 23
PASS m.m24 is 24
PASS m.m31 is 31
PASS m.m32 is 32
PASS m.m33 is 33
PASS m.m34 is 34
PASS m.m41 is 41
PASS m.m42 is 42
PASS m.m43 is 43
PASS m.m44 is 44
Test setMatrixValue - set to translate(10px, 20px, 30px) scale(2, 3, 4)
PASS m.m11 is 2
PASS m.m12 is 0
PASS m.m13 is 0
PASS m.m14 is 0
PASS m.m21 is 0
PASS m.m22 is 3
PASS m.m23 is 0
PASS m.m24 is 0
PASS m.m31 is 0
PASS m.m32 is 0
PASS m.m33 is 4
PASS m.m34 is 0
PASS m.m41 is 10
PASS m.m42 is 20
PASS m.m43 is 30
PASS m.m44 is 1
Test throwing exception from setMatrixValue
PASS m.setMatrixValue("banana") threw exception Error: SYNTAX_ERR: DOM Exception 12.
PASS m.setMatrixValue("translate3d(10em, 20%, 40)") threw exception Error: SYNTAX_ERR: DOM Exception 12.
PASS m.setMatrixValue("translate3d(10px, 20px, 30px) scale3d()") threw exception Error: SYNTAX_ERR: DOM Exception 12.
Test multiply
PASS parseFloat(m3.m11) is 538
PASS parseFloat(m3.m12) is 612
PASS parseFloat(m3.m13) is 686
PASS parseFloat(m3.m14) is 760
PASS parseFloat(m3.m21) is 650
PASS parseFloat(m3.m22) is 740
PASS parseFloat(m3.m23) is 830
PASS parseFloat(m3.m24) is 920
PASS parseFloat(m3.m31) is 762
PASS parseFloat(m3.m32) is 868
PASS parseFloat(m3.m33) is 974
PASS parseFloat(m3.m34) is 1080
PASS parseFloat(m3.m41) is 874
PASS parseFloat(m3.m42) is 996
PASS parseFloat(m3.m43) is 1118
PASS parseFloat(m3.m44) is 1240
Test immutability of multiply
PASS parseFloat(m.m11) is 1
PASS parseFloat(m.m12) is 2
PASS parseFloat(m.m13) is 3
PASS parseFloat(m.m14) is 4
PASS parseFloat(m.m21) is 5
PASS parseFloat(m.m22) is 6
PASS parseFloat(m.m23) is 7
PASS parseFloat(m.m24) is 8
PASS parseFloat(m.m31) is 9
PASS parseFloat(m.m32) is 10
PASS parseFloat(m.m33) is 11
PASS parseFloat(m.m34) is 12
PASS parseFloat(m.m41) is 13
PASS parseFloat(m.m42) is 14
PASS parseFloat(m.m43) is 15
PASS parseFloat(m.m44) is 16
Test multiply in an affine matrix
PASS parseFloat(m3.m11) is 31
PASS parseFloat(m3.m12) is 46
PASS parseFloat(m3.m13) is 0
PASS parseFloat(m3.m14) is 0
PASS parseFloat(m3.m21) is 39
PASS parseFloat(m3.m22) is 58
PASS parseFloat(m3.m23) is 0
PASS parseFloat(m3.m24) is 0
PASS parseFloat(m3.m31) is 0
PASS parseFloat(m3.m32) is 0
PASS parseFloat(m3.m33) is 1
PASS parseFloat(m3.m34) is 0
PASS parseFloat(m3.m41) is 52
PASS parseFloat(m3.m42) is 76
PASS parseFloat(m3.m43) is 0
PASS parseFloat(m3.m44) is 1
Test that multiply works in the right direction
PASS m.m11 is 2
PASS m.m12 is 0
PASS m.m13 is 0
PASS m.m14 is 0
PASS m.m21 is 0
PASS m.m22 is 1
PASS m.m23 is 0
PASS m.m24 is 0
PASS m.m31 is 0
PASS m.m32 is 0
PASS m.m33 is 1
PASS m.m34 is 0
PASS m.m41 is 100
PASS m.m42 is 0
PASS m.m43 is 0
PASS m.m44 is 1
Test inverse
PASS parseFloat(m2.m11) is 0.5
PASS parseFloat(m2.m12) is 0
PASS parseFloat(m2.m13) is 0
PASS parseFloat(m2.m14) is 0
PASS parseFloat(m2.m21) is 0
PASS parseFloat(m2.m22) is 0.5
PASS parseFloat(m2.m23) is 0
PASS parseFloat(m2.m24) is 0
PASS parseFloat(m2.m31) is 0
PASS parseFloat(m2.m32) is 0
PASS parseFloat(m2.m33) is 0.5
PASS parseFloat(m2.m34) is 0
PASS parseFloat(m2.m41) is -5
PASS parseFloat(m2.m42) is -10
PASS parseFloat(m2.m43) is -15
PASS parseFloat(m2.m44) is 1
Test immutability of inverse
PASS parseFloat(m.m11) is 2
PASS parseFloat(m.m12) is 0
PASS parseFloat(m.m13) is 0
PASS parseFloat(m.m14) is 0
PASS parseFloat(m.m21) is 0
PASS parseFloat(m.m22) is 2
PASS parseFloat(m.m23) is 0
PASS parseFloat(m.m24) is 0
PASS parseFloat(m.m31) is 0
PASS parseFloat(m.m32) is 0
PASS parseFloat(m.m33) is 2
PASS parseFloat(m.m34) is 0
PASS parseFloat(m.m41) is 10
PASS parseFloat(m.m42) is 20
PASS parseFloat(m.m43) is 30
PASS parseFloat(m.m44) is 1
Test throwing exception from inverse
PASS m.inverse() threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
Test translate
PASS m2.m11 is 1
PASS m2.m12 is 0
PASS m2.m13 is 0
PASS m2.m14 is 0
PASS m2.m21 is 0
PASS m2.m22 is 1
PASS m2.m23 is 0
PASS m2.m24 is 0
PASS m2.m31 is 0
PASS m2.m32 is 0
PASS m2.m33 is 1
PASS m2.m34 is 0
PASS m2.m41 is 10
PASS m2.m42 is 20
PASS m2.m43 is 30
PASS m2.m44 is 1
Test immutability of translate
PASS m.m11 is 1
PASS m.m12 is 0
PASS m.m13 is 0
PASS m.m14 is 0
PASS m.m21 is 0
PASS m.m22 is 1
PASS m.m23 is 0
PASS m.m24 is 0
PASS m.m31 is 0
PASS m.m32 is 0
PASS m.m33 is 1
PASS m.m34 is 0
PASS m.m41 is 0
PASS m.m42 is 0
PASS m.m43 is 0
PASS m.m44 is 1
Test scale
PASS m2.m11 is 10
PASS m2.m12 is 0
PASS m2.m13 is 0
PASS m2.m14 is 0
PASS m2.m21 is 0
PASS m2.m22 is 20
PASS m2.m23 is 0
PASS m2.m24 is 0
PASS m2.m31 is 0
PASS m2.m32 is 0
PASS m2.m33 is 30
PASS m2.m34 is 0
PASS m2.m41 is 0
PASS m2.m42 is 0
PASS m2.m43 is 0
PASS m2.m44 is 1
Test immutability of scale
PASS m.m11 is 1
PASS m.m12 is 0
PASS m.m13 is 0
PASS m.m14 is 0
PASS m.m21 is 0
PASS m.m22 is 1
PASS m.m23 is 0
PASS m.m24 is 0
PASS m.m31 is 0
PASS m.m32 is 0
PASS m.m33 is 1
PASS m.m34 is 0
PASS m.m41 is 0
PASS m.m42 is 0
PASS m.m43 is 0
PASS m.m44 is 1
Test rotate
PASS parseFloat(m2.m11.toPrecision(6)) is 0.813798
PASS parseFloat(m2.m12.toPrecision(6)) is 0.469846
PASS parseFloat(m2.m13.toPrecision(6)) is -0.34202
PASS parseFloat(m2.m14.toPrecision(6)) is 0
PASS parseFloat(m2.m21.toPrecision(6)) is -0.44097
PASS parseFloat(m2.m22.toPrecision(6)) is 0.882564
PASS parseFloat(m2.m23.toPrecision(6)) is 0.163176
PASS parseFloat(m2.m24.toPrecision(6)) is 0
PASS parseFloat(m2.m31.toPrecision(6)) is 0.378522
PASS parseFloat(m2.m32.toPrecision(6)) is 0.0180283
PASS parseFloat(m2.m33.toPrecision(6)) is 0.925417
PASS parseFloat(m2.m34.toPrecision(6)) is 0
PASS parseFloat(m2.m41.toPrecision(6)) is 0
PASS parseFloat(m2.m42.toPrecision(6)) is 0
PASS parseFloat(m2.m43.toPrecision(6)) is 0
PASS parseFloat(m2.m44.toPrecision(6)) is 1
Test immutability of rotate
PASS m.m11 is 1
PASS m.m12 is 0
PASS m.m13 is 0
PASS m.m14 is 0
PASS m.m21 is 0
PASS m.m22 is 1
PASS m.m23 is 0
PASS m.m24 is 0
PASS m.m31 is 0
PASS m.m32 is 0
PASS m.m33 is 1
PASS m.m34 is 0
PASS m.m41 is 0
PASS m.m42 is 0
PASS m.m43 is 0
PASS m.m44 is 1
Test rotateAxisAngle
PASS parseFloat(m2.m11.toPrecision(6)) is 0.804738
PASS parseFloat(m2.m12.toPrecision(6)) is 0.505879
PASS parseFloat(m2.m13.toPrecision(6)) is -0.310617
PASS parseFloat(m2.m14.toPrecision(6)) is 0
PASS parseFloat(m2.m21.toPrecision(6)) is -0.310617
PASS parseFloat(m2.m22.toPrecision(6)) is 0.804738
PASS parseFloat(m2.m23.toPrecision(6)) is 0.505879
PASS parseFloat(m2.m24.toPrecision(6)) is 0
PASS parseFloat(m2.m31.toPrecision(6)) is 0.505879
PASS parseFloat(m2.m32.toPrecision(6)) is -0.310617
PASS parseFloat(m2.m33.toPrecision(6)) is 0.804738
PASS parseFloat(m2.m34.toPrecision(6)) is 0
PASS parseFloat(m2.m41.toPrecision(6)) is 0
PASS parseFloat(m2.m42.toPrecision(6)) is 0
PASS parseFloat(m2.m43.toPrecision(6)) is 0
PASS parseFloat(m2.m44.toPrecision(6)) is 1
Test immutability of rotateAxisAngle
PASS m.m11 is 1
PASS m.m12 is 0
PASS m.m13 is 0
PASS m.m14 is 0
PASS m.m21 is 0
PASS m.m22 is 1
PASS m.m23 is 0
PASS m.m24 is 0
PASS m.m31 is 0
PASS m.m32 is 0
PASS m.m33 is 1
PASS m.m34 is 0
PASS m.m41 is 0
PASS m.m42 is 0
PASS m.m43 is 0
PASS m.m44 is 1
PASS successfullyParsed is true
TEST COMPLETE