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>Changing transition values during transition should not affect it
</title>
8 <style type=
"text/css" media=
"screen">
12 background-color: blue;
13 -webkit-transition-duration:
1s;
14 -webkit-transition-timing-function: linear;
15 -webkit-transition-property: -webkit-transform;
18 <script type=
"text/javascript" charset=
"utf-8">
19 if (window.layoutTestController) {
20 layoutTestController.dumpAsText();
21 layoutTestController.waitUntilDone();
25 const defaultTolerance =
10;
27 function isCloseEnough(actual, desired)
29 var diff = Math.abs(actual - desired);
30 return diff < defaultTolerance;
33 function changeValues()
35 var box = document.getElementById('box');
36 box.style.webkitTransitionDuration =
"0.1s";
39 function getXPosition()
41 var t = window.getComputedStyle(document.getElementById('box')).webkitTransform;
49 var xPos = getXPosition();
50 if (!isCloseEnough(xPos,
50))
51 result =
"FAIL(was:"+xPos+
", s/b:50)";
56 var xPos = getXPosition();
57 if (!isCloseEnough(xPos,
0))
58 result +=
"FAIL(was:"+xPos+
", s/b:0)";
60 document.getElementById('result').innerText = result;
61 if (window.layoutTestController)
62 layoutTestController.notifyDone();
67 var box = document.getElementById('box');
68 box.style.webkitTransform = 'translateX(
0)';
73 var box = document.getElementById('box');
74 setTimeout(
"changeValues()",
100);
75 setTimeout(
"check1()",
500);
76 setTimeout(
"check2()",
1300);
77 box.style.webkitTransform = 'translateX(
100px)';
80 window.addEventListener('load', start, false);
81 document.addEventListener('webkitTransitionEnd', goBack, false);
87 <p>Test changes -webkit-transition-duration while the transition is running to ensure that the running transition is not affected
</p>