layout/style/test/test_transitions_bug537151.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/style/test/test_transitions_bug537151.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,50 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=537151
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 537151</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 +  <style type="text/css">
    1.14 +
    1.15 +  #display {
    1.16 +    transition: margin-left 200ms;
    1.17 +  }
    1.18 +
    1.19 +  </style>
    1.20 +</head>
    1.21 +<body>
    1.22 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=537151">Mozilla Bug 537151</a>
    1.23 +<p id="display">Paragraph</p>
    1.24 +<pre id="test">
    1.25 +<script type="application/javascript">
    1.26 +
    1.27 +/** Test for Bug 537151 **/
    1.28 +
    1.29 +SimpleTest.waitForExplicitFinish();
    1.30 +
    1.31 +var p = document.getElementById("display");
    1.32 +p.addEventListener("transitionend", listener, false);
    1.33 +var ignored = getComputedStyle(p, "").marginLeft;
    1.34 +p.style.marginLeft = "150px";
    1.35 +
    1.36 +var event_count = 0;
    1.37 +function listener(event)
    1.38 +{
    1.39 +  ++event_count;
    1.40 +  setTimeout(finish, 400);
    1.41 +  p.style.color = "blue";
    1.42 +}
    1.43 +
    1.44 +function finish()
    1.45 +{
    1.46 +  is(event_count, 1, "should have gotten only 1 transitionend event");
    1.47 +  SimpleTest.finish();
    1.48 +}
    1.49 +
    1.50 +</script>
    1.51 +</pre>
    1.52 +</body>
    1.53 +</html>

mercurial