From 3d970cf36e02d73a11ec5201d8bfaa0e51937495 Mon Sep 17 00:00:00 2001 From: "karnaze%netscape.com" Date: Fri, 4 Feb 2000 03:16:47 +0000 Subject: [PATCH] bug 23994 get the correct child list for a caption frame, r=attinasi --- layout/base/nsCSSFrameConstructor.cpp | 10 +++++----- layout/html/style/src/nsCSSFrameConstructor.cpp | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 73d7c6c8b43e..5850ddb5e18e 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -523,12 +523,11 @@ nsMathMLmtableCreator::CreateTableCellInnerFrame(nsIFrame** aNewFrame) nsIAtom* GetChildListFor(const nsIFrame* aFrame) { nsIAtom* childList = nsnull; - nsIAtom* frameType; - aFrame->GetFrameType(&frameType); - if (nsLayoutAtoms::tableCaptionFrame == frameType) { + nsCOMPtr frameType; + aFrame->GetFrameType(getter_AddRefs(frameType)); + if (nsLayoutAtoms::tableCaptionFrame == frameType.get()) { childList = nsLayoutAtoms::captionList; } - NS_IF_RELEASE(frameType); return childList; } @@ -1343,6 +1342,7 @@ nsCSSFrameConstructor::ConstructTableCaptionFrame(nsIPresShell* aPres PR_FALSE, getter_AddRefs(adjStyleContext)); InitAndRestoreFrame(aPresContext, aState, aContent, outerFrame, adjStyleContext, nsnull, aNewCaptionFrame); + aState.mFrameManager->SetPrimaryFrameFor(aContent, aNewCaptionFrame); } // The caption frame is a floater container @@ -5813,7 +5813,7 @@ nsCSSFrameConstructor::AppendFrames(nsIPresContext* aPresContext, else { // Append the frames to the end of the parent's child list rv = aFrameManager->AppendFrames(aPresContext, *aPresShell, aParentFrame, - nsnull, aFrameList); + GetChildListFor(aFrameList), aFrameList); } NS_IF_RELEASE(parentType); diff --git a/layout/html/style/src/nsCSSFrameConstructor.cpp b/layout/html/style/src/nsCSSFrameConstructor.cpp index 73d7c6c8b43e..5850ddb5e18e 100644 --- a/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -523,12 +523,11 @@ nsMathMLmtableCreator::CreateTableCellInnerFrame(nsIFrame** aNewFrame) nsIAtom* GetChildListFor(const nsIFrame* aFrame) { nsIAtom* childList = nsnull; - nsIAtom* frameType; - aFrame->GetFrameType(&frameType); - if (nsLayoutAtoms::tableCaptionFrame == frameType) { + nsCOMPtr frameType; + aFrame->GetFrameType(getter_AddRefs(frameType)); + if (nsLayoutAtoms::tableCaptionFrame == frameType.get()) { childList = nsLayoutAtoms::captionList; } - NS_IF_RELEASE(frameType); return childList; } @@ -1343,6 +1342,7 @@ nsCSSFrameConstructor::ConstructTableCaptionFrame(nsIPresShell* aPres PR_FALSE, getter_AddRefs(adjStyleContext)); InitAndRestoreFrame(aPresContext, aState, aContent, outerFrame, adjStyleContext, nsnull, aNewCaptionFrame); + aState.mFrameManager->SetPrimaryFrameFor(aContent, aNewCaptionFrame); } // The caption frame is a floater container @@ -5813,7 +5813,7 @@ nsCSSFrameConstructor::AppendFrames(nsIPresContext* aPresContext, else { // Append the frames to the end of the parent's child list rv = aFrameManager->AppendFrames(aPresContext, *aPresShell, aParentFrame, - nsnull, aFrameList); + GetChildListFor(aFrameList), aFrameList); } NS_IF_RELEASE(parentType);