| <!DOCTYPE html> |
| <html><head> |
| <title>scheduler: appending non-text children to script </title> |
| <script src="/resources/testharness.js"></script> |
| <script src="/resources/testharnessreport.js"></script> |
| <script src="testlib/testlib.js"></script> |
| </head> |
| <div id="log"></div> |
| <script> |
| var t = async_test(); |
| </script> |
| <script id="test"></script> |
| <script> |
| t.step(function() { |
| log("inline script #1"); |
| var script = document.getElementById("test"); |
| |
| var frag = document.createDocumentFragment(); |
| var div = document.createElement("div"); |
| |
| div.textContent = "assert_unreached();" |
| frag.appendChild(document.createTextNode("t.step(function() {log('inline script #2');\n")); |
| frag.appendChild(div); |
| frag.appendChild(document.createTextNode("log('end inline script #2');})")); |
| |
| script.appendChild(frag); |
| log("end inline script #1"); |
| }); |
| |
| onload = t.step_func(function() { |
| assert_array_equals(eventOrder, ["inline script #1", "inline script #2", "end inline script #2", "end inline script #1"]); |
| t.done(); |
| }); |
| </script> |