layout/style/test/test_transitions_dynamic_changes.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/style/test/test_transitions_dynamic_changes.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,59 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=525530
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 525530</title>
    1.11 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.12 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.13 +</head>
    1.14 +<body>
    1.15 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=525530">Mozilla Bug 525530</a>
    1.16 +<p id="display" style="text-indent: 100px"></p>
    1.17 +<pre id="test">
    1.18 +<script type="application/javascript">
    1.19 +
    1.20 +/** Test for Bug 525530 **/
    1.21 +
    1.22 +var p = document.getElementById("display");
    1.23 +var cs = getComputedStyle(p, "");
    1.24 +
    1.25 +p.style.transitionProperty = "all";
    1.26 +p.style.transitionDuration = "4s";
    1.27 +p.style.transitionDelay = "-2s";
    1.28 +p.style.transitionTimingFunction = "linear";
    1.29 +
    1.30 +is(cs.textIndent, "100px", "initial value");
    1.31 +
    1.32 +p.style.textIndent = "0";
    1.33 +is(cs.textIndent, "50px", "transition is halfway");
    1.34 +p.style.transitionDuration = "0s";
    1.35 +is(cs.textIndent, "50px", "changing duration doesn't change transitioning");
    1.36 +p.style.transitionDelay = "0s";
    1.37 +is(cs.textIndent, "50px", "changing delay doesn't change transitioning");
    1.38 +p.style.transitionProperty = "text-indent";
    1.39 +is(cs.textIndent, "50px",
    1.40 +   "irrelevant change to transition property doesn't change transitioning");
    1.41 +p.style.transitionProperty = "font";
    1.42 +is(cs.textIndent, "0px",
    1.43 +   "relevant change to transition property does change transitioning");
    1.44 +
    1.45 +/** Test for Bug 522643 */
    1.46 +p.style.transitionDuration = "4s";
    1.47 +p.style.transitionDelay = "-2s";
    1.48 +p.style.transitionProperty = "text-indent";
    1.49 +p.style.textIndent = "100px";
    1.50 +is(cs.textIndent, "50px", "transition is halfway");
    1.51 +p.style.transitionDuration = "0s";
    1.52 +p.style.transitionDelay = "0s";
    1.53 +is(cs.textIndent, "50px",
    1.54 +   "changing duration and delay doesn't change transitioning");
    1.55 +p.style.textIndent = "0px";
    1.56 +is(cs.textIndent, "0px",
    1.57 +   "changing property after changing duration and delay stops transition");
    1.58 +
    1.59 +</script>
    1.60 +</pre>
    1.61 +</body>
    1.62 +</html>

mercurial