Bug 1322570 Part 8 - Run debug code only if the style source is a gecko rule node. r=bholley

Per bug 1322570 comment 27, the debug code is only useful in Gecko-backed
style system. To prevent the assertion in nsStyleContext::GetParent() when
running stylo, run them only in gecko.

MozReview-Commit-ID: DOcJ3T7vS1J

--HG--
extra : rebase_source : 33fd6caaa4ada9530fe8d874b827d91ac355e0c1
This commit is contained in:
Ting-Yu Lin 2017-03-20 17:05:16 +08:00
parent fd01a09628
commit 9e0bdb7f1e

View File

@ -296,15 +296,18 @@ nsTableColGroupFrame::RemoveFrame(ChildListID aListID,
#ifdef DEBUG
nsIFrame* providerFrame;
nsStyleContext* psc = colFrame->GetParentStyleContext(&providerFrame);
if (colFrame->StyleContext()->GetParent() == psc) {
NS_ASSERTION(col->StyleContext() == colFrame->StyleContext() &&
col->GetContent() == colFrame->GetContent(),
"How did that happen??");
if (psc->StyleSource().IsGeckoRuleNodeOrNull()) {
// This check code is useful only in Gecko-backed style system.
if (colFrame->StyleContext()->GetParent() == psc) {
NS_ASSERTION(col->StyleContext() == colFrame->StyleContext() &&
col->GetContent() == colFrame->GetContent(),
"How did that happen??");
}
// else colFrame is being removed because of a frame
// reconstruct on it, and its style context is still the old
// one, so we can't assert anything about how it compares to
// col's style context.
}
// else colFrame is being removed because of a frame
// reconstruct on it, and its style context is still the old
// one, so we can't assert anything about how it compares to
// col's style context.
#endif
nextCol = col->GetNextCol();
RemoveFrame(kPrincipalList, col);