a guest Feb 25th, 2009 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html><!-- demo of how background images kill Firefox (Gecko) dhtml performance -->
  2. <head><style>body {background: url(;} table {background:#fff; font:15px arial; white-space:nowrap;}</style></head>
  3. <body  onload="collapsetable()" onkeypress="collapsecount=10" onmousedown="collapsecount=10">
  5. <p>Rendering benchmark (Gecko background image performance bug). This will open and close a table 5 times, as fast as possible</p>
  6. <script type="text/javascript">
  7. t0 = new Date(); collapsecount=0;
  9. // let's make a few fake tables
  10. for (var x=0;x<=2;x++) {
  11. document.write("<table border='1' align='center' id='benchmark"+x+"'>");
  12. for (var y=1;y<=50;y++) {document.write("<tr><td align='right'>"+y+"</td><td><a href='#'>Lorem ipsum dolor sit amet, consectetur adipisicing elit,</a></td><td><a href='#'>sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</a></td></tr>");}
  13. document.write("</table><br>");}
  15. function collapsetable() {                     
  16. tablerows=document.getElementById('benchmark0').rows;
  17. collapseposition=tablerows.length;
  18. if (tablerows[collapseposition-1].style.display) {collapse="";} else {collapse="none";}
  19. collapserow();                         
  20. }
  22. function collapserow() {
  23. collapseposition--;
  24. if (collapseposition>-1) {tablerows[collapseposition].style.display=collapse; setTimeout("collapserow()",0);}
  25. else {collapsecount++; if (collapsecount<11) {collapsetable();} else {var t1 = new Date(); document.body.innerHTML=((t1.getTime()-t0.getTime())/1000+" seconds");}}
  26. }
  28. </script>
  29. </table></body></html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand