Bug 1776680 [wpt PR 34603] - [@container] Test invalidation of font-relative units...
[gecko.git] / dom / events / test / test_bug1332699.html
blobc2a858d8ad08d793352cdb343f914ddf2c849e69
1 <!DOCTYPE html>
2 <meta charset="utf-8">
3 <title>Test for bug 1332699</title>
4 <script src="/tests/SimpleTest/SimpleTest.js"></script>
5 <script src="/tests/SimpleTest/EventUtils.js"></script>
6 <link rel="stylesheet" href="/tests/SimpleTest/test.css">
7 <style>
8 #test {
9 color: red;
10 transition: color 100ms;
12 #test.changed {
13 color: green;
15 </style>
16 <div id="test"></div>
17 <script>
18 SimpleTest.waitForExplicitFinish();
20 window.onload = function () {
21 let $test = document.getElementById('test');
22 is(getComputedStyle($test).color, 'rgb(255, 0, 0)',
23 'color should be red before transition');
24 let numEvents = 0;
25 $test.addEventListener('webkitTransitionEnd', function() {
26 ++numEvents;
27 if (numEvents == 1) {
28 is(getComputedStyle($test).color, 'rgb(0, 128, 0)',
29 'color should be green after transition');
30 $test.dispatchEvent(new TransitionEvent('transitionend'));
31 is(numEvents, 1, "Shouldn't receive the prefixed event again");
32 SimpleTest.finish();
34 });
35 $test.className = 'changed';
37 </script>