blob: 0702f19192f8f7bab17f3e4119eff0b33470a524 [file] [log] [blame]
.box {
position: relative;
left: 0;
height: 100px;
width: 100px;
margin: 10px;
background-color: blue;
transition-property: width, left, background-color, height, top;
transition-duration: 0.2s;
.box1 {
left: 50px;
.box2 {
background-color: red;
left: 100px;
<script src="transition-end-event-helpers.js"></script>
<script type="text/javascript">
var expectedEndEvents = [
// [property-name, element-id, elapsed-time, listen]
["left", "box1", 0.2, false],
function startTransition()
var box = document.getElementById("box1");
box.className = "box box2";
var firstTimeInHandleEndEvent = true;
function handleEndEvent(event)
recordTransitionEndEvent(event); = "none";
if (firstTimeInHandleEndEvent) {
firstTimeInHandleEndEvent = false;
window.setTimeout(startTransition, 100);
function setupTest()
var box = document.getElementById("box1");
box.addEventListener("transitionend", handleEndEvent, false);
box.className = "box box1";
// We need to pass an explicit maxTime because we use two sequential
// transitions that each take 0.2s.
runTransitionTest(expectedEndEvents, setupTest);
<p>Initiating transitions on various properties of all boxes.</p>
<div id="container">
<div id="box1" class="box"></div>
<div id="result"></div>