diff --git a/layout/mathml/nsMathMLmtableFrame.cpp b/layout/mathml/nsMathMLmtableFrame.cpp index 57005a912473..4d3d7de506a4 100644 --- a/layout/mathml/nsMathMLmtableFrame.cpp +++ b/layout/mathml/nsMathMLmtableFrame.cpp @@ -233,24 +233,24 @@ ComputeBorderOverflow(nsMathMLmtdFrame* aFrame, nsStyleBorder aStyleBorder) nsTableFrame* table = nsTableFrame::GetTableFrame(aFrame); aFrame->GetCellIndexes(rowIndex, columnIndex); if (!columnIndex) { - overflow.left = table->GetCellSpacingX(-1); - overflow.right = table->GetCellSpacingX(0) / 2; + overflow.left = table->GetColSpacing(-1); + overflow.right = table->GetColSpacing(0) / 2; } else if (columnIndex == table->GetColCount() - 1) { - overflow.left = table->GetCellSpacingX(columnIndex - 1) / 2; - overflow.right = table->GetCellSpacingX(columnIndex + 1); + overflow.left = table->GetColSpacing(columnIndex - 1) / 2; + overflow.right = table->GetColSpacing(columnIndex + 1); } else { - overflow.left = table->GetCellSpacingX(columnIndex - 1) / 2; - overflow.right = table->GetCellSpacingX(columnIndex) / 2; + overflow.left = table->GetColSpacing(columnIndex - 1) / 2; + overflow.right = table->GetColSpacing(columnIndex) / 2; } if (!rowIndex) { - overflow.top = table->GetCellSpacingY(-1); - overflow.bottom = table->GetCellSpacingY(0) / 2; + overflow.top = table->GetRowSpacing(-1); + overflow.bottom = table->GetRowSpacing(0) / 2; } else if (rowIndex == table->GetRowCount() - 1) { - overflow.top = table->GetCellSpacingY(rowIndex - 1) / 2; - overflow.bottom = table->GetCellSpacingY(rowIndex + 1); + overflow.top = table->GetRowSpacing(rowIndex - 1) / 2; + overflow.bottom = table->GetRowSpacing(rowIndex + 1); } else { - overflow.top = table->GetCellSpacingY(rowIndex - 1) / 2; - overflow.bottom = table->GetCellSpacingY(rowIndex) / 2; + overflow.top = table->GetRowSpacing(rowIndex - 1) / 2; + overflow.bottom = table->GetRowSpacing(rowIndex) / 2; } return overflow; } @@ -925,10 +925,10 @@ nsMathMLmtableFrame::RestyleTable() } nscoord -nsMathMLmtableFrame::GetCellSpacingX(int32_t aColIndex) +nsMathMLmtableFrame::GetColSpacing(int32_t aColIndex) { if (mUseCSSSpacing) { - return nsTableFrame::GetCellSpacingX(aColIndex); + return nsTableFrame::GetColSpacing(aColIndex); } if (!mColSpacing.Length()) { NS_ERROR("mColSpacing should not be empty"); @@ -946,11 +946,11 @@ nsMathMLmtableFrame::GetCellSpacingX(int32_t aColIndex) } nscoord -nsMathMLmtableFrame::GetCellSpacingX(int32_t aStartColIndex, +nsMathMLmtableFrame::GetColSpacing(int32_t aStartColIndex, int32_t aEndColIndex) { if (mUseCSSSpacing) { - return nsTableFrame::GetCellSpacingX(aStartColIndex, aEndColIndex); + return nsTableFrame::GetColSpacing(aStartColIndex, aEndColIndex); } if (aStartColIndex == aEndColIndex) { return 0; @@ -985,10 +985,10 @@ nsMathMLmtableFrame::GetCellSpacingX(int32_t aStartColIndex, } nscoord -nsMathMLmtableFrame::GetCellSpacingY(int32_t aRowIndex) +nsMathMLmtableFrame::GetRowSpacing(int32_t aRowIndex) { if (mUseCSSSpacing) { - return nsTableFrame::GetCellSpacingY(aRowIndex); + return nsTableFrame::GetRowSpacing(aRowIndex); } if (!mRowSpacing.Length()) { NS_ERROR("mRowSpacing should not be empty"); @@ -1006,11 +1006,11 @@ nsMathMLmtableFrame::GetCellSpacingY(int32_t aRowIndex) } nscoord -nsMathMLmtableFrame::GetCellSpacingY(int32_t aStartRowIndex, +nsMathMLmtableFrame::GetRowSpacing(int32_t aStartRowIndex, int32_t aEndRowIndex) { if (mUseCSSSpacing) { - return nsTableFrame::GetCellSpacingY(aStartRowIndex, aEndRowIndex); + return nsTableFrame::GetRowSpacing(aStartRowIndex, aEndRowIndex); } if (aStartRowIndex == aEndRowIndex) { return 0; diff --git a/layout/mathml/nsMathMLmtableFrame.h b/layout/mathml/nsMathMLmtableFrame.h index 8ce2f1d14b67..81f48ffcf2f3 100644 --- a/layout/mathml/nsMathMLmtableFrame.h +++ b/layout/mathml/nsMathMLmtableFrame.h @@ -110,23 +110,23 @@ public: // safer (albeit grossly suboptimal) to just relayout the whole thing. void RestyleTable(); - /** helper to get the cell spacing X style value */ - nscoord GetCellSpacingX(int32_t aColIndex) MOZ_OVERRIDE; + /** helper to get the column spacing style value */ + nscoord GetColSpacing(int32_t aColIndex) MOZ_OVERRIDE; /** Sums the combined cell spacing between the columns aStartColIndex to * aEndColIndex. */ - nscoord GetCellSpacingX(int32_t aStartColIndex, - int32_t aEndColIndex) MOZ_OVERRIDE; + nscoord GetColSpacing(int32_t aStartColIndex, + int32_t aEndColIndex) MOZ_OVERRIDE; - /** helper to get the cell spacing Y style value */ - nscoord GetCellSpacingY(int32_t aRowIndex) MOZ_OVERRIDE; + /** helper to get the row spacing style value */ + nscoord GetRowSpacing(int32_t aRowIndex) MOZ_OVERRIDE; /** Sums the combined cell spacing between the rows aStartRowIndex to * aEndRowIndex. */ - nscoord GetCellSpacingY(int32_t aStartRowIndex, - int32_t aEndRowIndex) MOZ_OVERRIDE; + nscoord GetRowSpacing(int32_t aStartRowIndex, + int32_t aEndRowIndex) MOZ_OVERRIDE; void SetColSpacingArray(const nsTArray& aColSpacing) { diff --git a/layout/tables/BasicTableLayoutStrategy.cpp b/layout/tables/BasicTableLayoutStrategy.cpp index 021e1b52e83a..e5e822ffb575 100644 --- a/layout/tables/BasicTableLayoutStrategy.cpp +++ b/layout/tables/BasicTableLayoutStrategy.cpp @@ -440,7 +440,7 @@ BasicTableLayoutStrategy::ComputeIntrinsicISizes(nsRenderingContext* aRenderingC int32_t colCount = cellMap->GetColCount(); // add a total of (colcount + 1) lots of cellSpacingX for columns where a // cell originates - nscoord add = mTableFrame->GetCellSpacingX(colCount); + nscoord add = mTableFrame->GetColSpacing(colCount); for (int32_t col = 0; col < colCount; ++col) { nsTableColFrame *colFrame = mTableFrame->GetColFrame(col); @@ -449,7 +449,7 @@ BasicTableLayoutStrategy::ComputeIntrinsicISizes(nsRenderingContext* aRenderingC continue; } if (mTableFrame->ColumnHasCellSpacingBefore(col)) { - add += mTableFrame->GetCellSpacingX(col - 1); + add += mTableFrame->GetColSpacing(col - 1); } min += colFrame->GetMinCoord(); pref = NSCoordSaturatingAdd(pref, colFrame->GetPrefCoord()); @@ -665,15 +665,15 @@ BasicTableLayoutStrategy::DistributeWidthToColumns(nscoord aWidth, for (int32_t col = aFirstCol + 1; col < aFirstCol + aColCount; ++col) { if (mTableFrame->ColumnHasCellSpacingBefore(col)) { // border-spacing isn't part of the basis for percentages. - subtract += mTableFrame->GetCellSpacingX(col - 1); + subtract += mTableFrame->GetColSpacing(col - 1); } } if (aWidthType == BTLS_FINAL_WIDTH) { // If we're computing final col-width, then aWidth initially includes // border spacing on the table's far left + far right edge, too. Need // to subtract those out, too. - subtract += (mTableFrame->GetCellSpacingX(-1) + - mTableFrame->GetCellSpacingX(aColCount)); + subtract += (mTableFrame->GetColSpacing(-1) + + mTableFrame->GetColSpacing(aColCount)); } aWidth = NSCoordSaturatingSubtract(aWidth, subtract, nscoord_MAX); diff --git a/layout/tables/FixedTableLayoutStrategy.cpp b/layout/tables/FixedTableLayoutStrategy.cpp index 9ed8c282a78e..1f8837667050 100644 --- a/layout/tables/FixedTableLayoutStrategy.cpp +++ b/layout/tables/FixedTableLayoutStrategy.cpp @@ -55,7 +55,7 @@ FixedTableLayoutStrategy::GetMinISize(nsRenderingContext* aRenderingContext) nscoord result = 0; if (colCount > 0) { - result += mTableFrame->GetCellSpacingX(-1, colCount); + result += mTableFrame->GetColSpacing(-1, colCount); } for (int32_t col = 0; col < colCount; ++col) { @@ -64,7 +64,7 @@ FixedTableLayoutStrategy::GetMinISize(nsRenderingContext* aRenderingContext) NS_ERROR("column frames out of sync with cell map"); continue; } - nscoord spacing = mTableFrame->GetCellSpacingX(col); + nscoord spacing = mTableFrame->GetColSpacing(col); const nsStyleCoord *styleWidth = &colFrame->StylePosition()->mWidth; if (styleWidth->ConvertsToLength()) { @@ -168,7 +168,7 @@ FixedTableLayoutStrategy::ComputeColumnWidths(const nsHTMLReflowState& aReflowSt } // border-spacing isn't part of the basis for percentages. - tableWidth -= mTableFrame->GetCellSpacingX(-1, colCount); + tableWidth -= mTableFrame->GetColSpacing(-1, colCount); // store the old column widths. We might call multiple times SetFinalWidth // on the columns, due to this we can't compare at the last call that the @@ -280,7 +280,7 @@ FixedTableLayoutStrategy::ComputeColumnWidths(const nsHTMLReflowState& aReflowSt // row, split up the space evenly. (XXX This // isn't quite right if some of the columns it's // in have specified widths. Should we care?) - nscoord spacing = mTableFrame->GetCellSpacingX(col); + nscoord spacing = mTableFrame->GetColSpacing(col); colWidth = ((colWidth + spacing) / colSpan) - spacing; if (colWidth < 0) colWidth = 0; diff --git a/layout/tables/nsTableCellFrame.cpp b/layout/tables/nsTableCellFrame.cpp index f3ede239221a..2c17c347b8b3 100644 --- a/layout/tables/nsTableCellFrame.cpp +++ b/layout/tables/nsTableCellFrame.cpp @@ -840,8 +840,8 @@ CalcUnpaginagedHeight(nsPresContext* aPresContext, firstCellInFlow->GetRowIndex(rowIndex); int32_t rowSpan = aTableFrame.GetEffectiveRowSpan(*firstCellInFlow); - nscoord computedHeight = firstTableInFlow->GetCellSpacingY(rowIndex, - rowIndex + rowSpan - 1); + nscoord computedHeight = firstTableInFlow->GetRowSpacing(rowIndex, + rowIndex + rowSpan - 1); computedHeight -= aVerticalBorderPadding; int32_t rowX; for (row = firstRGInFlow->GetFirstRow(), rowX = 0; row; row = row->GetNextRow(), rowX++) { diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index 9a7b1eebf4aa..8e5dad3818dd 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -86,23 +86,23 @@ struct nsTableReflowState { nsTableFrame* table = static_cast(aTableFrame.FirstInFlow()); nsMargin borderPadding = table->GetChildAreaOffset(&reflowState); - x = borderPadding.left + table->GetCellSpacingX(-1); + x = borderPadding.left + table->GetColSpacing(-1); y = borderPadding.top; //cellspacing added during reflow availSize.width = aAvailWidth; if (NS_UNCONSTRAINEDSIZE != availSize.width) { int32_t colCount = table->GetColCount(); availSize.width -= borderPadding.left + borderPadding.right - + table->GetCellSpacingX(-1) - + table->GetCellSpacingX(colCount); + + table->GetColSpacing(-1) + + table->GetColSpacing(colCount); availSize.width = std::max(0, availSize.width); } availSize.height = aAvailHeight; if (NS_UNCONSTRAINEDSIZE != availSize.height) { availSize.height -= borderPadding.top + borderPadding.bottom - + table->GetCellSpacingY(-1) - + table->GetCellSpacingY(table->GetRowCount()); + + table->GetRowSpacing(-1) + + table->GetRowSpacing(table->GetRowCount()); availSize.height = std::max(0, availSize.height); } } @@ -1423,17 +1423,17 @@ nsTableFrame::SetColumnDimensions(nscoord aHeight, const nsMargin& aBorderPadding) { nscoord colHeight = aHeight -= aBorderPadding.top + aBorderPadding.bottom + - GetCellSpacingY(-1) + - GetCellSpacingY(GetRowCount()); + GetRowSpacing(-1) + + GetRowSpacing(GetRowCount()); nsTableIterator iter(mColGroups); nsIFrame* colGroupFrame = iter.First(); bool tableIsLTR = StyleVisibility()->mDirection == NS_STYLE_DIRECTION_LTR; int32_t colX =tableIsLTR ? 0 : std::max(0, GetColCount() - 1); - nscoord cellSpacingX = GetCellSpacingX(colX); + nscoord cellSpacingX = GetColSpacing(colX); int32_t tableColIncr = tableIsLTR ? 1 : -1; - nsPoint colGroupOrigin(aBorderPadding.left + GetCellSpacingX(-1), - aBorderPadding.top + GetCellSpacingY(-1)); + nsPoint colGroupOrigin(aBorderPadding.left + GetColSpacing(-1), + aBorderPadding.top + GetRowSpacing(-1)); while (colGroupFrame) { MOZ_ASSERT(colGroupFrame->GetType() == nsGkAtoms::tableColGroupFrame); nscoord colGroupWidth = 0; @@ -1447,7 +1447,7 @@ nsTableFrame::SetColumnDimensions(nscoord aHeight, nscoord colWidth = GetColumnWidth(colX); nsRect colRect(colOrigin.x, colOrigin.y, colWidth, colHeight); colFrame->SetRect(colRect); - cellSpacingX = GetCellSpacingX(colX); + cellSpacingX = GetColSpacing(colX); colOrigin.x += colWidth + cellSpacingX; colGroupWidth += colWidth + cellSpacingX; colX += tableColIncr; @@ -1878,7 +1878,7 @@ nsTableFrame::Reflow(nsPresContext* aPresContext, if (lastChildReflowed && NS_FRAME_IS_NOT_COMPLETE(aStatus)) { // if there is an incomplete child, then set the desired height to include it but not the next one nsMargin borderPadding = GetChildAreaOffset(&aReflowState); - aDesiredSize.Height() = borderPadding.bottom + GetCellSpacingY(GetRowCount()) + + aDesiredSize.Height() = borderPadding.bottom + GetRowSpacing(GetRowCount()) + lastChildReflowed->GetNormalRect().YMost(); } haveDesiredHeight = true; @@ -2141,8 +2141,8 @@ nsTableFrame::AdjustForCollapsingRowsCols(nsHTMLReflowMetrics& aDesiredSize, nsTableFrame* firstInFlow = static_cast(FirstInFlow()); nscoord width = firstInFlow->GetCollapsedWidth(aBorderPadding); - nscoord rgWidth = width - GetCellSpacingX(-1) - - GetCellSpacingX(GetColCount()); + nscoord rgWidth = width - GetColSpacing(-1) - + GetColSpacing(GetColCount()); nsOverflowAreas overflow; // Walk the list of children for (uint32_t childX = 0; childX < rowGroups.Length(); childX++) { @@ -2164,7 +2164,7 @@ nscoord nsTableFrame::GetCollapsedWidth(nsMargin aBorderPadding) { NS_ASSERTION(!GetPrevInFlow(), "GetCollapsedWidth called on next in flow"); - nscoord width = GetCellSpacingX(GetColCount()); + nscoord width = GetColSpacing(GetColCount()); width += aBorderPadding.left + aBorderPadding.right; for (nsIFrame* groupFrame = mColGroups.FirstChild(); groupFrame; groupFrame = groupFrame->GetNextSibling()) { @@ -2182,7 +2182,7 @@ nsTableFrame::GetCollapsedWidth(nsMargin aBorderPadding) if (!collapseGroup && !collapseCol) { width += colWidth; if (ColumnHasCellSpacingBefore(colX)) - width += GetCellSpacingX(colX-1); + width += GetColSpacing(colX-1); } else { SetNeedToCollapse(true); @@ -2867,7 +2867,7 @@ nsTableFrame::PlaceRepeatedFooter(nsTableReflowState& aReflowState, -1, -1, nsHTMLReflowState::CALLER_WILL_INIT); InitChildReflowState(footerReflowState); - aReflowState.y += GetCellSpacingY(GetRowCount()); + aReflowState.y += GetRowSpacing(GetRowCount()); nsRect origTfootRect = aTfoot->GetRect(); nsRect origTfootVisualOverflow = aTfoot->GetVisualOverflowRect(); @@ -2944,8 +2944,8 @@ nsTableFrame::ReflowChildren(nsTableReflowState& aReflowState, for (size_t childX = 0; childX < rowGroups.Length(); childX++) { nsIFrame* kidFrame = rowGroups[childX]; nsTableRowGroupFrame* rowGroupFrame = rowGroups[childX]; - nscoord cellSpacingY = GetCellSpacingY(rowGroupFrame->GetStartRowIndex()+ - rowGroupFrame->GetRowCount()); + nscoord cellSpacingY = GetRowSpacing(rowGroupFrame->GetStartRowIndex()+ + rowGroupFrame->GetRowCount()); // Get the frame state bits // See if we should only reflow the dirty child frames if (reflowAllKids || @@ -3228,11 +3228,11 @@ nsTableFrame::CalcDesiredHeight(const nsHTMLReflowState& aReflowState, nsHTMLRef int32_t colCount = cellMap->GetColCount(); nscoord desiredHeight = borderPadding.top + borderPadding.bottom; if (rowCount > 0 && colCount > 0) { - desiredHeight += GetCellSpacingY(-1); + desiredHeight += GetRowSpacing(-1); for (uint32_t rgX = 0; rgX < rowGroups.Length(); rgX++) { desiredHeight += rowGroups[rgX]->GetSize().height + - GetCellSpacingY(rowGroups[rgX]->GetRowCount() + - rowGroups[rgX]->GetStartRowIndex()); + GetRowSpacing(rowGroups[rgX]->GetRowCount() + + rowGroups[rgX]->GetStartRowIndex()); } } @@ -3298,8 +3298,8 @@ nsTableFrame::DistributeHeightToRows(const nsHTMLReflowState& aReflowState, // distribute space to each pct height row whose row group doesn't have a computed // height, and base the pct on the table height. If the row group had a computed // height, then this was already done in nsTableRowGroupFrame::CalculateRowHeights - nscoord pctBasis = aReflowState.ComputedHeight() - GetCellSpacingY(-1, GetRowCount()); - nscoord yOriginRG = borderPadding.top + GetCellSpacingY(0); + nscoord pctBasis = aReflowState.ComputedHeight() - GetRowSpacing(-1, GetRowCount()); + nscoord yOriginRG = borderPadding.top + GetRowSpacing(0); nscoord yEndRG = yOriginRG; uint32_t rgX; for (rgX = 0; rgX < rowGroups.Length(); rgX++) { @@ -3311,7 +3311,7 @@ nsTableFrame::DistributeHeightToRows(const nsHTMLReflowState& aReflowState, nsTableRowFrame* rowFrame = rgFrame->GetFirstRow(); while (rowFrame) { nsRect rowNormalRect = rowFrame->GetNormalRect(); - nscoord cellSpacingY = GetCellSpacingY(rowFrame->GetRowIndex()); + nscoord cellSpacingY = GetRowSpacing(rowFrame->GetRowIndex()); if ((amountUsed < aAmount) && rowFrame->HasPctHeight()) { nscoord pctHeight = rowFrame->GetHeight(pctBasis); nscoord amountForRow = std::min(aAmount - amountUsed, @@ -3437,7 +3437,7 @@ nsTableFrame::DistributeHeightToRows(const nsHTMLReflowState& aReflowState, } // allocate the extra height to the unstyled row groups and rows nscoord heightToDistribute = aAmount - amountUsed; - yOriginRG = borderPadding.top + GetCellSpacingY(-1); + yOriginRG = borderPadding.top + GetRowSpacing(-1); yEndRG = yOriginRG; for (rgX = 0; rgX < rowGroups.Length(); rgX++) { nsTableRowGroupFrame* rgFrame = rowGroups[rgX]; @@ -3449,7 +3449,7 @@ nsTableFrame::DistributeHeightToRows(const nsHTMLReflowState& aReflowState, if (!firstUnStyledRG || !rgFrame->HasStyleHeight() || !eligibleRows) { nsTableRowFrame* rowFrame = rgFrame->GetFirstRow(); while (rowFrame) { - nscoord cellSpacingY = GetCellSpacingY(rowFrame->GetRowIndex()); + nscoord cellSpacingY = GetRowSpacing(rowFrame->GetRowIndex()); nsRect rowNormalRect = rowFrame->GetNormalRect(); nsRect rowVisualOverflow = rowFrame->GetVisualOverflowRect(); // see if there is an eligible row or we distribute to all rows @@ -3547,7 +3547,7 @@ int32_t nsTableFrame::GetColumnWidth(int32_t aColIndex) return firstInFlow->GetColumnWidth(aColIndex); } -nscoord nsTableFrame::GetCellSpacingX() +nscoord nsTableFrame::GetColSpacing() { if (IsBorderCollapse()) return 0; @@ -3556,17 +3556,17 @@ nscoord nsTableFrame::GetCellSpacingX() } // XXX: could cache this. But be sure to check style changes if you do! -nscoord nsTableFrame::GetCellSpacingX(int32_t aColIndex) +nscoord nsTableFrame::GetColSpacing(int32_t aColIndex) { NS_ASSERTION(aColIndex >= -1 && aColIndex <= GetColCount(), "Column index exceeds the bounds of the table"); // Index is irrelevant for ordinary tables. We check that it falls within // appropriate bounds to increase confidence of correctness in situations // where it does matter. - return GetCellSpacingX(); + return GetColSpacing(); } -nscoord nsTableFrame::GetCellSpacingX(int32_t aStartColIndex, +nscoord nsTableFrame::GetColSpacing(int32_t aStartColIndex, int32_t aEndColIndex) { NS_ASSERTION(aStartColIndex >= -1 && aStartColIndex <= GetColCount(), @@ -3577,10 +3577,10 @@ nscoord nsTableFrame::GetCellSpacingX(int32_t aStartColIndex, "End index must not be less than start index"); // Only one possible value so just multiply it out. Tables where index // matters will override this function - return GetCellSpacingX() * (aEndColIndex - aStartColIndex); + return GetColSpacing() * (aEndColIndex - aStartColIndex); } -nscoord nsTableFrame::GetCellSpacingY() +nscoord nsTableFrame::GetRowSpacing() { if (IsBorderCollapse()) return 0; @@ -3589,17 +3589,17 @@ nscoord nsTableFrame::GetCellSpacingY() } // XXX: could cache this. But be sure to check style changes if you do! -nscoord nsTableFrame::GetCellSpacingY(int32_t aRowIndex) +nscoord nsTableFrame::GetRowSpacing(int32_t aRowIndex) { NS_ASSERTION(aRowIndex >= -1 && aRowIndex <= GetRowCount(), "Row index exceeds the bounds of the table"); // Index is irrelevant for ordinary tables. We check that it falls within // appropriate bounds to increase confidence of correctness in situations // where it does matter. - return GetCellSpacingY(); + return GetRowSpacing(); } -nscoord nsTableFrame::GetCellSpacingY(int32_t aStartRowIndex, +nscoord nsTableFrame::GetRowSpacing(int32_t aStartRowIndex, int32_t aEndRowIndex) { NS_ASSERTION(aStartRowIndex >= -1 && aStartRowIndex <= GetRowCount(), @@ -3610,7 +3610,7 @@ nscoord nsTableFrame::GetCellSpacingY(int32_t aStartRowIndex, "End index must not be less than start index"); // Only one possible value so just multiply it out. Tables where index // matters will override this function - return GetCellSpacingY() * (aEndRowIndex - aStartRowIndex); + return GetRowSpacing() * (aEndRowIndex - aStartRowIndex); } /* virtual */ nscoord diff --git a/layout/tables/nsTableFrame.h b/layout/tables/nsTableFrame.h index 185380592a76..ee20f9893b5a 100644 --- a/layout/tables/nsTableFrame.h +++ b/layout/tables/nsTableFrame.h @@ -386,7 +386,7 @@ public: /** return the width of the column at aColIndex */ int32_t GetColumnWidth(int32_t aColIndex); - /** Helper to get the cell spacing X style value. + /** Helper to get the column spacing style value. * The argument refers to the space between column aColIndex and column * aColIndex + 1. An index of -1 indicates the padding between the table * and the left border, an index equal to the number of columns indicates @@ -395,7 +395,7 @@ public: * Although in this class cell spacing does not depend on the index, it * may be important for overriding classes. */ - virtual nscoord GetCellSpacingX(int32_t aColIndex); + virtual nscoord GetColSpacing(int32_t aColIndex); /** Helper to find the sum of the cell spacing between arbitrary columns. * The argument refers to the space between column aColIndex and column @@ -406,14 +406,14 @@ public: * This method is equivalent to * nscoord result = 0; * for (i = aStartColIndex; i < aEndColIndex; i++) { - * result += GetCellSpacingX(i); + * result += GetColSpacing(i); * } * return result; */ - virtual nscoord GetCellSpacingX(int32_t aStartColIndex, - int32_t aEndColIndex); + virtual nscoord GetColSpacing(int32_t aStartColIndex, + int32_t aEndColIndex); - /** Helper to get the cell spacing Y style value. + /** Helper to get the row spacing style value. * The argument refers to the space between row aRowIndex and row * aRowIndex + 1. An index of -1 indicates the padding between the table * and the top border, an index equal to the number of rows indicates @@ -422,7 +422,7 @@ public: * Although in this class cell spacing does not depend on the index, it * may be important for overriding classes. */ - virtual nscoord GetCellSpacingY(int32_t aRowIndex); + virtual nscoord GetRowSpacing(int32_t aRowIndex); /** Helper to find the sum of the cell spacing between arbitrary rows. * The argument refers to the space between row aRowIndex and row @@ -433,19 +433,19 @@ public: * This method is equivalent to * nscoord result = 0; * for (i = aStartRowIndex; i < aEndRowIndex; i++) { - * result += GetCellSpacingY(i); + * result += GetRowSpacing(i); * } * return result; */ - virtual nscoord GetCellSpacingY(int32_t aStartRowIndex, + virtual nscoord GetRowSpacing(int32_t aStartRowIndex, int32_t aEndRowIndex); private: /* For the base implementation of nsTableFrame, cell spacing does not depend * on row/column indexing. */ - nscoord GetCellSpacingX(); - nscoord GetCellSpacingY(); + nscoord GetColSpacing(); + nscoord GetRowSpacing(); public: virtual nscoord GetLogicalBaseline(mozilla::WritingMode aWritingMode) const MOZ_OVERRIDE; diff --git a/layout/tables/nsTableRowFrame.cpp b/layout/tables/nsTableRowFrame.cpp index de12a15c6fcf..d9f1ca5d32e0 100644 --- a/layout/tables/nsTableRowFrame.cpp +++ b/layout/tables/nsTableRowFrame.cpp @@ -287,7 +287,7 @@ GetHeightOfRowsSpannedBelowFirst(nsTableCellFrame& aTableCellFrame, height += nextRow->GetSize().height; rowX++; } - height += aTableFrame.GetCellSpacingY(rowX); + height += aTableFrame.GetRowSpacing(rowX); nextRow = nextRow->GetNextSibling(); } return height; @@ -683,7 +683,7 @@ CalcAvailWidth(nsTableFrame& aTableFrame, cellAvailWidth += aTableFrame.GetColumnWidth(colIndex + spanX); if (spanX > 0 && aTableFrame.ColumnHasCellSpacingBefore(colIndex + spanX)) { - cellAvailWidth += aTableFrame.GetCellSpacingX(colIndex + spanX - 1); + cellAvailWidth += aTableFrame.GetColSpacing(colIndex + spanX - 1); } } return cellAvailWidth; @@ -718,7 +718,7 @@ GetSpaceBetween(int32_t aPrevColIndex, space += aTableFrame.GetColumnWidth(colX); } if (!isCollapsed && aTableFrame.ColumnHasCellSpacingBefore(colX)) { - space += aTableFrame.GetCellSpacingX(colX - 1); + space += aTableFrame.GetColSpacing(colX - 1); } } } @@ -742,7 +742,7 @@ GetSpaceBetween(int32_t aPrevColIndex, space += aTableFrame.GetColumnWidth(colX); } if (!isCollapsed && aTableFrame.ColumnHasCellSpacingBefore(colX)) { - space += aTableFrame.GetCellSpacingX(colX - 1); + space += aTableFrame.GetColSpacing(colX - 1); } } } @@ -988,7 +988,7 @@ nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext, } } ConsiderChildOverflow(aDesiredSize.mOverflowAreas, kidFrame); - x += aTableFrame.GetCellSpacingX(cellColIndex); + x += aTableFrame.GetColSpacing(cellColIndex); } // just set our width to what was available. The table will calculate the width and not use our value. @@ -1168,7 +1168,7 @@ nsTableRowFrame::CollapseRowIfNecessary(nscoord aRowOffset, if (cellFrame) { int32_t rowIndex; cellFrame->GetRowIndex(rowIndex); - shift += tableFrame->GetCellSpacingY(rowIndex); + shift += tableFrame->GetRowSpacing(rowIndex); while (cellFrame) { nsRect cRect = cellFrame->GetRect(); // If aRowOffset != 0, there's no point in invalidating the cells, since @@ -1183,7 +1183,7 @@ nsTableRowFrame::CollapseRowIfNecessary(nscoord aRowOffset, cellFrame = cellFrame->GetNextCell(); } } else { - shift += tableFrame->GetCellSpacingY(GetRowIndex()); + shift += tableFrame->GetRowSpacing(GetRowIndex()); } rowRect.height = 0; } @@ -1247,14 +1247,14 @@ nsTableRowFrame::CollapseRowIfNecessary(nscoord aRowOffset, nextColFrame->StyleVisibility(); if ( (NS_STYLE_VISIBILITY_COLLAPSE != nextColVis->mVisible) && tableFrame->ColumnHasCellSpacingBefore(colX + colIncrement)) { - cRect.width += tableFrame->GetCellSpacingX(cellColIndex); + cRect.width += tableFrame->GetColSpacing(cellColIndex); } } } } x += cRect.width; if (isVisible) - x += tableFrame->GetCellSpacingX(cellColIndex); + x += tableFrame->GetColSpacing(cellColIndex); int32_t actualRowSpan = tableFrame->GetEffectiveRowSpan(*cellFrame); nsTableRowFrame* rowFrame = GetNextRow(); for (actualRowSpan--; actualRowSpan > 0 && rowFrame; actualRowSpan--) { @@ -1264,7 +1264,7 @@ nsTableRowFrame::CollapseRowIfNecessary(nscoord aRowOffset, if (!collapseNextRow) { nsRect nextRect = rowFrame->GetRect(); cRect.height += nextRect.height + - tableFrame->GetCellSpacingY(rowFrame->GetRowIndex()); + tableFrame->GetRowSpacing(rowFrame->GetRowIndex()); } rowFrame = rowFrame->GetNextRow(); } diff --git a/layout/tables/nsTableRowGroupFrame.cpp b/layout/tables/nsTableRowGroupFrame.cpp index 95b57928cecf..0004b38e990f 100644 --- a/layout/tables/nsTableRowGroupFrame.cpp +++ b/layout/tables/nsTableRowGroupFrame.cpp @@ -349,7 +349,7 @@ nsTableRowGroupFrame::ReflowChildren(nsPresContext* aPresContext, NS_NOTREACHED("yikes, a non-row child"); continue; } - nscoord cellSpacingY = tableFrame->GetCellSpacingY(rowFrame->GetRowIndex()); + nscoord cellSpacingY = tableFrame->GetRowSpacing(rowFrame->GetRowIndex()); haveRow = true; // Reflow the row frame @@ -443,8 +443,8 @@ nsTableRowGroupFrame::ReflowChildren(nsPresContext* aPresContext, } if (haveRow) - aReflowState.y -= tableFrame->GetCellSpacingY(GetStartRowIndex() + - GetRowCount()); + aReflowState.y -= tableFrame->GetRowSpacing(GetStartRowIndex() + + GetRowCount()); // Return our desired rect aDesiredSize.Width() = aReflowState.reflowState.AvailableWidth(); @@ -607,7 +607,7 @@ nsTableRowGroupFrame::CalculateRowHeights(nsPresContext* aPresContext, nsTableCellFrame* cellFrame = rowFrame->GetFirstCell(); // iteratate the row's cell frames while (cellFrame) { - nscoord cellSpacingY = tableFrame->GetCellSpacingY(startRowIndex + rowIndex); + nscoord cellSpacingY = tableFrame->GetRowSpacing(startRowIndex + rowIndex); int32_t rowSpan = tableFrame->GetEffectiveRowSpan(rowIndex + startRowIndex, *cellFrame); if ((rowIndex + rowSpan) > numRows) { // there might be rows pushed already to the nextInFlow @@ -727,7 +727,7 @@ nsTableRowGroupFrame::CalculateRowHeights(nsPresContext* aPresContext, bool styleHeightAllocation = false; nscoord rowGroupHeight = startRowGroupHeight + heightOfRows + - tableFrame->GetCellSpacingY(0, numRows-1); + tableFrame->GetRowSpacing(0, numRows-1); // if we have a style height, allocate the extra height to unconstrained rows if ((aReflowState.ComputedHeight() > rowGroupHeight) && (NS_UNCONSTRAINEDSIZE != aReflowState.ComputedHeight())) { @@ -787,7 +787,7 @@ nsTableRowGroupFrame::CalculateRowHeights(nsPresContext* aPresContext, // XXXbz we don't need to update our overflow area? } } - yOrigin += rowHeight + tableFrame->GetCellSpacingY(startRowIndex + rowIndex); + yOrigin += rowHeight + tableFrame->GetRowSpacing(startRowIndex + rowIndex); } if (isPaginated && styleHeightAllocation) { @@ -831,8 +831,8 @@ nsTableRowGroupFrame::CollapseRowGroupIfNecessary(nscoord aYTotalOffset, groupRect.height -= yGroupOffset; if (didCollapse) { // add back the cellspacing between rowgroups - groupRect.height += tableFrame->GetCellSpacingY(GetStartRowIndex() + - GetRowCount()); + groupRect.height += tableFrame->GetRowSpacing(GetStartRowIndex() + + GetRowCount()); } groupRect.y -= aYTotalOffset; @@ -1062,7 +1062,7 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext, // in the available space for (nsTableRowFrame* rowFrame = firstRowThisPage; rowFrame; rowFrame = rowFrame->GetNextRow()) { bool rowIsOnPage = true; - nscoord cellSpacingY = aTableFrame->GetCellSpacingY(rowFrame->GetRowIndex()); + nscoord cellSpacingY = aTableFrame->GetRowSpacing(rowFrame->GetRowIndex()); nsRect rowRect = rowFrame->GetNormalRect(); // See if the row fits on this page if (rowRect.YMost() > availHeight) { @@ -1516,9 +1516,9 @@ nsTableRowGroupFrame::GetHeightBasis(const nsHTMLReflowState& aReflowState) nsTableFrame* tableFrame = nsTableFrame::GetTableFrame(this); int32_t startRowIndex = GetStartRowIndex(); if ((aReflowState.ComputedHeight() > 0) && (aReflowState.ComputedHeight() < NS_UNCONSTRAINEDSIZE)) { - nscoord cellSpacing = tableFrame->GetCellSpacingY(startRowIndex, - std::max(startRowIndex, - startRowIndex + GetRowCount() - 1)); + nscoord cellSpacing = tableFrame->GetRowSpacing(startRowIndex, + std::max(startRowIndex, + startRowIndex + GetRowCount() - 1)); result = aReflowState.ComputedHeight() - cellSpacing; } else { @@ -1528,7 +1528,7 @@ nsTableRowGroupFrame::GetHeightBasis(const nsHTMLReflowState& aReflowState) } if (parentRS && (tableFrame == parentRS->frame) && (parentRS->ComputedHeight() > 0) && (parentRS->ComputedHeight() < NS_UNCONSTRAINEDSIZE)) { - nscoord cellSpacing = tableFrame->GetCellSpacingY(-1, tableFrame->GetRowCount()); + nscoord cellSpacing = tableFrame->GetRowSpacing(-1, tableFrame->GetRowCount()); result = parentRS->ComputedHeight() - cellSpacing; } }