Bug 1322570 Part 8 - Run debug code only if the style source is a gecko rule node.
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
--- a/layout/tables/nsTableColGroupFrame.cpp
+++ b/layout/tables/nsTableColGroupFrame.cpp
@@ -291,25 +291,28 @@ nsTableColGroupFrame::RemoveFrame(ChildL
contentRemoval = true;
// Remove any anonymous column frames this <col> produced via a colspan
nsTableColFrame* col = colFrame->GetNextCol();
nsTableColFrame* nextCol;
while (col && col->GetColType() == eColAnonymousCol) {
#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);
col = nextCol;
}
}
int32_t colIndex = colFrame->GetColIndex();