about summary refs log tree commit diff stats
path: root/test/js/documentall.html
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-09-04 18:47:55 +0200
committerbptato <nincsnevem662@gmail.com>2024-09-17 19:40:44 +0200
commitf868027fed934904718962b69c88cc7e2008e2c3 (patch)
treec2859362c7f8a1c26cb7103d0f4ba96f3d9f8d49 /test/js/documentall.html
parentdd5f480ebecec6758991c226af208c79e2fe9cbc (diff)
downloadchawan-f868027fed934904718962b69c88cc7e2008e2c3.tar.gz
dom: add forms, elements getter + misc fixes
* add document.forms
* add form.elements
* remove redundant jshasprop functions
* use mpairs for attribute iteration (mpairs use pointers, but pairs
  copies)
* fix remove() crash
* fix remove() collection invalidation for children (if parent is not
  in the collection)
* update monoucha
Diffstat (limited to 'test/js/documentall.html')
-rw-r--r--test/js/documentall.html22
1 files changed, 11 insertions, 11 deletions
diff --git a/test/js/documentall.html b/test/js/documentall.html
index 14db9d70..c0272ca3 100644
--- a/test/js/documentall.html
+++ b/test/js/documentall.html
@@ -1,19 +1,19 @@
 <!doctype html>
 <title>HTMLCollection test</title>
 <div id="result">Fail</div>
+<script src=asserts.js></script>
 <style>style 1</style>
 <style>style 2</style>
 <style>style 3</style>
 <script>
-(function() {
-	const abc = document.all;
-	if (document.all || abc) return; /* document.all must be falsy */
-	if (abc.length !== 9) return;
-	const styles = [abc[5], abc[6], abc[7]];
-	if (styles[0].textContent !== "style 1") return;
-	if (styles[1].textContent !== "style 2") return;
-	if (styles[2].textContent !== "style 3") return;
-	const result = document.getElementById("result");
-	result.textContent = "Success";
-})()
+const abc = document.all;
+assert(!document.all, "document.all must be falsy");
+assert(!abc, "document.all must be falsy");
+assert_equals(document.all.length, 10);
+const styles = [abc[6], abc[7], abc[8]];
+assert_equals(styles[0].textContent, "style 1");
+assert_equals(styles[1].textContent, "style 2");
+assert_equals(styles[2].textContent, "style 3");
+const result = document.getElementById("result");
+result.textContent = "Success";
 </script>