test_animate_xrays.html (1596B)
1 <!doctype html> 2 <head> 3 <meta charset=utf-8> 4 <script type="application/javascript" src="../testharness.js"></script> 5 <script type="application/javascript" src="../testharnessreport.js"></script> 6 <script type="application/javascript" src="../testcommon.js"></script> 7 </head> 8 <body> 9 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1414674" 10 target="_blank">Mozilla Bug 1414674</a> 11 <div id="log"></div> 12 <iframe id="iframe" 13 src="http://example.org/tests/dom/animation/test/chrome/file_animate_xrays.html"></iframe> 14 <script> 15 'use strict'; 16 17 var win = document.getElementById('iframe').contentWindow; 18 19 async_test(function(t) { 20 window.addEventListener('load', t.step_func(function() { 21 var target = win.document.getElementById('target'); 22 var anim = target.animate({opacity: [ 1, 0 ]}, 100 * MS_PER_SEC); 23 // The frames object should be accessible via x-ray. 24 var frames = anim.effect.getKeyframes(); 25 assert_equals(frames.length, 2, 26 "frames for Element.animate should be non-zero"); 27 assert_equals(frames[0].opacity, "1", 28 "first frame opacity for Element.animate should be specified value"); 29 assert_equals(frames[0].computedOffset, 0, 30 "first frame offset for Element.animate should be 0"); 31 assert_equals(frames[1].opacity, "0", 32 "last frame opacity for Element.animate should be specified value"); 33 assert_equals(frames[1].computedOffset, 1, 34 "last frame offset for Element.animate should be 1"); 35 t.done(); 36 })); 37 }, 'Calling animate() across x-rays'); 38 39 </script> 40 </body>