Bug 607494. Add assertions to catch creating frames for content nodes that already have a frame. r=bzbarsky a=blocking-final+

This commit is contained in:
Timothy Nikkel 2010-11-24 19:35:01 -06:00
parent d5f55db812
commit ada7022f3f

View File

@ -5041,6 +5041,13 @@ nsCSSFrameConstructor::AddFrameConstructionItems(nsFrameConstructorState& aState
~ELEMENT_PENDING_RESTYLE_FLAGS);
}
// XXX the GetContent() != aContent check is needed due to bug 135040.
// Remove it once that's fixed.
NS_ASSERTION(!aContent->GetPrimaryFrame() ||
aContent->GetPrimaryFrame()->GetContent() != aContent ||
aState.mCreatingExtraFrames,
"asked to create frame construction item for a node that already has a frame");
// don't create a whitespace frame if aParent doesn't want it
if (!NeedFrameFor(aState, aParentFrame, aContent)) {
return;
@ -6481,6 +6488,18 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
}
#endif
#ifdef DEBUG
for (nsIContent* child = aFirstNewContent;
child;
child = child->GetNextSibling()) {
// XXX the GetContent() != child check is needed due to bug 135040.
// Remove it once that's fixed.
NS_ASSERTION(!child->GetPrimaryFrame() ||
child->GetPrimaryFrame()->GetContent() != child,
"asked to construct a frame for a node that already has a frame");
}
#endif
#ifdef MOZ_XUL
if (aContainer) {
PRInt32 namespaceID;
@ -6832,6 +6851,18 @@ nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aContainer,
}
#endif
#ifdef DEBUG
for (nsIContent* child = aStartChild;
child != aEndChild;
child = child->GetNextSibling()) {
// XXX the GetContent() != child check is needed due to bug 135040.
// Remove it once that's fixed.
NS_ASSERTION(!child->GetPrimaryFrame() ||
child->GetPrimaryFrame()->GetContent() != child,
"asked to construct a frame for a node that already has a frame");
}
#endif
nsresult rv = NS_OK;
PRBool isSingleInsert = (aStartChild->GetNextSibling() == aEndChild);