зеркало из https://github.com/mozilla/pjs.git
Add checks to VerifyList that previous siblings match next siblings. (Bug 563584, patch 21) r=roc
This commit is contained in:
Родитель
6aaed7c6a6
Коммит
c2bbf775c6
|
@ -606,13 +606,16 @@ nsFrameList::VerifyList() const
|
||||||
|
|
||||||
// Simple algorithm to find a loop in a linked list -- advance pointers
|
// Simple algorithm to find a loop in a linked list -- advance pointers
|
||||||
// through it at speeds of 1 and 2, and if they ever get to be equal bail
|
// through it at speeds of 1 and 2, and if they ever get to be equal bail
|
||||||
|
NS_ASSERTION(!mFirstChild->GetPrevSibling(), "bad prev sibling pointer");
|
||||||
nsIFrame *first = mFirstChild, *second = mFirstChild;
|
nsIFrame *first = mFirstChild, *second = mFirstChild;
|
||||||
do {
|
for (;;) {
|
||||||
first = first->GetNextSibling();
|
first = first->GetNextSibling();
|
||||||
second = second->GetNextSibling();
|
second = second->GetNextSibling();
|
||||||
if (!second) {
|
if (!second) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
NS_ASSERTION(second->GetPrevSibling()->GetNextSibling() == second,
|
||||||
|
"bad prev sibling pointer");
|
||||||
second = second->GetNextSibling();
|
second = second->GetNextSibling();
|
||||||
if (first == second) {
|
if (first == second) {
|
||||||
// Loop detected! Since second advances faster, they can't both be null;
|
// Loop detected! Since second advances faster, they can't both be null;
|
||||||
|
@ -620,7 +623,12 @@ nsFrameList::VerifyList() const
|
||||||
NS_ERROR("loop in frame list. This will probably hang soon.");
|
NS_ERROR("loop in frame list. This will probably hang soon.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} while (first && second);
|
if (!second) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
NS_ASSERTION(second->GetPrevSibling()->GetNextSibling() == second,
|
||||||
|
"bad prev sibling pointer");
|
||||||
|
}
|
||||||
|
|
||||||
NS_ASSERTION(mLastChild == nsLayoutUtils::GetLastSibling(mFirstChild),
|
NS_ASSERTION(mLastChild == nsLayoutUtils::GetLastSibling(mFirstChild),
|
||||||
"bogus mLastChild");
|
"bogus mLastChild");
|
||||||
|
|
Загрузка…
Ссылка в новой задаче