2008-11-20 Simon Fraser <simon.fraser@apple.com>
[WebKit-https.git] / LayoutTests / transforms / computed-style-origin.html
1 <html>
2 <head>
3 <link rel="stylesheet" href="../fast/js/resources/js-test-style.css">
4 <style type="text/css" media="screen">
5     #test1 {
6         width: 20px;
7         height: 20px;
8         background-color: blue;
9         position: relative;
10         -webkit-transform: translate(0);
11         // default transform origin
12     }
13     #test2 {
14         width: 20px;
15         height: 20px;
16         background-color: blue;
17         position: relative;
18         -webkit-transform: translate(0);
19         -webkit-transform-origin: 50% 50%;
20     }
21     #test3 {
22         width: 20px;
23         height: 20px;
24         background-color: blue;
25         position: relative;
26         -webkit-transform: translate(0);
27         -webkit-transform-origin: 0% 100%;
28     }
29     #test4 {
30         width: 20px;
31         height: 20px;
32         background-color: blue;
33         position: relative;
34         -webkit-transform: translate(0);
35         -webkit-transform-origin: 5px 7px;
36     }
37 </style>
38 <script src="../fast/js/resources/js-test-pre.js"></script>
39 </head>
40 <body>
41 <p id="test1"></p>
42 <p id="test2"></p>
43 <p id="test3"></p>
44 <p id="test4"></p>
45 <p id="description"></p>
46 <div id="console"></div>
47 <script>
48
49 description("This tests computed style values for transform origin.");
50
51 var test1 = document.getElementById("test1");
52 var test2 = document.getElementById("test2");
53 var test3 = document.getElementById("test3");
54 var test4 = document.getElementById("test4");
55
56 var test1Style = window.getComputedStyle(test1);
57 var test2Style = window.getComputedStyle(test2);
58 var test3Style = window.getComputedStyle(test3);
59 var test4Style = window.getComputedStyle(test4);
60
61 shouldBe("test1Style.webkitTransformOrigin", "'10px 10px'");
62 shouldBe("test2Style.webkitTransformOrigin", "'10px 10px'");
63 shouldBe("test3Style.webkitTransformOrigin", "'0px 20px'");
64 shouldBe("test4Style.webkitTransformOrigin", "'5px 7px'");
65
66 debug("");
67 successfullyParsed = true;
68
69 </script>
70 <script src="../fast/js/resources/js-test-post.js"></script>
71 </body>
72 </html>