Jake wrote:
I have a script that scans through a large table and adds and removes
individual rows.  This can take quite a long time, especially since
each time I add or remove a row, it causes firefox to reflow the entire
page.  I have found the following article that describes how I can set
display=none on the table before making the changes, and then turn the
table back on when I am done.

http://dev.opera.com/articles/view/efficient-javascript/?page=3

In Opera, this tricks the browser into doing 1 reflow once all the
changes have been made. Unfortunately, it doesnt seem to work in
Firefox. Does anyone know how to trick Firefox into delaying a reflow
until I am ready for it?

You might try doing the edits in a timeout after setting the value of "display", f.e. via something like the following code (where "table" is a predefined reference to the table):

function doEdits() {
  // do your edits here
  table.style.display = "table";
}

table.style.display = "none";
window.setTimeout(doEdits, 0);

But that's just a guess. The layout folks would know more. cc:ing m.d.t.layout.

-myk
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to