235 lines
5.2 KiB
Plaintext
235 lines
5.2 KiB
Plaintext
This test exercises the CSSMatrix interface
|
|
|
|
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
|
|
|
|
|
|
CSSMatrix constructors
|
|
PASS m is non-null.
|
|
PASS new WebKitCSSMatrix() is non-null.
|
|
PASS new WebKitCSSMatrix(m) is non-null.
|
|
PASS new WebKitCSSMatrix("matrix(1, 0, 0, 1, 0, 0)") is non-null.
|
|
PASS new WebKitCSSMatrix("") is non-null.
|
|
PASS new WebKitCSSMatrix("none") is non-null.
|
|
PASS new WebKitCSSMatrix(" none ") is non-null.
|
|
|
|
Test toString
|
|
PASS a[0] is "matrix"
|
|
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(a3[0]) is 0
|
|
PASS a3[1] is ""
|
|
|
|
Test bad input to string constructor
|
|
PASS new WebKitCSSMatrix("banana") threw exception SyntaxError: The string did not match the expected pattern..
|
|
|
|
Test attributes on default matrix
|
|
PASS m.a is 1
|
|
PASS m.b is 0
|
|
PASS m.c is 0
|
|
PASS m.d is 1
|
|
PASS m.e is 0
|
|
PASS m.f is 0
|
|
|
|
Test attributes on custom matrix
|
|
PASS m.a is 11
|
|
PASS m.b is 12
|
|
PASS m.c is 21
|
|
PASS m.d is 22
|
|
PASS m.e is 41
|
|
PASS m.f is 42
|
|
|
|
Test setMatrixValue - set to matrix()
|
|
PASS m.a is 11
|
|
PASS m.b is 12
|
|
PASS m.c is 21
|
|
PASS m.d is 22
|
|
PASS m.e is 41
|
|
PASS m.f is 42
|
|
|
|
Test setMatrixValue - set to translate(10px, 20px) scale(2, 3)
|
|
PASS m.a is 2
|
|
PASS m.b is 0
|
|
PASS m.c is 0
|
|
PASS m.d is 3
|
|
PASS m.e is 10
|
|
PASS m.f is 20
|
|
|
|
Test throwing exception from setMatrixValue
|
|
PASS m.setMatrixValue("banana") threw exception SyntaxError: The string did not match the expected pattern..
|
|
PASS m.setMatrixValue("translate(10em, 20%)") threw exception SyntaxError: The string did not match the expected pattern..
|
|
PASS m.setMatrixValue("translate(10px, 20px) scale()") threw exception SyntaxError: The string did not match the expected pattern..
|
|
|
|
Test attributes on translate() and accumulation
|
|
PASS m2.a is 1
|
|
PASS m2.b is 0
|
|
PASS m2.c is 0
|
|
PASS m2.d is 1
|
|
PASS m2.e is 100
|
|
PASS m2.f is 50
|
|
|
|
Test immutability of translate
|
|
PASS parseFloat(m.a) is 1
|
|
PASS parseFloat(m.b) is 0
|
|
PASS parseFloat(m.c) is 0
|
|
PASS parseFloat(m.d) is 1
|
|
PASS parseFloat(m.e) is 0
|
|
PASS parseFloat(m.f) is 0
|
|
|
|
Test attributes on scale()
|
|
PASS m3.a is 5
|
|
PASS m3.b is 0
|
|
PASS m3.c is 0
|
|
PASS m3.d is 5
|
|
PASS m3.e is 100
|
|
PASS m3.f is 50
|
|
|
|
Test immutability of scale()
|
|
PASS parseFloat(m2.a) is 1
|
|
PASS parseFloat(m2.b) is 0
|
|
PASS parseFloat(m2.c) is 0
|
|
PASS parseFloat(m2.d) is 1
|
|
PASS parseFloat(m2.e) is 100
|
|
PASS parseFloat(m2.f) is 50
|
|
|
|
Test attributes on non-uniform scale()
|
|
PASS m4.a is 10
|
|
PASS m4.b is 0
|
|
PASS m4.c is 0
|
|
PASS m4.d is 5
|
|
PASS m4.e is 100
|
|
PASS m4.f is 50
|
|
|
|
Test immutability of non-uniform scale()
|
|
PASS parseFloat(m3.a) is 5
|
|
PASS parseFloat(m3.b) is 0
|
|
PASS parseFloat(m3.c) is 0
|
|
PASS parseFloat(m3.d) is 5
|
|
PASS parseFloat(m3.e) is 100
|
|
PASS parseFloat(m3.f) is 50
|
|
|
|
Test rotate
|
|
PASS parseFloat(m2.a.toPrecision(6)) is 0.984808
|
|
PASS parseFloat(m2.b.toPrecision(6)) is 0.173648
|
|
PASS parseFloat(m2.c.toPrecision(6)) is -0.173648
|
|
PASS parseFloat(m2.d.toPrecision(6)) is 0.984808
|
|
PASS m.e is 0
|
|
PASS m.f is 0
|
|
|
|
Test immutability of rotate
|
|
PASS parseFloat(m.a) is 1
|
|
PASS parseFloat(m.b) is 0
|
|
PASS parseFloat(m.c) is 0
|
|
PASS parseFloat(m.d) is 1
|
|
PASS parseFloat(m.e) is 0
|
|
PASS parseFloat(m.f) is 0
|
|
|
|
Test skew in horizontal direction
|
|
PASS parseFloat(m2.a) is 1
|
|
PASS parseFloat(m2.b) is 0
|
|
PASS parseFloat(m2.c.toPrecision(6)) is 0.176327
|
|
PASS parseFloat(m2.d) is 1
|
|
PASS parseFloat(m2.e) is 0
|
|
PASS parseFloat(m2.f) is 0
|
|
|
|
Test immutability of horizontal skew
|
|
PASS parseFloat(m.a) is 1
|
|
PASS parseFloat(m.b) is 0
|
|
PASS parseFloat(m.c) is 0
|
|
PASS parseFloat(m.d) is 1
|
|
PASS parseFloat(m.e) is 0
|
|
PASS parseFloat(m.f) is 0
|
|
|
|
Test skew in vertical direction
|
|
PASS parseFloat(m2.a) is 1
|
|
PASS parseFloat(m2.b.toPrecision(6)) is 0.700208
|
|
PASS parseFloat(m2.c) is 0
|
|
PASS parseFloat(m2.d) is 1
|
|
PASS parseFloat(m2.e) is 0
|
|
PASS parseFloat(m2.f) is 0
|
|
|
|
Test immutability of vertical skew
|
|
PASS parseFloat(m.a) is 1
|
|
PASS parseFloat(m.b) is 0
|
|
PASS parseFloat(m.c) is 0
|
|
PASS parseFloat(m.d) is 1
|
|
PASS parseFloat(m.e) is 0
|
|
PASS parseFloat(m.f) is 0
|
|
|
|
Test multiply
|
|
PASS parseFloat(m3.a) is 31
|
|
PASS parseFloat(m3.b) is 46
|
|
PASS parseFloat(m3.c) is 39
|
|
PASS parseFloat(m3.d) is 58
|
|
PASS parseFloat(m3.e) is 52
|
|
PASS parseFloat(m3.f) is 76
|
|
|
|
Test that multiply works in the right direction
|
|
PASS m.a is 2
|
|
PASS m.b is 0
|
|
PASS m.c is 0
|
|
PASS m.d is 1
|
|
PASS m.e is 100
|
|
PASS m.f is 0
|
|
|
|
Test immutability of multiply
|
|
PASS tx.a is 1
|
|
PASS tx.b is 0
|
|
PASS tx.c is 0
|
|
PASS tx.d is 1
|
|
PASS tx.e is 100
|
|
PASS tx.f is 0
|
|
PASS sx.a is 2
|
|
PASS sx.b is 0
|
|
PASS sx.c is 0
|
|
PASS sx.d is 1
|
|
PASS sx.e is 0
|
|
PASS sx.f is 0
|
|
|
|
Test multiply with missing argument
|
|
PASS m2.a is 1
|
|
PASS m2.b is 2
|
|
PASS m2.c is 3
|
|
PASS m2.d is 4
|
|
PASS m2.e is 5
|
|
PASS m2.f is 6
|
|
|
|
Test inverse
|
|
PASS parseFloat(m2.a) is 0.5
|
|
PASS parseFloat(m2.b) is 0
|
|
PASS parseFloat(m2.c) is 0
|
|
PASS parseFloat(m2.d) is 0.5
|
|
PASS parseFloat(m2.e) is -5
|
|
PASS parseFloat(m2.f) is -10
|
|
|
|
Test immutability of inverse
|
|
PASS parseFloat(m.a) is 2
|
|
PASS parseFloat(m.b) is 0
|
|
PASS parseFloat(m.c) is 0
|
|
PASS parseFloat(m.d) is 2
|
|
PASS parseFloat(m.e) is 10
|
|
PASS parseFloat(m.f) is 20
|
|
|
|
Test throwing exception from inverse
|
|
PASS m2.a is NaN
|
|
PASS m2.b is NaN
|
|
PASS m2.c is NaN
|
|
PASS m2.d is NaN
|
|
PASS m2.e is NaN
|
|
PASS m2.f is NaN
|
|
|
|
Test immutability of inverse
|
|
PASS m.a is 0
|
|
PASS m.b is 0
|
|
PASS m.c is 0
|
|
PASS m.d is 0
|
|
PASS m.e is 0
|
|
PASS m.f is 0
|
|
|
|
PASS successfullyParsed is true
|
|
|
|
TEST COMPLETE
|
|
|