Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / web-animations-api / w3c / out-of-order-keyframes.html
1 <!doctype html>
2 <title>Web Animations API: Out of order Keyframe tests</title>
3 <script src='../../resources/testharness.js'></script>
4 <script src='../../resources/testharnessreport.js'></script>
5 <div id='log'></div>
6 <div id='div'></div>
7 <script>
8
9 test(function() {
10   try {
11     div.animate([{height: '100px', offset: 0.5}, {height: '200px', offset: 0}, {height: '300px', offset: 1}], 1);
12   } catch (e) {
13     assert_unreached('Out-of-order properties should be sorted when possible');
14   }
15
16   assert_throws({name: 'InvalidModificationError'}, function() {
17     div.animate([{height: '100px', offset: 0.5}, {height: '150px'},
18                  {height: '200px', offset: 0}, {height: '300px', offset: 1}], 1);
19   }, 'Auto offsets combined with out-of-order properties should not work');
20 },
21 'Out-of-order Keyframe tests',
22 {
23   help:   'http://dev.w3.org/fxtf/web-animations/#normalizing-a-sequence-of-keyframes',
24   assert: 'Keyframes with out-of-order offsets should work, unless there are also auto offsets',
25   author: 'Shane Stephens'
26 });
27
28 </script>