2 <script src=
"../resources/testharness.js"></script>
3 <script src=
"../resources/testharnessreport.js"></script>
6 <div id='element'
></div>
10 var element
= document
.getElementById('element');
11 var container
= document
.getElementById('container');
14 element
.style
.fontSize
= '10px';
15 container
.style
.width
= '1000px';
16 var player
= element
.animate([{left
: 'calc(100px + 80%)'}, {left
: '10em'}], 10);
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');
27 container
.style
.width
= '1000px';
28 var player
= element
.animate([{paddingTop
: '30%'}, {paddingTop
: '50%'}], 10);
30 player
.currentTime
= 5;
31 container
.style
.width
= '700px';
32 assert_equals(getComputedStyle(element
).paddingTop
, '280px');
33 }, 'Percentages responsive to width style changes');
36 element
.style
.fontSize
= '1px';
37 var player
= element
.animate([{lineHeight
: '9'}, {lineHeight
: '13'}], 10);
39 player
.currentTime
= 2.5;
40 element
.style
.fontSize
= '7px';
41 assert_equals(getComputedStyle(element
).lineHeight
, '70px');
42 }, 'Numbers responsive to style changes');