[Web Animations] Update WPT tests and move them to imported/w3c/web-platform-tests
[WebKit-https.git] / LayoutTests / imported / w3c / web-platform-tests / web-animations / interfaces / AnimationEffectTiming / fill.html
1 <!DOCTYPE html>
2 <meta charset=utf-8>
3 <title>AnimationEffectTiming.fill</title>
4 <link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animationeffecttiming-fill">
5 <script src="/resources/testharness.js"></script>
6 <script src="/resources/testharnessreport.js"></script>
7 <script src="../../testcommon.js"></script>
8 <body>
9 <div id="log"></div>
10 <script>
11 'use strict';
12
13 test(t => {
14   const anim = createDiv(t).animate(null);
15   assert_equals(anim.effect.timing.fill, 'auto');
16 }, 'Has the default value \'auto\'');
17
18 for (const fill of ['none', 'forwards', 'backwards', 'both']) {
19   test(t => {
20     const div = createDiv(t);
21     const anim = div.animate({ opacity: [ 0, 1 ] }, 100);
22     anim.effect.timing.fill = fill;
23     assert_equals(anim.effect.timing.fill, fill, 'set fill ' + fill);
24     assert_equals(anim.effect.getComputedTiming().fill, fill,
25                   'getComputedTiming() after set fill ' + fill);
26   }, `Can set fill to ${fill}`);
27 }
28
29 </script>
30 </body>