OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <script src="../resources/testharness.js"></script> | |
3 <script src="../resources/testharnessreport.js"></script> | |
4 | |
5 <div id='container'> | |
6 <div id='element'></div> | |
7 </div> | |
8 | |
9 <script> | |
10 var element = document.getElementById('element'); | |
11 var container = document.getElementById('container'); | |
12 | |
13 test(function() { | |
14 element.style.fontSize = '10px'; | |
15 container.style.width = '1000px'; | |
16 var player = element.animate([{left: 'calc(100px + 80%)'}, {left: '10em'}],
10); | |
17 player.pause(); | |
18 player.currentTime = 5; | |
19 assert_equals(getComputedStyle(element).left, 'calc(100px + 40%)'); | |
20 element.style.fontSize = '20px'; | |
21 assert_equals(getComputedStyle(element).left, 'calc(150px + 40%)'); | |
22 container.style.width = '500px'; | |
23 assert_equals(getComputedStyle(element).left, 'calc(150px + 40%)'); | |
24 }, 'Lengths responsive to style changes'); | |
25 | |
26 test(function() { | |
27 container.style.width = '1000px'; | |
28 var player = element.animate([{paddingTop: '30%'}, {paddingTop: '50%'}], 10)
; | |
29 player.pause(); | |
30 player.currentTime = 5; | |
31 container.style.width = '700px'; | |
32 assert_equals(getComputedStyle(element).paddingTop, '280px'); | |
33 }, 'Percentages responsive to width style changes'); | |
34 | |
35 test(function() { | |
36 element.style.fontSize = '1px'; | |
37 var player = element.animate([{lineHeight: '9'}, {lineHeight: '13'}], 10); | |
38 player.pause(); | |
39 player.currentTime = 2.5; | |
40 element.style.fontSize = '7px'; | |
41 assert_equals(getComputedStyle(element).lineHeight, '70px'); | |
42 }, 'Numbers responsive to style changes'); | |
43 | |
44 </script> | |
OLD | NEW |