12 background-color: blue;
13 -webkit-transition-property: width;
14 -webkit-transition-duration:
0.5s;
17 <script src=
"transition-end-event-helpers.js"></script>
18 <script src=
"../resources/js-test.js"></script>
19 <script type=
"text/javascript">
20 function runAnimation() {
21 var box
= document
.getElementById('box1');
22 box
.style
.width
= '200px';
26 <body onLoad=
"runAnimation()">
27 <script type=
"text/javascript">
28 description("Test to make sure that if prefixed transition events are modified we correctly modify unprefixed events.");
30 if (window
.testRunner
)
31 testRunner
.waitUntilDone();
33 var testContainer
= document
.createElement("div");
34 document
.body
.appendChild(testContainer
);
36 testContainer
.innerHTML
= '<div id="box1" class="box"></div>';
37 var box
= document
.getElementById('box1');
39 var transitionEventContainer
;
40 var transitionEventBox
;
42 function innerTransitionEndEvent(e
)
44 transitionEventBox
= e
;
48 function outerTransitionEndEvent(e
)
50 transitionEventContainer
= e
;
51 shouldBe("transitionEventContainer.type", "transitionEventBox.type");
52 shouldBe("transitionEventContainer.bubbles", "transitionEventBox.bubbles");
53 shouldBe("transitionEventContainer.timeStamp", "transitionEventBox.timeStamp");
54 shouldBe("transitionEventContainer.cancelable", "transitionEventBox.cancelable");
55 shouldBe("transitionEventContainer.srcElement", "transitionEventBox.srcElement");
56 shouldBe("transitionEventContainer.cancelBubble", "transitionEventBox.cancelBubble");
57 shouldBe("transitionEventContainer.defaultPrevented", "transitionEventBox.defaultPrevented");
58 shouldBe("transitionEventContainer.target", "transitionEventBox.target");
59 shouldBe("transitionEventContainer.currentTarget", "testContainer");
60 // TransitionEnd event specific properties.
61 shouldBe("transitionEventContainer.pseudoElement", "transitionEventBox.pseudoElement");
62 shouldBe("transitionEventContainer.elapsedTime", "transitionEventBox.elapsedTime");
63 shouldBe("transitionEventContainer.propertyName", "transitionEventBox.propertyName");
64 if (window
.testRunner
)
65 testRunner
.notifyDone();
66 document
.body
.removeChild(testContainer
);
69 testContainer
.addEventListener('webkitTransitionEnd', outerTransitionEndEvent
, false);
70 box
.addEventListener('webkitTransitionEnd', innerTransitionEndEvent
, false);