From fe8dc78f66118d89228cd61f6db3df3c515ef25d Mon Sep 17 00:00:00 2001 From: "karnaze%netscape.com" Date: Tue, 21 Jul 1998 23:20:04 +0000 Subject: [PATCH] set attributes on , layout --- .../html/document/src/nsHTMLContentSink.cpp | 9 ++- .../html/document/src/nsHTMLContentSink.cpp | 9 ++- layout/html/document/src/nsHTMLFrame.cpp | 58 ++++++++++--------- layout/html/document/src/nsHTMLFrameset.cpp | 45 ++++++++------ layout/html/document/src/nsHTMLFrameset.h | 4 +- 5 files changed, 70 insertions(+), 55 deletions(-) diff --git a/content/html/document/src/nsHTMLContentSink.cpp b/content/html/document/src/nsHTMLContentSink.cpp index f4ad2613e1ea..400ee2ce472c 100644 --- a/content/html/document/src/nsHTMLContentSink.cpp +++ b/content/html/document/src/nsHTMLContentSink.cpp @@ -595,6 +595,7 @@ HTMLContentSink::OpenFrameset(const nsIParserNode& aNode) return NS_ERROR_OUT_OF_MEMORY; } nsresult rv = NS_NewHTMLFrameset(&mFrameset, atom, nsnull); + mFrameset->SetDocument(mDocument); NS_RELEASE(atom); if (NS_OK != rv) { return rv; @@ -605,9 +606,6 @@ HTMLContentSink::OpenFrameset(const nsIParserNode& aNode) // Add attributes to the frameset content object AddAttributes(aNode, mFrameset); - // XXX If the frameset already existed and has been reflowed somewhat - // then we need to trigger a style change - mRoot->AppendChild(mFrameset, PR_TRUE); return NS_OK; } @@ -617,6 +615,8 @@ HTMLContentSink::CloseFrameset(const nsIParserNode& aNode) { FlushText(); + mRoot->AppendChild(mFrameset, PR_TRUE); + SINK_TRACE_NODE(SINK_TRACE_CALLS, "HTMLContentSink::CloseFrameset", aNode); @@ -1805,6 +1805,9 @@ nsresult HTMLContentSink::ProcessFrameTag(nsIHTMLContent** aInstancePtrResult, nsIAtom* atom = NS_NewAtom(tmp); nsresult rv = NS_NewHTMLFrame(aInstancePtrResult, atom, mWebShell); + if (NS_OK == rv) { + rv = AddAttributes(aNode, *aInstancePtrResult); + } NS_RELEASE(atom); return rv; diff --git a/layout/html/document/src/nsHTMLContentSink.cpp b/layout/html/document/src/nsHTMLContentSink.cpp index f4ad2613e1ea..400ee2ce472c 100644 --- a/layout/html/document/src/nsHTMLContentSink.cpp +++ b/layout/html/document/src/nsHTMLContentSink.cpp @@ -595,6 +595,7 @@ HTMLContentSink::OpenFrameset(const nsIParserNode& aNode) return NS_ERROR_OUT_OF_MEMORY; } nsresult rv = NS_NewHTMLFrameset(&mFrameset, atom, nsnull); + mFrameset->SetDocument(mDocument); NS_RELEASE(atom); if (NS_OK != rv) { return rv; @@ -605,9 +606,6 @@ HTMLContentSink::OpenFrameset(const nsIParserNode& aNode) // Add attributes to the frameset content object AddAttributes(aNode, mFrameset); - // XXX If the frameset already existed and has been reflowed somewhat - // then we need to trigger a style change - mRoot->AppendChild(mFrameset, PR_TRUE); return NS_OK; } @@ -617,6 +615,8 @@ HTMLContentSink::CloseFrameset(const nsIParserNode& aNode) { FlushText(); + mRoot->AppendChild(mFrameset, PR_TRUE); + SINK_TRACE_NODE(SINK_TRACE_CALLS, "HTMLContentSink::CloseFrameset", aNode); @@ -1805,6 +1805,9 @@ nsresult HTMLContentSink::ProcessFrameTag(nsIHTMLContent** aInstancePtrResult, nsIAtom* atom = NS_NewAtom(tmp); nsresult rv = NS_NewHTMLFrame(aInstancePtrResult, atom, mWebShell); + if (NS_OK == rv) { + rv = AddAttributes(aNode, *aInstancePtrResult); + } NS_RELEASE(atom); return rv; diff --git a/layout/html/document/src/nsHTMLFrame.cpp b/layout/html/document/src/nsHTMLFrame.cpp index e0b9cfb31539..efc92c08db98 100644 --- a/layout/html/document/src/nsHTMLFrame.cpp +++ b/layout/html/document/src/nsHTMLFrame.cpp @@ -244,31 +244,22 @@ nsHTMLFrameOuterFrame::GetDesiredSize(nsIPresContext* aPresContext, const nsReflowState& aReflowState, nsReflowMetrics& aDesiredSize) { - if (IsInline()) { - float p2t = aPresContext->GetPixelsToTwips(); + // processing does not use this routine, only