Fix crash when recreating <caption> frames. Add ASSERTIONs to detect similar frame construction errors in the future. b=341382 r+sr=bzbarsky

git-svn-id: svn://10.0.0.236/trunk@201187 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mats.palmgren%bredband.net
2006-06-29 02:32:36 +00:00
parent 9fe45b2309
commit 1bbaeed419
14 changed files with 149 additions and 36 deletions

View File

@@ -177,7 +177,10 @@ nsInlineFrame::AppendFrames(nsIAtom* aListName,
#ifdef IBMBIDI
if (aListName != nsLayoutAtoms::nextBidi)
#endif
{
NS_ERROR("unexpected child list");
return NS_ERROR_INVALID_ARG;
}
}
if (aFrameList) {
mFrames.AppendFrames(this, aFrameList);
@@ -196,11 +199,17 @@ nsInlineFrame::InsertFrames(nsIAtom* aListName,
nsIFrame* aPrevFrame,
nsIFrame* aFrameList)
{
NS_ASSERTION(!aPrevFrame || aPrevFrame->GetParent() == this,
"inserting after sibling frame with different parent");
if (nsnull != aListName) {
#ifdef IBMBIDI
if (aListName != nsLayoutAtoms::nextBidi)
#endif
return NS_ERROR_INVALID_ARG;
{
NS_ERROR("unexpected child list");
return NS_ERROR_INVALID_ARG;
}
}
if (aFrameList) {
// Insert frames after aPrevFrame
@@ -223,7 +232,10 @@ nsInlineFrame::RemoveFrame(nsIAtom* aListName,
#ifdef IBMBIDI
if (nsLayoutAtoms::nextBidi != aListName)
#endif
return NS_ERROR_INVALID_ARG;
{
NS_ERROR("unexpected child list");
return NS_ERROR_INVALID_ARG;
}
}
if (aOldFrame) {