diff --git a/layout/tables/nsTableColGroupFrame.cpp b/layout/tables/nsTableColGroupFrame.cpp index e6d5a6d12a5..c6b162b70f6 100644 --- a/layout/tables/nsTableColGroupFrame.cpp +++ b/layout/tables/nsTableColGroupFrame.cpp @@ -212,10 +212,13 @@ nsTableColGroupFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext) return; nsTableFrame* tableFrame = nsTableFrame::GetTableFrame(this); - + if (tableFrame->IsBorderCollapse() && tableFrame->BCRecalcNeeded(aOldStyleContext, GetStyleContext())) { - nsRect damageArea(GetFirstColumn()->GetColIndex(), 0, GetColCount(), + PRInt32 colCount = GetColCount(); + if (!colCount) + return; // this is a degenerated colgroup + nsRect damageArea(GetFirstColumn()->GetColIndex(), 0, colCount, tableFrame->GetRowCount()); tableFrame->SetBCDamageArea(damageArea); }