Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / web-animations-api / player-finish-event.html
blobacb20712b89cad3a3294f9b5ec194f69691c5005
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <style type="text/css">
5 .anim {
6 position: absolute;
7 left: 10px;
8 height: 90px;
9 width: 100px;
10 background-color: black;
12 </style>
13 <script type="text/javascript">
15 function log(message) {
16 var results = document.getElementById('results');
17 results.innerHTML += message + '<br>';
20 function validateFinishEvent(player, event) {
21 if (event.target === player) {
22 log('PASS: ' + player.name + ' is target');
23 } else {
24 log('FAIL: expected target named ' + player.name + ', actual target is ' + event.target);
26 if (event.currentTime === player.currentTime) {
27 log('PASS: event currentTime equals player currentTime');
28 } else {
29 log('FAIL: event currentTime ' + event.currentTime + ' does not equal player currentTime ' + player.currentTime);
31 if (event.timelineTime === document.timeline.currentTime) {
32 log('PASS: event timelineTime equals timeline currentTime');
33 } else {
34 log('FAIL: event timelineTime ' + event.timelineTime +
35 ' does not equal timeline currentTime ' + document.timeline.currentTime);
39 var playerTop, playerMiddle, playerBottom;
41 function onFinishTop(event) {
42 validateFinishEvent(playerTop, event);
43 if (window.testRunner) {
44 testRunner.notifyDone();
48 function onFinishMiddle(event) {
49 validateFinishEvent(playerMiddle, event);
52 function onFinishBottom(event) {
53 validateFinishEvent(playerBottom, event);
56 function animate() {
58 var keyframes = [
59 {left: '10px', opacity: '1', offset: 0},
60 {left: '100px', opacity: '0', offset: 1}
63 playerTop = document.getElementById('top').animate(keyframes, 600);
64 playerTop.name = 'playerTop';
65 playerTop.onfinish = onFinishTop;
67 playerMiddle = document.getElementById('middle').animate(keyframes, 100);
68 playerMiddle.name = 'playerMiddle';
69 playerMiddle.onfinish = onFinishMiddle;
71 playerBottom = document.getElementById('bottom').animate(keyframes, 100);
72 playerBottom.name = 'playerBottom';
73 playerBottom.onfinish = onFinishBottom;
75 if (window.testRunner) {
76 testRunner.dumpAsText();
77 testRunner.waitUntilDone();
81 window.onload = animate;
83 </script>
84 </head>
85 <body>
86 <div class="anim" id="top"></div>
87 <div class="anim" id="middle"></div>
88 <div class="anim" id="bottom"></div>
89 <div id="results"></div>
90 </body>
91 </html>