summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/web-animations-api/w3c/2-keyframes-with-offsets.html
blob: 66ca70faa5600f166002b87988c8e50d9ba92292 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="resources/keyframes-test.js"></script>
<script>
test(function() {
  assertAnimationStyles([
    {opacity: '0.25', left: '25px', offset: 0},
    {opacity: '0.75', left: '75px'},
  ], {
    0.5: {opacity: '0.5', left: '50px'},
  });
  assertAnimationStyles([
    {opacity: '0.25', left: '25px'},
    {opacity: '0.75', left: '75px', offset: 1},
  ], {
    0.5: {opacity: '0.5', left: '50px'},
  });
},
'element.animate() with 2 keyframes and 1 offset specified',
{
  help: 'http://dev.w3.org/fxtf/web-animations/#keyframe-animation-effects',
  assert: [
    'element.animate() should start an animation when two keyframes',
    'are provided with matching properties and one offset is specified.',
  ],
  author: 'Alan Cutter',
});

test(function() {
  assertAnimationStyles([
    {opacity: '0.25', left: '25px', offset: 0},
    {opacity: '0.75', left: '75px', offset: 1},
  ], {
    0.5: {opacity: '0.5', left: '50px'},
  });

  assert_throws('InvalidModificationError', function() {
    assertAnimationStyles([
      {opacity: '0.75', left: '75px', offset: 1},
      {opacity: '0.25', left: '25px', offset: 0},
    ], {
      0.5: {opacity: '0.5', left: '50px'},
    });
  });
},
'element.animate() with 2 keyframes and 2 offsets specified',
{
  help: 'http://dev.w3.org/fxtf/web-animations/#keyframe-animation-effects',
  assert: [
    'element.animate() should start an animation when two keyframes',
    'are provided with matching properties and both offsets specified.',
  ],
  author: 'Alan Cutter',
});
</script>