mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 23:02:20 +00:00
Bug 1863837 Part 3 - Rename cellSpacingI/cellSpacingB to colSpacing/rowSpacing. r=layout-reviewers,emilio
The methods were renamed in https://hg.mozilla.org/mozilla-central/rev/778616c8f74e, so should the variables. Differential Revision: https://phabricator.services.mozilla.com/D193142
This commit is contained in:
parent
dd7bef0239
commit
a2db328714
@ -1265,20 +1265,20 @@ void nsTableFrame::SetColumnDimensions(nscoord aBSize, WritingMode aWM,
|
||||
// first we need to figure out the size of the colgroup
|
||||
int32_t groupFirstCol = colIdx;
|
||||
nscoord colGroupISize = 0;
|
||||
nscoord cellSpacingI = 0;
|
||||
nscoord colSpacing = 0;
|
||||
const nsFrameList& columnList = colGroupFrame->PrincipalChildList();
|
||||
for (nsIFrame* colFrame : columnList) {
|
||||
if (mozilla::StyleDisplay::TableColumn ==
|
||||
colFrame->StyleDisplay()->mDisplay) {
|
||||
NS_ASSERTION(colIdx < GetColCount(), "invalid number of columns");
|
||||
cellSpacingI = GetColSpacing(colIdx);
|
||||
colSpacing = GetColSpacing(colIdx);
|
||||
colGroupISize +=
|
||||
fif->GetColumnISizeFromFirstInFlow(colIdx) + cellSpacingI;
|
||||
fif->GetColumnISizeFromFirstInFlow(colIdx) + colSpacing;
|
||||
++colIdx;
|
||||
}
|
||||
}
|
||||
if (colGroupISize) {
|
||||
colGroupISize -= cellSpacingI;
|
||||
colGroupISize -= colSpacing;
|
||||
}
|
||||
|
||||
LogicalRect colGroupRect(aWM, colGroupOrigin.I(aWM), colGroupOrigin.B(aWM),
|
||||
@ -1296,13 +1296,13 @@ void nsTableFrame::SetColumnDimensions(nscoord aBSize, WritingMode aWM,
|
||||
LogicalRect colRect(aWM, colOrigin.I(aWM), colOrigin.B(aWM), colISize,
|
||||
colBSize);
|
||||
colFrame->SetRect(aWM, colRect, colGroupSize);
|
||||
cellSpacingI = GetColSpacing(colIdx);
|
||||
colOrigin.I(aWM) += colISize + cellSpacingI;
|
||||
colSpacing = GetColSpacing(colIdx);
|
||||
colOrigin.I(aWM) += colISize + colSpacing;
|
||||
++colIdx;
|
||||
}
|
||||
}
|
||||
|
||||
colGroupOrigin.I(aWM) += colGroupISize + cellSpacingI;
|
||||
colGroupOrigin.I(aWM) += colGroupISize + colSpacing;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2790,7 +2790,7 @@ void nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
|
||||
bool allowRepeatedFooter = false;
|
||||
for (size_t childX = 0; childX < rowGroups.Length(); childX++) {
|
||||
nsTableRowGroupFrame* kidFrame = rowGroups[childX];
|
||||
const nscoord cellSpacingB =
|
||||
const nscoord rowSpacing =
|
||||
GetRowSpacing(kidFrame->GetStartRowIndex() + kidFrame->GetRowCount());
|
||||
// Get the frame state bits
|
||||
// See if we should only reflow the dirty child frames
|
||||
@ -2818,9 +2818,9 @@ void nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
|
||||
// the child is a tbody and there is a repeatable footer
|
||||
NS_ASSERTION(tfoot == rowGroups[rowGroups.Length() - 1],
|
||||
"Missing footer!");
|
||||
if (footerHeight + cellSpacingB < kidAvailSize.BSize(wm)) {
|
||||
if (footerHeight + rowSpacing < kidAvailSize.BSize(wm)) {
|
||||
allowRepeatedFooter = true;
|
||||
kidAvailSize.BSize(wm) -= footerHeight + cellSpacingB;
|
||||
kidAvailSize.BSize(wm) -= footerHeight + rowSpacing;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2844,8 +2844,8 @@ void nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
|
||||
(rowGroups[childX - 1]->GetNormalRect().YMost() > 0)) {
|
||||
kidReflowInput.mFlags.mIsTopOfPage = false;
|
||||
}
|
||||
aReflowInput.mBCoord += cellSpacingB;
|
||||
aReflowInput.ReduceAvailableBSizeBy(wm, cellSpacingB);
|
||||
aReflowInput.mBCoord += rowSpacing;
|
||||
aReflowInput.ReduceAvailableBSizeBy(wm, rowSpacing);
|
||||
// record the presence of a next in flow, it might get destroyed so we
|
||||
// need to reorder the row group array
|
||||
const bool reorder = kidFrame->GetNextInFlow();
|
||||
@ -2988,7 +2988,7 @@ void nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
|
||||
break;
|
||||
}
|
||||
} else { // it isn't being reflowed
|
||||
aReflowInput.mBCoord += cellSpacingB;
|
||||
aReflowInput.mBCoord += rowSpacing;
|
||||
const LogicalRect kidRect =
|
||||
kidFrame->GetLogicalNormalRect(wm, containerSize);
|
||||
if (kidRect.BStart(wm) != aReflowInput.mBCoord) {
|
||||
@ -3003,7 +3003,7 @@ void nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
|
||||
}
|
||||
aReflowInput.mBCoord += kidRect.BSize(wm);
|
||||
|
||||
aReflowInput.ReduceAvailableBSizeBy(wm, cellSpacingB + kidRect.BSize(wm));
|
||||
aReflowInput.ReduceAvailableBSizeBy(wm, rowSpacing + kidRect.BSize(wm));
|
||||
}
|
||||
}
|
||||
|
||||
@ -3189,7 +3189,7 @@ void nsTableFrame::DistributeBSizeToRows(const ReflowInput& aReflowInput,
|
||||
const nsSize dummyContainerSize;
|
||||
const LogicalRect rowNormalRect =
|
||||
rowFrame->GetLogicalNormalRect(wm, dummyContainerSize);
|
||||
nscoord cellSpacingB = GetRowSpacing(rowFrame->GetRowIndex());
|
||||
const nscoord rowSpacing = GetRowSpacing(rowFrame->GetRowIndex());
|
||||
if ((amountUsed < aAmount) && rowFrame->HasPctBSize()) {
|
||||
nscoord pctBSize = rowFrame->GetInitialBSize(pctBasis);
|
||||
nscoord amountForRow = std::min(aAmount - amountUsed,
|
||||
@ -3200,8 +3200,8 @@ void nsTableFrame::DistributeBSizeToRows(const ReflowInput& aReflowInput,
|
||||
nscoord newRowBSize = rowNormalRect.BSize(wm) + amountForRow;
|
||||
rowFrame->SetSize(
|
||||
wm, LogicalSize(wm, rowNormalRect.ISize(wm), newRowBSize));
|
||||
bOriginRow += newRowBSize + cellSpacingB;
|
||||
bEndRG += newRowBSize + cellSpacingB;
|
||||
bOriginRow += newRowBSize + rowSpacing;
|
||||
bEndRG += newRowBSize + rowSpacing;
|
||||
amountUsed += amountForRow;
|
||||
amountUsedByRG += amountForRow;
|
||||
// rowFrame->DidResize();
|
||||
@ -3219,8 +3219,8 @@ void nsTableFrame::DistributeBSizeToRows(const ReflowInput& aReflowInput,
|
||||
nsTableFrame::RePositionViews(rowFrame);
|
||||
rowFrame->InvalidateFrameSubtree();
|
||||
}
|
||||
bOriginRow += rowNormalRect.BSize(wm) + cellSpacingB;
|
||||
bEndRG += rowNormalRect.BSize(wm) + cellSpacingB;
|
||||
bOriginRow += rowNormalRect.BSize(wm) + rowSpacing;
|
||||
bEndRG += rowNormalRect.BSize(wm) + rowSpacing;
|
||||
}
|
||||
rowFrame = rowFrame->GetNextRow();
|
||||
}
|
||||
@ -3329,7 +3329,7 @@ void nsTableFrame::DistributeBSizeToRows(const ReflowInput& aReflowInput,
|
||||
if (!firstUnStyledRG || !rgFrame->HasStyleBSize() || !eligibleRows) {
|
||||
for (nsTableRowFrame* rowFrame = rgFrame->GetFirstRow(); rowFrame;
|
||||
rowFrame = rowFrame->GetNextRow()) {
|
||||
nscoord cellSpacingB = GetRowSpacing(rowFrame->GetRowIndex());
|
||||
const nscoord rowSpacing = GetRowSpacing(rowFrame->GetRowIndex());
|
||||
// We don't know the final width of the rowGroupFrame yet, so use 0,0
|
||||
// as a dummy containerSize here; we'll adjust the row positions at
|
||||
// the end, after the rowGroup size is finalized.
|
||||
@ -3373,8 +3373,8 @@ void nsTableFrame::DistributeBSizeToRows(const ReflowInput& aReflowInput,
|
||||
rowFrame->SetSize(
|
||||
wm, LogicalSize(wm, rowNormalRect.ISize(wm), newRowBSize));
|
||||
|
||||
bOriginRow += newRowBSize + cellSpacingB;
|
||||
bEndRG += newRowBSize + cellSpacingB;
|
||||
bOriginRow += newRowBSize + rowSpacing;
|
||||
bEndRG += newRowBSize + rowSpacing;
|
||||
|
||||
amountUsed += amountForRow;
|
||||
amountUsedByRG += amountForRow;
|
||||
@ -3392,8 +3392,8 @@ void nsTableFrame::DistributeBSizeToRows(const ReflowInput& aReflowInput,
|
||||
nsTableFrame::RePositionViews(rowFrame);
|
||||
rowFrame->InvalidateFrameSubtree();
|
||||
}
|
||||
bOriginRow += rowNormalRect.BSize(wm) + cellSpacingB;
|
||||
bEndRG += rowNormalRect.BSize(wm) + cellSpacingB;
|
||||
bOriginRow += rowNormalRect.BSize(wm) + rowSpacing;
|
||||
bEndRG += rowNormalRect.BSize(wm) + rowSpacing;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -345,7 +345,8 @@ void nsTableRowGroupFrame::ReflowChildren(
|
||||
nsIFrame* prevKidFrame = nullptr;
|
||||
for (nsTableRowFrame* kidFrame = GetFirstRow(); kidFrame;
|
||||
prevKidFrame = kidFrame, kidFrame = kidFrame->GetNextRow()) {
|
||||
nscoord cellSpacingB = tableFrame->GetRowSpacing(kidFrame->GetRowIndex());
|
||||
const nscoord rowSpacing =
|
||||
tableFrame->GetRowSpacing(kidFrame->GetRowIndex());
|
||||
|
||||
// Reflow the row frame
|
||||
if (reflowAllKids || kidFrame->IsSubtreeDirty() ||
|
||||
@ -390,7 +391,7 @@ void nsTableRowGroupFrame::ReflowChildren(
|
||||
kidPosition, containerSize, kidDesiredSize,
|
||||
oldKidRect.GetPhysicalRect(wm, containerSize),
|
||||
oldKidInkOverflow);
|
||||
aReflowInput.mBCoord += cellSpacingB;
|
||||
aReflowInput.mBCoord += rowSpacing;
|
||||
|
||||
if (!reflowAllKids) {
|
||||
if (IsSimpleRowFrame(tableFrame, kidFrame)) {
|
||||
@ -433,7 +434,7 @@ void nsTableRowGroupFrame::ReflowChildren(
|
||||
|
||||
// Adjust the running b-offset so we know where the next row should be
|
||||
// placed
|
||||
nscoord bSize = kidFrame->BSize(wm) + cellSpacingB;
|
||||
nscoord bSize = kidFrame->BSize(wm) + rowSpacing;
|
||||
aReflowInput.mBCoord += bSize;
|
||||
|
||||
if (NS_UNCONSTRAINEDSIZE != aReflowInput.mAvailSize.BSize(wm)) {
|
||||
@ -620,7 +621,7 @@ void nsTableRowGroupFrame::CalculateRowBSizes(nsPresContext* aPresContext,
|
||||
nsTableCellFrame* cellFrame = rowFrame->GetFirstCell();
|
||||
// iteratate the row's cell frames
|
||||
while (cellFrame) {
|
||||
nscoord cellSpacingB =
|
||||
const nscoord rowSpacing =
|
||||
tableFrame->GetRowSpacing(startRowIndex + rowIndex);
|
||||
int32_t rowSpan = tableFrame->GetEffectiveRowSpan(
|
||||
rowIndex + startRowIndex, *cellFrame);
|
||||
@ -641,7 +642,7 @@ void nsTableRowGroupFrame::CalculateRowBSizes(nsPresContext* aPresContext,
|
||||
bsizeOfUnStyledRowsSpanned += rowInfo[rowIndex + spanX].bSize;
|
||||
}
|
||||
if (0 != spanX) {
|
||||
cellSpacingTotal += cellSpacingB;
|
||||
cellSpacingTotal += rowSpacing;
|
||||
}
|
||||
if (rowInfo[rowIndex + spanX].isSpecial) {
|
||||
numSpecialRowsSpanned++;
|
||||
@ -1077,7 +1078,8 @@ void nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext,
|
||||
for (nsTableRowFrame* rowFrame = firstRowThisPage; rowFrame;
|
||||
rowFrame = rowFrame->GetNextRow()) {
|
||||
bool rowIsOnPage = true;
|
||||
nscoord cellSpacingB = aTableFrame->GetRowSpacing(rowFrame->GetRowIndex());
|
||||
const nscoord rowSpacing =
|
||||
aTableFrame->GetRowSpacing(rowFrame->GetRowIndex());
|
||||
const LogicalRect rowRect =
|
||||
rowFrame->GetLogicalNormalRect(wm, containerSize);
|
||||
// See if the row fits on this page
|
||||
@ -1146,7 +1148,7 @@ void nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext,
|
||||
contRow = CreateContinuingRowFrame(rowFrame);
|
||||
aDesiredSize.BSize(wm) += rowMetrics.BSize(wm);
|
||||
if (prevRowFrame) {
|
||||
aDesiredSize.BSize(wm) += cellSpacingB;
|
||||
aDesiredSize.BSize(wm) += rowSpacing;
|
||||
}
|
||||
} else {
|
||||
// Put the row on the next page to give it more block-size.
|
||||
@ -1172,7 +1174,7 @@ void nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext,
|
||||
}
|
||||
aDesiredSize.BSize(wm) += rowMetrics.BSize(wm);
|
||||
if (prevRowFrame) {
|
||||
aDesiredSize.BSize(wm) += cellSpacingB;
|
||||
aDesiredSize.BSize(wm) += rowSpacing;
|
||||
}
|
||||
NS_WARNING(
|
||||
"Data loss - complete row needed more block-size than "
|
||||
|
Loading…
Reference in New Issue
Block a user