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

This commit is contained in:
mats.palmgren@bredband.net
2006-06-29 02:32:36 +00:00
parent 4a93e16131
commit c543d48c5c
14 changed files with 149 additions and 36 deletions

View File

@@ -9636,11 +9636,17 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
if (NS_SUCCEEDED(rv) && newCaptionFrame) {
nsIFrame* outerTableFrame;
if (GetCaptionAdjustedParent(parentFrame, newCaptionFrame, &outerTableFrame)) {
// If we did adjust the parent then the calculated insertion point is
// now invalid (bug 341382).
if (parentFrame != outerTableFrame) {
prevSibling = nsnull;
}
// If the parent is not a outer table frame we will try to add frames
// to a named child list that the parent does not honour and the frames
// will get lost
NS_ASSERTION(nsLayoutAtoms::tableOuterFrame == outerTableFrame->GetType(),
"Pseudo frame construction failure, a caption can be only a child of a outer table frame");
"Pseudo frame construction failure, "
"a caption can be only a child of a outer table frame");
if (isAppend) {
state.mFrameManager->AppendFrames(outerTableFrame,
nsLayoutAtoms::captionList,