4 function createElement() {
5 var element = document.createElement('div');
6 document.documentElement.appendChild(element);
10 function heldTiming(progress) {
14 delay: -progress * 1000,
18 function assertAnimationStyles(keyframes, expectations, description) {
19 for (var progress in expectations) {
20 var element = createElement();
21 element.animate(keyframes, heldTiming(progress));
22 var computedStyle = getComputedStyle(element);
23 for (var property in expectations[progress]) {
24 assert_equals(computedStyle[property], expectations[progress][property],
25 property + ' at ' + (progress * 100) + '%' + (description ? ' ' + description : ''));
30 window.assertAnimationStyles = assertAnimationStyles;