layout/style/test/test_transitions_dynamic_changes.html

Wed, 31 Dec 2014 07:16:47 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:16:47 +0100
branch
TOR_BUG_9701
changeset 3
141e0f1194b1
permissions
-rw-r--r--

Revert simplistic fix pending revisit of Mozilla integration attempt.

michael@0 1 <!DOCTYPE HTML>
michael@0 2 <html>
michael@0 3 <!--
michael@0 4 https://bugzilla.mozilla.org/show_bug.cgi?id=525530
michael@0 5 -->
michael@0 6 <head>
michael@0 7 <title>Test for Bug 525530</title>
michael@0 8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
michael@0 9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
michael@0 10 </head>
michael@0 11 <body>
michael@0 12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=525530">Mozilla Bug 525530</a>
michael@0 13 <p id="display" style="text-indent: 100px"></p>
michael@0 14 <pre id="test">
michael@0 15 <script type="application/javascript">
michael@0 16
michael@0 17 /** Test for Bug 525530 **/
michael@0 18
michael@0 19 var p = document.getElementById("display");
michael@0 20 var cs = getComputedStyle(p, "");
michael@0 21
michael@0 22 p.style.transitionProperty = "all";
michael@0 23 p.style.transitionDuration = "4s";
michael@0 24 p.style.transitionDelay = "-2s";
michael@0 25 p.style.transitionTimingFunction = "linear";
michael@0 26
michael@0 27 is(cs.textIndent, "100px", "initial value");
michael@0 28
michael@0 29 p.style.textIndent = "0";
michael@0 30 is(cs.textIndent, "50px", "transition is halfway");
michael@0 31 p.style.transitionDuration = "0s";
michael@0 32 is(cs.textIndent, "50px", "changing duration doesn't change transitioning");
michael@0 33 p.style.transitionDelay = "0s";
michael@0 34 is(cs.textIndent, "50px", "changing delay doesn't change transitioning");
michael@0 35 p.style.transitionProperty = "text-indent";
michael@0 36 is(cs.textIndent, "50px",
michael@0 37 "irrelevant change to transition property doesn't change transitioning");
michael@0 38 p.style.transitionProperty = "font";
michael@0 39 is(cs.textIndent, "0px",
michael@0 40 "relevant change to transition property does change transitioning");
michael@0 41
michael@0 42 /** Test for Bug 522643 */
michael@0 43 p.style.transitionDuration = "4s";
michael@0 44 p.style.transitionDelay = "-2s";
michael@0 45 p.style.transitionProperty = "text-indent";
michael@0 46 p.style.textIndent = "100px";
michael@0 47 is(cs.textIndent, "50px", "transition is halfway");
michael@0 48 p.style.transitionDuration = "0s";
michael@0 49 p.style.transitionDelay = "0s";
michael@0 50 is(cs.textIndent, "50px",
michael@0 51 "changing duration and delay doesn't change transitioning");
michael@0 52 p.style.textIndent = "0px";
michael@0 53 is(cs.textIndent, "0px",
michael@0 54 "changing property after changing duration and delay stops transition");
michael@0 55
michael@0 56 </script>
michael@0 57 </pre>
michael@0 58 </body>
michael@0 59 </html>

mercurial