3 <script type=
"text/javascript">
5 var contentElement
= document
.getElementById(test
);
7 if (contentElement
.textContent
== 'PASS') {
8 contentElement
.textContent
= 'FAIL';
9 } else if (contentElement
.textContent
== 'FAIL') {
10 contentElement
.textContent
= 'PASS';
15 if (window
.testRunner
) {
16 testRunner
.dumpAsText();
17 testRunner
.waitUntilDone();
21 var e1
= document
.createElement("script");
22 e1
.textContent
= pass
.toString() + " pass();";
23 document
.getElementsByTagName("head")[0].appendChild(e1
);
24 document
.getElementsByTagName("head")[0].removeChild(e1
);
27 document
.getElementsByTagName("head")[0].appendChild(e1
);
28 document
.getElementsByTagName("head")[0].removeChild(e1
);
31 e3
= document
.createElement("script");
32 e3
.src
= "resources/script-reexecution-pass.js";
33 e3
.onload = function() { finish(); };
34 document
.getElementsByTagName("head")[0].appendChild(e3
);
41 document
.getElementsByTagName("head")[0].removeChild(e3
);
42 document
.getElementsByTagName("head")[0].appendChild(e3
);
44 if (window
.testRunner
)
45 testRunner
.notifyDone();
49 <body onload=
"test()">
50 <p>Created script element, script data passed as text content, appended:
<span id=
"p1">FAIL
</span></p>
51 <p>Removed element, readd element, remove again, script shouldn't have executed:
<span id=
"p2">PASS
</span></p>
52 <p>Created script element, loading external script content, appended:
<span id=
"p3">FAIL
</span></p>
53 <p>Removed element, readd element, script shouldn't have executed:
<span id=
"p4">PASS
</span></p>