From f7850f3d9aa3af4837cd0fe861de46b4dca0303e Mon Sep 17 00:00:00 2001 From: kipp Date: Wed, 8 Jul 1998 23:15:32 +0000 Subject: [PATCH] Worked around a startup problem that caused body's attributes and style context to be prematurely mapped before the attributes were read in or the ua.css was read in git-svn-id: svn://10.0.0.236/trunk@5182 18797224-902f-48f8-a5cc-f745e15eee43 --- .../html/document/src/nsHTMLContentSink.cpp | 14 +++++++++++++- .../layout/html/document/src/nsHTMLContentSink.cpp | 14 +++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/mozilla/content/html/document/src/nsHTMLContentSink.cpp b/mozilla/content/html/document/src/nsHTMLContentSink.cpp index 6739a1b7cf0..a0b0f0bf250 100644 --- a/mozilla/content/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/content/html/document/src/nsHTMLContentSink.cpp @@ -298,7 +298,9 @@ HTMLContentSink::Init(nsIDocument* aDoc, if (NS_OK != rv) { return rv; } - mRoot->AppendChild(mBody, PR_FALSE); + + // Note: Can't do this here; see the comment in OpenBody + //XXX mRoot->AppendChild(mBody, PR_FALSE); return rv; } @@ -414,6 +416,10 @@ HTMLContentSink::OpenBody(const nsIParserNode& aNode) // root has no children SINK_TRACE(SINK_TRACE_REFLOW, ("HTMLContentSink::OpenBody: start layout")); + + // This is done here instead of earlier because we need the + // attributes from the real body tag before we initiate reflow. + mRoot->AppendChild(mBody, PR_FALSE); StartLayout(); } @@ -716,6 +722,12 @@ HTMLContentSink::CloseContainer(const nsIParserNode& aNode) #endif parent->AppendChild(container, allowReflow); +#ifdef NS_DEBUG + if (allowReflow && (((PRInt32)gSinkLogModuleInfo->level) > 127)) { + printf("tick...\n"); + PR_Sleep(PR_SecondsToInterval(3)); + } +#endif #if XXX if (parent == mBody) { // We just closed a child of the body off. Trigger a diff --git a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp index 6739a1b7cf0..a0b0f0bf250 100644 --- a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp @@ -298,7 +298,9 @@ HTMLContentSink::Init(nsIDocument* aDoc, if (NS_OK != rv) { return rv; } - mRoot->AppendChild(mBody, PR_FALSE); + + // Note: Can't do this here; see the comment in OpenBody + //XXX mRoot->AppendChild(mBody, PR_FALSE); return rv; } @@ -414,6 +416,10 @@ HTMLContentSink::OpenBody(const nsIParserNode& aNode) // root has no children SINK_TRACE(SINK_TRACE_REFLOW, ("HTMLContentSink::OpenBody: start layout")); + + // This is done here instead of earlier because we need the + // attributes from the real body tag before we initiate reflow. + mRoot->AppendChild(mBody, PR_FALSE); StartLayout(); } @@ -716,6 +722,12 @@ HTMLContentSink::CloseContainer(const nsIParserNode& aNode) #endif parent->AppendChild(container, allowReflow); +#ifdef NS_DEBUG + if (allowReflow && (((PRInt32)gSinkLogModuleInfo->level) > 127)) { + printf("tick...\n"); + PR_Sleep(PR_SecondsToInterval(3)); + } +#endif #if XXX if (parent == mBody) { // We just closed a child of the body off. Trigger a