1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
6 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
7 <title>Compound
2D Transforms
</title>
8 <style type=
"text/css" media=
"screen">
13 outline:
1px solid black;
18 background-color: green;
19 transform: rotate(
90deg);
25 <script src=
"resources/transform-test-utils.js" type=
"text/javascript" charset=
"utf-8"></script>
26 <script type=
"text/javascript" charset=
"utf-8">
27 if (window.testRunner) {
28 testRunner.dumpAsText();
29 testRunner.waitUntilDone();
34 { 'transform' : 'none', 'result' : 'none' },
35 { 'transform' : '', 'result' : 'matrix(
5.96046e-08,
1, -
1,
5.96046e-08,
0,
0)' }, // revert back to box
37 // one function - see non-compound test for tougher examples
38 { 'transform' : 'translate(
50px,
20px)', 'result' : 'matrix(
1,
0,
0,
1,
50,
20)' },
39 { 'transform' : 'rotate(
12deg)', 'result' : 'matrix(
0.978148,
0.207912, -
0.207912,
0.978148,
0,
0)' },
40 { 'transform' : 'scale(
1.7)', 'result' : 'matrix(
1.7,
0,
0,
1.7,
0,
0)' },
41 { 'transform' : 'skew(
12deg)', 'result' : 'matrix(
1,
0,
0.212557,
1,
0,
0)' },
42 { 'transform' : 'matrix(
0.978148,
0.207912, -
0.207912,
0.978148,
50,
20)', 'result' : 'matrix(
0.978148,
0.207912, -
0.207912,
0.978148,
50,
20)' },
45 { 'transform' : 'translate(
50px,
20px) rotate(
12deg)', 'result' : 'matrix(
0.978148,
0.207912, -
0.207912,
0.978148,
50,
20)' },
46 { 'transform' : 'rotate(
12deg) translate(
50px,
20px)', 'result' : 'matrix(
0.978148,
0.207912, -
0.207912,
0.978148,
44.7491,
29.9585)' },
49 { 'transform' : 'rotate(
12deg) translate(
50px,
20px) scale(
1.4)', 'result' : 'matrix(
1.36941,
0.291076, -
0.291076,
1.36941,
44.7491,
29.9585)' },
50 { 'transform' : 'scale(
1.4) rotate(
12deg) translate(
50px,
20px) ', 'result' : 'matrix(
1.36941,
0.291076, -
0.291076,
1.36941,
62.6488,
41.942)' },
51 { 'transform' : 'scale(
1.4) translate(
50px,
20px) rotate(
12deg)', 'result' : 'matrix(
1.36941,
0.291076, -
0.291076,
1.36941,
70,
28)' },
52 { 'transform' : 'translate(
50px,
20px) rotate(
12deg) translateY(
50px) scale(
1.4)', 'result' : 'matrix(
1.36941,
0.291076, -
0.291076,
1.36941,
39.6044,
68.9074)' },
55 { 'transform' : 'rotate(
12deg) translate(
50px,
20px) scale(
1.4) translate(-
80px,
40px) skew(
34deg) translate(
10px,
10px) scale(
0.7) skewY(-
25deg) rotate(
21deg) translateX(
50px) scale(
1.4,
1.8)',
56 'result' : 'matrix(
1.20517,
0.148207,
0.258987,
2.04004, -
13.3847,
85.31)' },
58 // invalid compound functions
59 { 'transform' : ',rotate(
12deg) translate(
50px,
20px)', 'result' : 'none' }, // has comma
60 { 'transform' : 'rotate(
12deg), translate(
50px,
20px)', 'result' : 'none' }, // has comma
61 { 'transform' : 'rotate(
12deg) + translate(
50px,
20px)', 'result' : 'none' }, // has plus
62 { 'transform' : 'rotate(
12deg) translate(
50,
20)', 'result' : 'none' }, // missing units
63 { 'transform' : '(rotate(
12deg) translate(
50px,
20px))', 'result' : 'none' }, // bad syntax
64 { 'transform' : 'rotate(
12deg) translate(
50px,
20px) eggs(
10)', 'result' : 'none' }, // invalid function
65 { 'transform' : 'rotate(
12deg) matrix(
0.978148,
0.207912, -
0.207912,
0.978148,
50,
20,
666)', 'result' : 'none' }, // too many arguments
73 if (window.testRunner)
74 testRunner.notifyDone();
78 <body onload=
"runTests()">
80 <div class=
"container">
81 <div id=
"test-box" class=
"box"></div>