layout/base/tests/test_bug435293-scale.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/base/tests/test_bug435293-scale.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,103 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=435293
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 435293</title>
    1.11 +  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.12 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    1.13 +
    1.14 +  <style>
    1.15 +    .test {
    1.16 +      background: green;
    1.17 +      height: 100px;
    1.18 +      width: 100px;
    1.19 +    }
    1.20 +    #test1 {
    1.21 +      -moz-transform: scalex(0.5);
    1.22 +    }
    1.23 +    #test2 {
    1.24 +      -moz-transform: scaley(0.5);
    1.25 +    }
    1.26 +    #test3 {
    1.27 +      -moz-transform: scale(0.5, 0.5);
    1.28 +    }
    1.29 +    #test4 {
    1.30 +      -moz-transform: scale(0.5, 0.5, 0.5);
    1.31 +    }
    1.32 +    #test5 {
    1.33 +      -moz-transform: scale(80%, none);
    1.34 +    }
    1.35 +    #test6 {
    1.36 +      -moz-transform: scale(640000, 0.0000000000000000001);
    1.37 +    }
    1.38 +    #test7 {
    1.39 +      -moz-transform: scale(2em, 4px);
    1.40 +    }
    1.41 +  </style>
    1.42 +</head>
    1.43 +<body>
    1.44 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=435293">Mozilla Bug 435293</a>
    1.45 +<p id="display"></p>
    1.46 +<div id="content">
    1.47 +  <div id="test1" class="test">
    1.48 +    test
    1.49 +  </div>
    1.50 +  <p id="test2" class="test">
    1.51 +    test
    1.52 +  </p>
    1.53 +  <div id="test3" class="test">
    1.54 +    test
    1.55 +  </div>
    1.56 +  <div id="test4" class="test">
    1.57 +    test
    1.58 +  </div>
    1.59 +  <div id="test5" class="test">
    1.60 +    test
    1.61 +  </div>
    1.62 +  <div id="test6" class="test">
    1.63 +    test
    1.64 +  </div>
    1.65 +  <div id="test7" class="test">
    1.66 +    test
    1.67 +  </div>
    1.68 +</div>
    1.69 +
    1.70 +<pre id="test">
    1.71 +<script type="application/javascript">
    1.72 +runtests();
    1.73 +
    1.74 +function runtests() {
    1.75 +  var style = window.getComputedStyle(document.getElementById("test1"), "");
    1.76 +  is(style.getPropertyValue("-moz-transform"), "matrix(0.5, 0, 0, 1, 0, 0)",
    1.77 +     "Scalex proper matrix is applied");
    1.78 +
    1.79 +  style = window.getComputedStyle(document.getElementById("test2"), "");
    1.80 +  is(style.getPropertyValue("-moz-transform"), "matrix(1, 0, 0, 0.5, 0, 0)",
    1.81 +     "Scaley proper matrix is applied");
    1.82 +
    1.83 +  style = window.getComputedStyle(document.getElementById("test3"), "");
    1.84 +  is(style.getPropertyValue("-moz-transform"), "matrix(0.5, 0, 0, 0.5, 0, 0)",
    1.85 +     "Scale proper matrix is applied");
    1.86 +
    1.87 +  style = window.getComputedStyle(document.getElementById("test4"), "");
    1.88 +  is(style.getPropertyValue("-moz-transform"), "none",
    1.89 +     "Three dimensional scale should be ignored");
    1.90 +
    1.91 +  style = window.getComputedStyle(document.getElementById("test5"), "");
    1.92 +  is(style.getPropertyValue("-moz-transform"), "none",
    1.93 +     "Percent values in scale should be ignored");
    1.94 +
    1.95 +  style = window.getComputedStyle(document.getElementById("test6"), "");
    1.96 +  is(style.getPropertyValue("-moz-transform"), "matrix(640000, 0, 0, 1e-19, 0, 0)",
    1.97 +     "Ensure wacky values are accepted");
    1.98 +
    1.99 +  style = window.getComputedStyle(document.getElementById("test7"), "");
   1.100 +  is(style.getPropertyValue("-moz-transform"), "none",
   1.101 +     "No unit values allowed in scale");
   1.102 +}
   1.103 +</script>
   1.104 +</pre>
   1.105 +</body>
   1.106 +</html>

mercurial