layout/base/tests/test_bug435293-scale.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial