mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-01 14:45:29 +00:00
161 lines
4.8 KiB
HTML
161 lines
4.8 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<!--
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=435293
|
|
-->
|
|
<head>
|
|
<title>Test for Bug 435293</title>
|
|
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
|
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
|
|
|
<style>
|
|
.test {
|
|
background: green;
|
|
height: 100px;
|
|
width: 100px;
|
|
}
|
|
#test1 {
|
|
-moz-transform: skewx(30deg);
|
|
}
|
|
#test2 {
|
|
-moz-transform: skewy(60deg);
|
|
}
|
|
#test3 {
|
|
-moz-transform: skew(45deg, 45deg);
|
|
}
|
|
/* We will set test 4 and 5 from JS in order to use exact values.
|
|
For clarity, their style is as follows:
|
|
#test4 {
|
|
-moz-transform: skew(2(PI)rad, 45deg);
|
|
}
|
|
#test5 {
|
|
-moz-transform: skew(PI/4rad, 150grad);
|
|
}*/
|
|
#test6 {
|
|
-moz-transform: skew(80%, 78px);
|
|
}
|
|
#test7 {
|
|
-moz-transform: skew(2em, 40ex);
|
|
}
|
|
#test8 {
|
|
-moz-transform: skew(-45deg, -465deg);
|
|
}
|
|
#test9 {
|
|
-moz-transform: skew(30deg, 30deg, 30deg);
|
|
}
|
|
#test10 {
|
|
display:none;
|
|
-moz-transform: skew(50grad, 89.99999999999999deg);
|
|
}
|
|
/* For test 11, we style it in JS to obtain exact values. For clarity, the
|
|
rule that will be created is below.
|
|
#test11 {
|
|
-moz-transform: skew(300grad, (PI/2)rad);
|
|
}*/
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=435293">Mozilla Bug 435293</a>
|
|
<p id="display"></p>
|
|
<div id="content">
|
|
<div id="test1" class="test">
|
|
test
|
|
</div>
|
|
<p id="test2" class="test">
|
|
test
|
|
</p>
|
|
<div id="test3" class="test">
|
|
test
|
|
</div>
|
|
<div id="test4" class="test">
|
|
test
|
|
</div>
|
|
<div id="test5" class="test">
|
|
test
|
|
</div>
|
|
<div id="test6" class="test">
|
|
test
|
|
</div>
|
|
<div id="test7" class="test">
|
|
test
|
|
</div>
|
|
<div id="test8" class="test">
|
|
test
|
|
</div>
|
|
<div id="test9" class="test">
|
|
test
|
|
</div>
|
|
<div id="test10" class="test">
|
|
test
|
|
</div>
|
|
<div id="test11" class="test">
|
|
test
|
|
</div>
|
|
</div>
|
|
|
|
<pre id="test">
|
|
<script type="application/javascript">
|
|
runtests();
|
|
|
|
function runtests() {
|
|
// Set the style rules for test 4, 5, and 11 using Math.pi instead of
|
|
// approximations
|
|
var e = document.getElementById("test4");
|
|
e.setAttribute("style", "-moz-transform: skew(" + Math.PI * 2 + "rad, 45deg);");
|
|
|
|
e = document.getElementById("test5");
|
|
e.setAttribute("style", "-moz-transform: skew(" + Math.PI/4 + "rad, 150grad);");
|
|
|
|
e = document.getElementById("test11");
|
|
e.setAttribute("style", "-moz-transform: skew(300grad, " + Math.PI/2 + "rad");
|
|
|
|
var style = window.getComputedStyle(document.getElementById("test1"), "");
|
|
is(style.getPropertyValue("-moz-transform"), "matrix(1, 0, 0.57735, 1, 0px, 0px)",
|
|
"Test1: Skewx proper matrix is applied");
|
|
|
|
style = window.getComputedStyle(document.getElementById("test2"), "");
|
|
is(style.getPropertyValue("-moz-transform"), "matrix(1, 1.73205, 0, 1, 0px, 0px)",
|
|
"Test2: Skewy proper matrix is applied");
|
|
|
|
style = window.getComputedStyle(document.getElementById("test3"), "");
|
|
is(style.getPropertyValue("-moz-transform"), "matrix(1, 1, 1, 1, 0px, 0px)",
|
|
"Test3: Skew proper matrix is applied");
|
|
|
|
style = window.getComputedStyle(document.getElementById("test4"), "");
|
|
is(style.getPropertyValue("-moz-transform"), "matrix(1, 1, 0, 1, 0px, 0px)",
|
|
"Test4: Skew mixing deg and rad");
|
|
|
|
style = window.getComputedStyle(document.getElementById("test5"), "");
|
|
is(style.getPropertyValue("-moz-transform"), "matrix(1, -1, 1, 1, 0px, 0px)",
|
|
"Test5: Skew mixing rad and grad");
|
|
|
|
style = window.getComputedStyle(document.getElementById("test6"), "");
|
|
is(style.getPropertyValue("-moz-transform"), "none",
|
|
"Test6: Skew with invalid units");
|
|
|
|
style = window.getComputedStyle(document.getElementById("test7"), "");
|
|
is(style.getPropertyValue("-moz-transform"), "none",
|
|
"Test7: Skew with more invalid units");
|
|
|
|
style = window.getComputedStyle(document.getElementById("test8"), "");
|
|
is(style.getPropertyValue("-moz-transform"), "matrix(1, 3.73206, -1, 1, 0px, 0px)",
|
|
"Test8: Skew with negative degrees");
|
|
|
|
style = window.getComputedStyle(document.getElementById("test9"), "");
|
|
is(style.getPropertyValue("-moz-transform"), "none",
|
|
"Test9: Skew in 3d should be ignored");
|
|
|
|
style = window.getComputedStyle(document.getElementById("test10"), "");
|
|
is(style.getPropertyValue("-moz-transform"), "matrix(1, -10000, 1, 1, 0px, 0px)",
|
|
"Test10: Skew with nearly infinite numbers");
|
|
|
|
style = window.getComputedStyle(document.getElementById("test11"), "");
|
|
is(style.getPropertyValue("-moz-transform"), "matrix(1, -10000, 10000, 1, 0px, 0px)",
|
|
"Test11: Skew with more infinite numbers");
|
|
}
|
|
</script>
|
|
</pre>
|
|
</body>
|
|
</html>
|