summaryrefslogtreecommitdiffstats
path: root/dom/tests/js/lists.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /dom/tests/js/lists.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/tests/js/lists.html')
-rw-r--r--dom/tests/js/lists.html68
1 files changed, 68 insertions, 0 deletions
diff --git a/dom/tests/js/lists.html b/dom/tests/js/lists.html
new file mode 100644
index 000000000..eecb345f9
--- /dev/null
+++ b/dom/tests/js/lists.html
@@ -0,0 +1,68 @@
+<html>
+<body>
+<p>This test does a few things:
+<ul>
+ <li>It has a couple of:
+ <ul>
+ <li>Images: <IMG SRC="http://zabadubop/layers/tests/mzcolor.gif" ID="foo"> and
+ <IMG SRC="http://peoplestage.netscape.com/kipp/nerdly_int.gif" NAME="kipp">.
+ <li>Links to <a href="http://home.netscape.com">Netscape</a> and
+ <A HREF="http://peoplestage.netscape.com/kipp">Kippy's Home Page</A>.
+ <li>and Anchors to <a NAME="anchor1">here</A> and
+ <A name="anchor2">here</a>.
+ </ul>
+ <li>It dumps (check the JS console) the images, links and anchors using
+ the document.images, document.links and document.anchors arrays.
+ <li>Then it removes one of the images.
+ <li>Dumps the images array again. This is to prove that the images array
+ is live.
+ <li>Adds back the image.
+ <li>And the dumps the images array again. The image arrays order should
+ now be different.
+ <li>It gets a list of LIs (using getElementsByTagName()) and prints
+ out all their tagNames. There should be 10.
+</ul>
+<script>
+var x;
+dump("Images:\n");
+for (x=0; x < document.images.length; x++) {
+ dump("Image#" + x + ": " + document.images[x].getDOMAttribute("SRC") + "\n");
+}
+dump("\nLinks:\n");
+for (x=0; x < document.links.length; x++) {
+ dump("Link#" + x + ": " + document.links[x].getDOMAttribute("HREF") + "\n");
+}
+dump("\nAnchors:\n");
+for (x=0; x < document.anchors.length; x++) {
+ dump("Anchors#" + x + ": " + document.anchors[x].getDOMAttribute("NAME") + "\n");
+}
+
+dump("\nRemoving image\n");
+var img=document.images[1];
+var parent=img.parentNode;
+parent.removeChild(img);
+dump("Images:\n");
+for (x=0; x < document.images.length; x++) {
+ dump("Image#" + x + ": " + document.images[x].getDOMAttribute("SRC") + "\n");
+}
+
+dump("\nInserting image back into list\n");
+var sib=parent.childNodes[0];
+parent.insertBefore(img, sib);
+dump("Images:\n");
+for (x=0; x < document.images.length; x++) {
+ dump("Image#" + x + ": " + document.images[x].getDOMAttribute("SRC") + "\n");
+}
+
+var lis = document.getElementsByTagName("LI");
+dump("Lists:\n");
+for (x=0; x < lis.length; x++) {
+ dump(lis[x].tagName + "\n");
+}
+
+dump("Named elements:\n");
+dump(document.kipp.tagName + " with NAME=" + document.kipp.getDOMAttribute("NAME") + "\n");
+
+</script>
+</body>
+</html> \ No newline at end of file