about summary refs log tree commit diff stats
path: root/test/js/docwrite3.html
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-04-21 21:26:27 +0200
committerbptato <nincsnevem662@gmail.com>2024-04-21 21:28:45 +0200
commite3d9ee2c6224cd30bf56e24f7988899e0e3985c1 (patch)
tree31116d7d751d058f32bf43313c12673423e8d8be /test/js/docwrite3.html
parentba88f015ea500bcc574b621392c721ef2c9dbcd0 (diff)
downloadchawan-e3d9ee2c6224cd30bf56e24f7988899e0e3985c1.tar.gz
test: add js & layout tests
(Sadly some layout tests still fail.)
Diffstat (limited to 'test/js/docwrite3.html')
-rw-r--r--test/js/docwrite3.html43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/js/docwrite3.html b/test/js/docwrite3.html
new file mode 100644
index 00000000..24fc2222
--- /dev/null
+++ b/test/js/docwrite3.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<script>
+window.onload = function() {
+	const success = document.body.outerHTML == document.querySelector("style").textContent;
+	/*
+	console.log("BODY", document.body.outerHTML)
+	console.log("STYLE", document.querySelector("style").textContent)
+	*/
+	while (document.body.childNodes[0])
+		document.body.childNodes[0].remove();
+	document.body.innerHTML = success ? "Success" : "Fail";
+}
+</script>
+<style><body><h1>Main title</h1>
+
+
+<p>Text.</p>
+<script>
+document.write("<h2>Subtitle</h2>");
+document.write("<scr" + "ipt>document.write('<p>before subtext</p><scri'+'pt>document.write(`third nest`)</scri'+'pt>')</scrip" + "t><p>fin</p>");
+</script><h2>Subtitle</h2><script>document.write('<p>before subtext</p><scri'+'pt>document.write(`third nest`)</scri'+'pt>')</script><p>before subtext</p><script>document.write(`third nest`)</script>third nest<p>fin</p>
+<p>Subtext.</p>
+
+
+
+</body></style>
+<title>Write example</title>
+<script>
+document.write("<h1>Main title</h1>");
+</script>
+</head>
+<body>
+<p>Text.</p>
+<script>
+document.write("<h2>Subtitle</h2>");
+document.write("<scr" + "ipt>document.write('<p>before subtext</p><scri'+'pt>document.write(`third nest`)</scri'+'pt>')</scrip" + "t><p>fin</p>");
+</script>
+<p>Subtext.</p>
+</body>
+</html>
+