test_bug1017896.html (897B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=1017896 5 --> 6 <head> 7 <title>Test template element in stale document.</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 10 </head> 11 <body> 12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1017896">Bug 1017896</a> 13 <div id="container"></div> 14 <script> 15 16 SimpleTest.waitForExplicitFinish(); 17 18 var frame = document.createElement("iframe"); 19 document.getElementById("container").appendChild(frame); 20 21 var staleFrameDoc = frame.contentDocument; 22 23 setTimeout(function() { 24 var v = staleFrameDoc.createElement("div"); 25 v.innerHTML = "<template>Content</template>"; 26 is(v.firstChild.content.childNodes.length, 1, "Template should have one child in template content."); 27 SimpleTest.finish(); 28 }, 0); 29 30 </script> 31 </body> 32 </html>