From cf157da2287268f849d8fb40846ed9bc3d49fdeb Mon Sep 17 00:00:00 2001 From: "kipp%netscape.com" Date: Thu, 16 Jul 1998 18:19:53 +0000 Subject: [PATCH] Deal with lingering leaf content properly during append reflow git-svn-id: svn://10.0.0.236/trunk@5716 18797224-902f-48f8-a5cc-f745e15eee43 --- .../html/document/src/nsHTMLContentSink.cpp | 28 +++++++------------ .../html/document/src/nsHTMLContentSink.cpp | 28 +++++++------------ 2 files changed, 20 insertions(+), 36 deletions(-) diff --git a/mozilla/content/html/document/src/nsHTMLContentSink.cpp b/mozilla/content/html/document/src/nsHTMLContentSink.cpp index 1fdf24f182d..9cc202dd573 100644 --- a/mozilla/content/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/content/html/document/src/nsHTMLContentSink.cpp @@ -951,30 +951,22 @@ void HTMLContentSink::StartLayout() void HTMLContentSink::ReflowNewContent() { - PRInt32 i, ns = mDocument->GetNumberOfShells(); - for (i = 0; i < ns; i++) { - nsIPresShell* shell = mDocument->GetShellAt(i); - if (nsnull != shell) { - nsIPresContext* cx = shell->GetPresContext(); - nsRect r; - cx->GetVisibleArea(r); - shell->ResizeReflow(r.width, r.height); - NS_RELEASE(cx); - NS_RELEASE(shell); - } - } -#if XXX - printf("reflow body\n"); - - // Trigger reflows in each of the presentation shells +#if 0 PRInt32 i, ns = mDocument->GetNumberOfShells(); for (i = 0; i < ns; i++) { nsIPresShell* shell = mDocument->GetShellAt(i); if (nsnull != shell) { - shell->ContentAppended(mBody); + nsIPresContext* cx = shell->GetPresContext(); + nsRect r; + cx->GetVisibleArea(r); + shell->ResizeReflow(r.width, r.height); + NS_RELEASE(cx); NS_RELEASE(shell); } - } + } +#else + // Trigger reflows in each of the presentation shells + mDocument->ContentAppended(mBody); #endif } diff --git a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp index 1fdf24f182d..9cc202dd573 100644 --- a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp @@ -951,30 +951,22 @@ void HTMLContentSink::StartLayout() void HTMLContentSink::ReflowNewContent() { - PRInt32 i, ns = mDocument->GetNumberOfShells(); - for (i = 0; i < ns; i++) { - nsIPresShell* shell = mDocument->GetShellAt(i); - if (nsnull != shell) { - nsIPresContext* cx = shell->GetPresContext(); - nsRect r; - cx->GetVisibleArea(r); - shell->ResizeReflow(r.width, r.height); - NS_RELEASE(cx); - NS_RELEASE(shell); - } - } -#if XXX - printf("reflow body\n"); - - // Trigger reflows in each of the presentation shells +#if 0 PRInt32 i, ns = mDocument->GetNumberOfShells(); for (i = 0; i < ns; i++) { nsIPresShell* shell = mDocument->GetShellAt(i); if (nsnull != shell) { - shell->ContentAppended(mBody); + nsIPresContext* cx = shell->GetPresContext(); + nsRect r; + cx->GetVisibleArea(r); + shell->ResizeReflow(r.width, r.height); + NS_RELEASE(cx); NS_RELEASE(shell); } - } + } +#else + // Trigger reflows in each of the presentation shells + mDocument->ContentAppended(mBody); #endif }