Make sure to remove anonymous cols created by a <col span="n"> when that col is removed. Bug 399209, r=bernd, sr+a=roc

This commit is contained in:
2007-11-08 22:05:19 -08:00
parent d1c93a1d22
commit 6386a6c3c5

View File

@@ -316,6 +316,20 @@ nsTableColGroupFrame::RemoveFrame(nsIAtom* aListName,
if (nsGkAtoms::tableColFrame == aOldFrame->GetType()) {
nsTableColFrame* colFrame = (nsTableColFrame*)aOldFrame;
if (colFrame->GetColType() == eColContent) {
// Remove any anonymous column frames this <col> produced via a colspan
nsTableColFrame* col = colFrame->GetNextCol();
nsTableColFrame* nextCol;
while (col && col->GetColType() == eColAnonymousCol) {
NS_ASSERTION(col->GetStyleContext() == colFrame->GetStyleContext() &&
col->GetContent() == colFrame->GetContent(),
"How did that happen??");
nextCol = col->GetNextCol();
RemoveFrame(nsnull, col);
col = nextCol;
}
}
PRInt32 colIndex = colFrame->GetColIndex();
RemoveChild(*colFrame, PR_TRUE);