deferred-tree-2a.xhtml (1459B)
1 <?xml version="1.0" encoding="UTF-8" standalone="no" ?> 2 <html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait"> 3 <head> 4 <title>Deferred tree</title> 5 <!-- 6 PURPOSE: If a SVG subdocument is created dynamically, any timing-related 7 animation API calls on the subdocument should silently fail until it's 8 been attached to a document. 9 10 OPERATION: We start with a plain XHTML document, but later a div and an SVG 11 subdocument are created. We attempt an animation API call on the SVG 12 element before attaching it to the XHTML document. 13 14 EXPECTED RESULTS: The animation API call should have no effect. 15 --> 16 <script src="deferred-tree-util.js" type="text/javascript"/> 17 <script> 18 function animate() 19 { 20 // Set up 21 var div = makeDiv(); 22 var svg = makeSvg(); 23 var target = document.getElementById('tree-container'); 24 25 // Make an animation api call (should have no effect, if we're sane) 26 svg.setCurrentTime(1.0); 27 28 // Trigger a "BindToTree" call on the SVG element 29 div.appendChild(svg); 30 31 // Finally, we attach to the document and pause animations. 32 target.appendChild(div); 33 34 // Reftest Snapshot 35 svg.pauseAnimations(); 36 document.documentElement.removeAttribute("class"); 37 } 38 </script> 39 </head> 40 41 <body onload="animate()"> 42 <p id="tree-container"/> 43 </body> 44 </html>