Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / transforms / 2d / compound-2d-transforms.html
blob9e088e3e20772199540dc32f292b3093814b9388
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
4 <html lang="en">
5 <head>
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">
9 .container {
10 height: 100px;
11 width: 200px;
12 margin: 30px;
13 outline: 1px solid black;
15 .box {
16 height: 100%;
17 width: 100%;
18 background-color: green;
19 transform: rotate(90deg);
21 #results {
22 margin-top: 100px;
24 </style>
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();
32 var gTests = [
33 // zero functions
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)' },
44 // two functions
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)' },
48 // three functions
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)' },
54 // lots of functions
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
69 function runTests()
71 testTransforms();
73 if (window.testRunner)
74 testRunner.notifyDone();
76 </script>
77 </head>
78 <body onload="runTests()">
80 <div class="container">
81 <div id="test-box" class="box"></div>
82 </div>
84 <div id="results">
85 </div>
86 </body>
87 </html>