[DEBUG only] Don't assert if the child frame is on the correct child overflow list. b=371681 r+sr=roc

This commit is contained in:
mats.palmgren%bredband.net 2007-02-28 12:27:12 +00:00
Родитель c064e81ce2
Коммит 7c8d48b603
1 изменённых файлов: 19 добавлений и 3 удалений

Просмотреть файл

@ -1747,9 +1747,25 @@ GetChildListNameFor(nsIFrame* aChildFrame)
listName = nsnull;
}
// Verify that the frame is actually in that child list
NS_POSTCONDITION(nsFrameList(aChildFrame->GetParent()->GetFirstChild(listName))
.ContainsFrame(aChildFrame), "not in child list");
#ifdef NS_DEBUG
// Verify that the frame is actually in that child list or in the
// corresponding overflow list.
nsIFrame* parent = aChildFrame->GetParent();
PRBool found = nsFrameList(parent->GetFirstChild(listName))
.ContainsFrame(aChildFrame);
if (!found) {
if (!(aChildFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW)) {
found = nsFrameList(parent->GetFirstChild(nsGkAtoms::overflowList))
.ContainsFrame(aChildFrame);
}
else if (aChildFrame->GetStyleDisplay()->IsFloating()) {
found = nsFrameList(parent->GetFirstChild(nsGkAtoms::overflowOutOfFlowList))
.ContainsFrame(aChildFrame);
}
// else it's positioned and should have been on the 'listName' child list.
NS_POSTCONDITION(found, "not in child list");
}
#endif
return listName;
}