no bug - Import translations from android-l10n r=release a=l10n CLOSED TREE
[gecko.git] / layout / base / tests / test_bug435293-scale.html
blob70571a01b7dfd4f986c58b52a33a37bb022db776
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=435293
5 -->
6 <head>
7 <title>Test for Bug 435293</title>
8 <script src="/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
11 <style>
12 .test {
13 background: green;
14 height: 100px;
15 width: 100px;
17 #test1 {
18 transform: scalex(0.5);
20 #test2 {
21 transform: scaley(0.5);
23 #test3 {
24 transform: scale(0.5, 0.5);
26 #test4 {
27 transform: scale(0.5, 0.5, 0.5);
29 #test5 {
30 transform: scale(80%, none);
32 #test6 {
33 transform: scale(640000, 0.0000000000000000001);
35 #test7 {
36 transform: scale(2em, 4px);
38 </style>
39 </head>
40 <body>
41 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=435293">Mozilla Bug 435293</a>
42 <p id="display"></p>
43 <div id="content">
44 <div id="test1" class="test">
45 test
46 </div>
47 <p id="test2" class="test">
48 test
49 </p>
50 <div id="test3" class="test">
51 test
52 </div>
53 <div id="test4" class="test">
54 test
55 </div>
56 <div id="test5" class="test">
57 test
58 </div>
59 <div id="test6" class="test">
60 test
61 </div>
62 <div id="test7" class="test">
63 test
64 </div>
65 </div>
67 <pre id="test">
68 <script type="application/javascript">
69 runtests();
71 function runtests() {
72 var style = window.getComputedStyle(document.getElementById("test1"));
73 is(style.getPropertyValue("transform"), "matrix(0.5, 0, 0, 1, 0, 0)",
74 "Scalex proper matrix is applied");
76 style = window.getComputedStyle(document.getElementById("test2"));
77 is(style.getPropertyValue("transform"), "matrix(1, 0, 0, 0.5, 0, 0)",
78 "Scaley proper matrix is applied");
80 style = window.getComputedStyle(document.getElementById("test3"));
81 is(style.getPropertyValue("transform"), "matrix(0.5, 0, 0, 0.5, 0, 0)",
82 "Scale proper matrix is applied");
84 style = window.getComputedStyle(document.getElementById("test4"));
85 is(style.getPropertyValue("transform"), "none",
86 "Three dimensional scale should be ignored");
88 style = window.getComputedStyle(document.getElementById("test5"));
89 is(style.getPropertyValue("transform"), "none",
90 "Percent values in scale should be ignored");
92 style = window.getComputedStyle(document.getElementById("test6"));
93 is(style.getPropertyValue("transform"), "matrix(640000, 0, 0, 1e-19, 0, 0)",
94 "Ensure wacky values are accepted");
96 style = window.getComputedStyle(document.getElementById("test7"));
97 is(style.getPropertyValue("transform"), "none",
98 "No unit values allowed in scale");
100 </script>
101 </pre>
102 </body>
103 </html>