On May 16, 10:26 am, Boris Zbarsky <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > And that will change the layout every time one is added to the dom
> > and that triggers a relayout in mozilla engine.
>
> No, it posts an event to do a relayout.
>
> > But since the code will add a lot of DIV elements (~200).   What I am
> > thinking is 'is it possible to suppress the relayout of the mozilla
> > before the for-loop of adding DIV elements, and just relayout once
> > after the for loop is finished.
>
> That's already what's happening, unless your loop asks for layout-dependent
> quantities between insertions.
>
> -Boris

Thanks. I look at the mozilla code a little bit more and notice these
2 functions:

nsViewManager::DisableRefresh(void)
nsViewManager::EnableRefresh(PRUint32 aUpdateFlags)

Should I call these before my for() loop of adding DIV tags to the dom
and
call EnableRefresh() after the for() loop?

Thank you.

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

Reply via email to