From a9ecb4ac21a51b74bf41a86755972557d385613a Mon Sep 17 00:00:00 2001 From: "vidur%netscape.com" Date: Thu, 16 Jul 1998 23:39:08 +0000 Subject: [PATCH] Rotation test revamped --- layout/html/tests/Rotate.html | 21 ++++++++++-------- layout/html/tests/Rotate.js | 41 +++++++++++++++++++++++------------ 2 files changed, 39 insertions(+), 23 deletions(-) diff --git a/layout/html/tests/Rotate.html b/layout/html/tests/Rotate.html index 15629e7458a..178115fc0e9 100644 --- a/layout/html/tests/Rotate.html +++ b/layout/html/tests/Rotate.html @@ -2,21 +2,24 @@

Let's start with some text, have a bold element, an italicized element and then an image: -. -And now a lot more text. And now a lot more text. And now a lot more text. -And now a lot more text. And now a lot more text. And now a lot more text. -And now a lot more text. And now a lot more text. And now a lot more text. -And now a lot more text. And now a lot more text. And now a lot more text. -And now a lot more text. And now a lot more text. And now a lot more text. -And now a lot more text. And now a lot more text. And now a lot more text. -And now a lot more text. And now a lot more text. And now a lot more text. -And now a lot more text. And now a lot more text. And now a lot more text. + +And now a lot more text. And now a lot more text. And now a lot more text. And now a lot more text. And now a lot more text. And now a lot more text. +And now a lot more text. And now a lot more text. And now a lot more text. And now a lot more text. And now a lot more text. And now a lot more text. +And now a lot more text. And now a lot more text. And now a lot more text. And now a lot more text. And now a lot more text. And now a lot more text. +And now a lot more text. And now a lot more text. And now a lot more text. +And now a lot more text. And now a lot more text. And now a lot more text. And now a lot more text. And now a lot more text. And now a lot more text. +And now a lot more text. And now a lot more text. And now a lot more text. And now a lot more text. And now a lot more text. And now a lot more text. + + + +
A table!
You're a brave man, Kipp.
And more text.
And still more text.
And now a lot more text. And now a lot more text. And now a lot more text. +And now a lot more text. And now a lot more text. And now a lot more text. And now a lot more text. And now a lot more text. And now a lot more text. And now a lot more text. And now a lot more text. And now a lot more text. And now a lot more text. And now a lot more text. And now a lot more text. diff --git a/layout/html/tests/Rotate.js b/layout/html/tests/Rotate.js index d1ddddac181..3509a460cfd 100644 --- a/layout/html/tests/Rotate.js +++ b/layout/html/tests/Rotate.js @@ -18,22 +18,35 @@ var body = document.documentElement.childNodes[1]; var para = body.childNodes[1]; -var image = para.childNodes[5]; +var img1 = para.childNodes[5]; +var tbody = body.childNodes[2].childNodes[1]; +var tparent = tbody.childNodes[0].childNodes[0]; +var img2 = tparent.childNodes[0].childNodes[0]; var pos = 0; -function rotate() { - dump("Removing\n"); - para.removeChild(image); - dump("Getting child " + pos + "\n"); - var child = para.childNodes[pos++]; - if (pos == para.childNodes.length) { - pos = 0; - } - dump("Inserting\n"); - para.insertBefore(image, child); - dump("Done\n"); +function rotate(p, c) { + p.removeChild(c); + var child = p.childNodes[pos++]; + if (pos > p.childNodes.length) { + pos = 0; + } + p.insertBefore(c, child); } -//rotate(); -setInterval(rotate, 2000); +function rotate2() { + tparent.childNodes[0].removeChild(img2); + if (tparent.nextSibling != null) { + tparent = tparent.nextSibling; + } + else if (tparent.parentNode.nextSibling != null) { + tparent = tparent.parentNode.nextSibling.childNodes[0]; + } + else { + tparent = tbody.childNodes[0].childNodes[0]; + } + tparent.childNodes[0].insertBefore(img2, tparent.childNodes[0].childNodes[0]); +} + +var int1 = setInterval(rotate, 1000, para, img1); +var int2 = setInterval(rotate2, 1000)