OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <script src="../resources/testharness.js"></script> | |
3 <script src="../resources/testharnessreport.js"></script> | |
4 <style> | |
5 | |
6 div { font-size: 10px; } | |
7 | |
8 </style> | |
9 <div id='element'></div> | |
10 <script> | |
11 | |
12 var element = document.getElementById('element'); | |
13 | |
14 function animate(property, value) { | |
15 var keyframes = [ | |
16 {offset: 0}, | |
17 {offset: 1}, | |
18 ]; | |
19 keyframes[0][property] = value; | |
20 keyframes[1][property] = value; | |
21 | |
22 try { element.animate(keyframes, {fill: 'forwards'}); } catch(e) {} | |
23 } | |
alancutter (OOO until 2018)
2016/03/10 01:26:50
Why is there a try catch?
This helper function is
Eric Willigers
2016/03/10 01:56:04
Fixed.
| |
24 | |
25 test(function() { | |
26 animate('font-size', '20px'); | |
27 assert_equals(getComputedStyle(element).fontSize, '10px'); | |
28 | |
29 animate('fontSize', '30px'); | |
30 assert_equals(getComputedStyle(element).fontSize, '30px'); | |
31 }, 'Hyphenated propery names are rejected.'); | |
alancutter (OOO until 2018)
2016/03/10 01:26:50
s/rejected/ignored/
Eric Willigers
2016/03/10 01:56:04
Done.
| |
32 | |
33 </script> | |
OLD | NEW |