diff --git a/content/html/document/src/nsHTMLContentSink.cpp b/content/html/document/src/nsHTMLContentSink.cpp index f4ad2613e1e..400ee2ce472 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 f4ad2613e1e..400ee2ce472 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 e0b9cfb3153..efc92c08db9 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