Bug 826195 - Tweak nsPrintObject sanity assertions. r=dholbert

This commit is contained in:
Cameron McCormack 2013-01-05 10:24:53 +11:00
parent b578c085d4
commit a19f744c11

View File

@ -104,12 +104,12 @@ AssertPresShellsAndContextsSane(nsPrintObject* aPO,
if (!aPO->mPresShell && aPO->mPresContext) { if (!aPO->mPresShell && aPO->mPresContext) {
ASSERT_AND_NOTE("print object has pres context but no pres shell"); ASSERT_AND_NOTE("print object has pres context but no pres shell");
} }
if (aPO->mPresContext && aPO->mPresContext->GetPresShell() != aPO->mPresShell) { if (aPO->mPresContext &&
aPO->mPresShell &&
aPO->mPresContext->GetPresShell() &&
aPO->mPresContext->GetPresShell() != aPO->mPresShell) {
ASSERT_AND_NOTE("print object has mismatching pres shell and pres context"); ASSERT_AND_NOTE("print object has mismatching pres shell and pres context");
} }
if (aPO->mPresContext && !aPO->mPresContext->GetPresShell()) {
ASSERT_AND_NOTE("mPresShell->GetPresShell() is null");
}
for (uint32_t i = 0; i < aPO->mKids.Length(); i++) { for (uint32_t i = 0; i < aPO->mKids.Length(); i++) {
AssertPresShellsAndContextsSane(aPO->mKids[i], aPresShells, aPresContexts); AssertPresShellsAndContextsSane(aPO->mKids[i], aPresShells, aPresContexts);