1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
6 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
7 <title>Cancelled Transition Should Not Continue To Run
</title>
8 <style type=
"text/css" media=
"screen">
13 font-family: ArialRoundedMTBold, sans-serif;
19 background-color: #
933;
29 -webkit-transition-property: left;
30 -webkit-transition-duration:
0.5s;
31 -webkit-transition-timing-function: linear;
37 -webkit-transform: translate(
400px,
0px);
38 -webkit-transition-property: -webkit-transform;
39 -webkit-transition-duration:
0.5s;
40 -webkit-transition-timing-function: linear;
43 <script type=
"text/javascript" charset=
"utf-8">
44 if (window.layoutTestController) {
45 layoutTestController.dumpAsText();
46 layoutTestController.waitUntilDone();
49 result =
"<span style='color:red'>CHECK NOT COMPLETED</span>";
51 function isEqual(actual, desired, tolerance)
53 if (tolerance == undefined || tolerance ==
0)
54 tolerance = defaultTolerance;
55 var diff = Math.abs(actual - desired);
56 return diff < tolerance;
59 function cancelTransition()
61 document.getElementById(
"container").className =
"";
64 function restartTransition()
66 document.getElementById(
"container").className =
"run";
67 setTimeout(
"check()",
250);
72 var left = parseFloat(window.getComputedStyle(document.getElementById('a')).left);
74 if (!isEqual(left,
250,
30))
75 result +=
"<span style='color:red'>FAIL(was:" + left +
", s/b:150)</span>";
77 result +=
"<span style='color:green'>PASS</span>";
79 result +=
", webkitTransform:";
81 var transform = window.getComputedStyle(document.getElementById('b')).webkitTransform;
82 transform = transform.split(
"(");
83 transform = transform[
1].split(
",");
84 if (!isEqual(transform[
4],
200,
30))
85 result +=
"<span style='color:red'>FAIL(was:" + transform[
4] +
", s/b:50)</span>";
87 result +=
"<span style='color:green'>PASS</span>";
92 document.getElementById(
"container").className =
"run";
93 setTimeout(
"cancelTransition()",
100);
94 setTimeout(
"restartTransition()",
200);
96 window.setTimeout(function() {
97 document.getElementById('result').innerHTML = result;
98 if (window.layoutTestController)
99 layoutTestController.notifyDone();
104 <body onload=
"start()">
106 Test removes the transition properties while the transition is running, then adds them back in.
107 If working properly the transitions should start from the beginning. But there was a bug that
108 would cause the transition to continue to run (although with no visible effect). So when you
109 restarted, it would pick up where it left off.
112 <div id=
"a" class=
"tester">left
</div>
113 <div id=
"b" class=
"tester">translate
</div>