if (ColIsSpannedInto(colIndex)) {
if (ColIsSpannedInto(colIndex) || ColHasSpanningCells(colIndex)) {
nsTableFrame::CellChangedWidth(const nsTableCellFrame& aCellFrame,                               nscoord                 aPrevCellMin,                               nscoord                 aPrevCellMax,                               PRBool                  aCellWasDestroyed){  if (NeedStrategyInit() || !IsAutoLayout()) {    // if the strategy needs to be initialized, all of the col info will be updated later    // fixed layout tables do not cause any rebalancing    return PR_TRUE;  }  nscoord colSpan = GetEffectiveColSpan(aCellFrame);  if (colSpan > 1) {    // colspans are too complicated to optimize, so just bail out    SetNeedStrategyInit(PR_TRUE);    return PR_TRUE;  }  PRInt32 rowX, colIndex, numRows;  aCellFrame.GetColIndex(colIndex);    PRBool originates;  nsTableColFrame* colFrame = GetColFrame(colIndex);  if (!colFrame) return PR_TRUE; // should never happen  nscoord cellMin = (aCellWasDestroyed) ? 0 : aCellFrame.GetPass1MaxElementWidth();  nscoord cellMax = (aCellWasDestroyed) ? 0 : aCellFrame.GetMaximumWidth();  nscoord colMin  = colFrame->GetWidth(MIN_CON);  nscoord colMax  = colFrame->GetWidth(DES_CON);  PRBool colMinGetsBigger  = (cellMin > colMin);  PRBool colMinGetsSmaller = (cellMin < colMin) && (colMin == aPrevCellMin);  if (colMinGetsBigger || colMinGetsSmaller) {    if (ColIsSpannedInto(colIndex)) {      // bail out if a colspan is involved      SetNeedStrategyInit(PR_TRUE);      return PR_TRUE;    }    if (colMinGetsBigger) {      // update the columns's min width      colFrame->SetWidth(MIN_CON, cellMin);    }    else if (colMinGetsSmaller) {      // determine the new min width      numRows = GetRowCount();      nscoord minWidth = 0;      for (rowX = 0; rowX < numRows; rowX++) {        nsTableCellFrame* cellFrame = GetCellInfoAt(rowX, colIndex, &originates, &colSpan);        if (cellFrame && originates && (1 == colSpan)) {          minWidth = PR_MAX(minWidth, cellFrame->GetPass1MaxElementWidth());        }      }      // update the columns's new min width      colFrame->SetWidth(MIN_CON, minWidth);    }    // we should rebalance in case the min width determines the column width    SetNeedStrategyBalance(PR_TRUE);  }  PRBool colMaxGetsBigger  = (cellMax > colMax);  PRBool colMaxGetsSmaller = (cellMax < colMax) && (colMax == aPrevCellMax);  if (colMaxGetsBigger || colMaxGetsSmaller) {    if (ColIsSpannedInto(colIndex)) {      // bail out if a colspan is involved      SetNeedStrategyInit(PR_TRUE);      return PR_TRUE;    }    // see if the max width will be not be overshadowed by a pct, fix, or proportional width    if ((colFrame->GetWidth(PCT) <= 0) && (colFrame->GetWidth(FIX) <= 0) &&        (colFrame->GetWidth(MIN_PRO) <= 0)) {      // see if the doesn't have a pct width      const nsStylePosition* cellPosition;      aCellFrame.GetStyleData(eStyleStruct_Position, (const nsStyleStruct *&)cellPosition);      // see if there isn't a pct width on the cell      PRBool havePct = PR_FALSE;      if (eStyleUnit_Percent == cellPosition->mWidth.GetUnit()) {        float percent = cellPosition->mWidth.GetPercentValue();        if (percent > 0.0f) {          havePct = PR_TRUE;        }      }      if (!havePct) {        // see if there isn't a fix width on the cell        PRBool haveFix = PR_FALSE;        if (eStyleUnit_Coord == cellPosition->mWidth.GetUnit()) {          nscoord coordValue = cellPosition->mWidth.GetCoordValue();          if (coordValue > 0) {             haveFix = PR_TRUE;          }        }        if (!haveFix) {          // see if there isn't a prop width on the cell          PRBool haveProp = PR_FALSE;          if (eStyleUnit_Proportional == cellPosition->mWidth.GetUnit()) {            nscoord intValue = cellPosition->mWidth.GetIntValue();            if (intValue > 0) {               haveProp = PR_TRUE;            }          }          if (!haveProp) {            UpdateCol(*this, *colFrame, aCellFrame, cellMax, colMaxGetsBigger);            // we should rebalance in case the max width determines the column width            SetNeedStrategyBalance(PR_TRUE);          }        }      }    }    else {      UpdateCol(*this, *colFrame, aCellFrame, cellMax, colMaxGetsBigger);    }  }  return PR_FALSE;}