about summary refs log tree commit diff stats
path: root/test/js/docwrite2.html
blob: 876f3cdde01552bcfb60f5dae93ff0f2265319f7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!DOCTYPE html>
<html lang="en">
<head>
<title>document.write test</title>
<script>
window.onload = function() {
	const success = document.body.innerHTML == document.querySelector("style").textContent;
	while (document.body.childNodes[0])
		document.body.childNodes[0].remove();
	document.body.innerHTML = success ? "Success" : "Fail";
}
let checkpointCounter = 0;
function checkpoint(n) {
	if (++checkpointCounter != n)
		throw new TypeError(`Checkpoint failed: expected ${n} but got ${checkpointCounter}`);
}
</script>
<style><script>
document.write("a");
document.write("<script></scr" + "ipt>x");
document.write("t");
</script>a<script></script>xt

</style>
</head>
<body><script>
document.write("a");
document.write("<script></scr" + "ipt>x");
document.write("t");
</script></body>
</html>