3 <script src=
"../../resources/js-test.js"></script>
12 -webkit-transition: width
1ms;
13 transition: width
1ms;
16 #before.transition:before,
17 #after.transition:after {
24 display: inline-block;
25 border:
1px solid black;
35 <div id=
"before"></div>
36 <div id=
"after"></div>
39 description('Transitions on :before and :after pseudo elements should run and fire DOM events');
41 if (window
.testRunner
) {
42 testRunner
.dumpAsText();
43 testRunner
.waitUntilDone();
46 var expectedEvents
= [ ["width", "before", "::before"] , ["width", "after", "::after"] ];
49 function recordTransitionEvent()
51 shouldBe("event.propertyName", "expectedEvents[currentEvent][0]");
52 shouldBe("event.target.id", "expectedEvents[currentEvent][1]");
53 shouldBe("event.pseudoElement", "expectedEvents[currentEvent][2]");
54 if (currentEvent
== 1) {
55 isSuccessfullyParsed();
56 if (window
.testRunner
)
57 testRunner
.notifyDone();
60 testTransition('after');
64 function testTransition(id
)
66 var div
= document
.getElementById(id
);
67 div
.className
= 'transition';
71 document
.addEventListener( 'transitionend', recordTransitionEvent
);
72 testTransition('before');