layout/html/tests/Rotate.html
author jst@mozilla.org
Wed, 10 Oct 2007 16:03:14 -0700
changeset 6804 81046e3390a0add71c14c7da17dac72d4f71175e
parent 1 9b2a99adc05e53cd4010de512f50118594756650
permissions -rw-r--r--
Landing basic framework for dtrace support (bug 388564). Patch by john.rice@sun.com and padraig.obriain@sun.com. r+a=ted.mielczarek@gmail.com, sr=sayrer@gmail.com

<HTML>
<BODY>
<P>
Let's start with some text, have a <B>bold element</B>, an <I>italicized element</I> and then an image: 
<IMG SRC="http://www.caboodles.com/clipart/archives/alt_bin/transport/car13.gif" width=100 height=80>
<font color="#0000FF">And now a lot more text. And now a lot more text. And now a lot more text.</font>
And now a lot more text. And now a lot more text. And now a lot more text. 
<font color="#FF0000">And now a lot more text. And now a lot more text. And now a lot more text.</font>
And now a lot more text. And now a lot more text. And now a lot more text. 
<font color="#00FF00">And now a lot more text. And now a lot more text. And now a lot more text.</font>
And now a lot more text. And now a lot more text. And now a lot more text. 
<font face="Arial, Helvetica, sans-serif">And now a lot more text. And now a lot more text. And now a lot more text. </font>
<font face="Verdana, Arial, Helvetica, sans-serif">And now a lot more text. And now a lot more text. And now a lot more text. </font>
And now a lot more text. And now a lot more text. And now a lot more text. 
<font face="Times New Roman, Times, serif">And now a lot more text. And now a lot more text. And now a lot more text. </font>
And now a lot more text. And now a lot more text. And now a lot more text. 
<table border=2>
<tr><td><center><img SRC="http://zabadubop/layers/tests/mzcolor.gif">A table!</center></td><td><center>You're a brave man, Kipp.</center></td></tr>
<tr><td><center>And more text.</center></td><td><center>And still more text.</center></td></tr>
</table>
And now a lot more text. And now a lot more text. And now a lot more text. 
<font size=6>And now a lot more text. And now a lot more text. And now a lot more text. </font>
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. 
</P>
<SCRIPT>
var body = document.documentElement.childNodes[1];
var para = body.childNodes[1];
var img1 = para.childNodes[5];
var tbody = document.getElementsByTagName("TBODY")[0];
var tparent = tbody.childNodes[0].childNodes[0];
var img2 = tparent.childNodes[0].childNodes[0];

var pos = 0;

function rotate(p, c) {
    p.removeChild(c);
    var child = p.childNodes[pos++];
    if (pos > p.childNodes.length) {
      pos = 0;
    }  
    p.insertBefore(c, child);
}

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)

</SCRIPT>
</BODY>
</HTML>