Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / transforms / 3d / general / matrix-with-zoom-3d.html
1 <html>
2 <head>
3 <style>
4 body {
5     zoom: 1.2;
6     padding: 0;
7     margin: 0;
8     -webkit-transform-style: perserve-3d;
9     -webkit-perspective: 1000px;
10 }
11
12 .box {
13     width: 100px;
14     height: 100px;
15     background-color: blue;
16     position: absolute;
17     top: 60px;
18     left: 40px;
19 }
20
21 .translate {
22     -webkit-transform: translate(100px, 50px);
23     background-color: red;
24 }
25
26 .matrix {
27     -webkit-transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 100, 50, 0, 1);
28     background-color: green;
29 }
30 </style>
31 <script type="text/javascript">
32
33 function runTest() {
34     if (!window.testRunner) {
35
36         var id1 = "a";
37         var id2 = "b";
38         var element1 = document.getElementById(id1);
39         var element2 = document.getElementById(id2);
40         var x1 = element1.getBoundingClientRect().left;
41         var y1 = element1.getBoundingClientRect().top;
42         var x2 = element2.getBoundingClientRect().left;
43         var y2 = element2.getBoundingClientRect().top;
44
45         var resultString = '';
46         if (x1 == x2 && y1 == y2) {
47             resultString += "PASS - Element " + id1 + " and Element " + id2 + " had identical positions";
48         } else {
49             resultString += "FAIL - Element " + id1 + " and Element " + id2 + " had different positions";
50         }
51
52         document.body.appendChild(document.createTextNode(resultString));
53     }
54 }
55 </script>
56 </head>
57 <body onload="runTest();">
58
59 <!-- You should see green box only. If you see red, the test has failed -->
60
61 <div id='a' class="box translate"></div>
62 <div id='b' class="box matrix"></div>
63
64 </body>
65 </html>