Issue #1925 - Rename Corner to LogicalCorner and move it to nsStyleCoord.h.

To avoid confusion with mozilla::css::corner, rename ::Corner to
mozilla::LogicalCorner, and move it to nsStyleCoord.h from the illogical
nsCellMap.h location.
Also, append the LogicalCorner prefix to all the enum values, to match
the surrounding coding style.
This commit is contained in:
Moonchild 2024-08-01 20:09:22 +02:00 committed by roytam1
commit 81f60b575a
4 changed files with 25 additions and 24 deletions

View file

@ -15,7 +15,7 @@ namespace mozilla {
class WritingMode;
// Logical axis, edge and side constants for use in various places.
// Logical axis, edge, side and corner constants for use in various places.
enum LogicalAxis {
eLogicalAxisBlock = 0x0,
eLogicalAxisInline = 0x1
@ -31,6 +31,14 @@ enum LogicalSide {
eLogicalSideIEnd = (eLogicalAxisInline << 1) | eLogicalEdgeEnd // 0x3
};
enum LogicalCorner
{
eLogicalCornerBStartIStart = 0,
eLogicalCornerBStartIEnd = 1,
eLogicalCornerBEndIEnd = 2,
eLogicalCornerBEndIStart = 3
};
} // namespace mozilla
enum nsStyleUnit : uint8_t {

View file

@ -1055,7 +1055,7 @@ nsTableCellMap::SetBCBorderEdge(LogicalSide aSide,
// (aRowIndex, aColIndex). For eBStartIEnd, store it in the entry to the iEnd-wards where
// it would be BStartIStart. For eBEndIEnd, store it in the entry to the bEnd-wards. etc.
void
nsTableCellMap::SetBCBorderCorner(Corner aCorner,
nsTableCellMap::SetBCBorderCorner(LogicalCorner aCorner,
nsCellMap& aCellMap,
uint32_t aCellMapStart,
uint32_t aRowIndex,
@ -1076,15 +1076,15 @@ nsTableCellMap::SetBCBorderCorner(Corner aCorner,
int32_t yPos = aRowIndex;
int32_t rgYPos = aRowIndex - aCellMapStart;
if (eBStartIEnd == aCorner) {
if (eLogicalCornerBStartIEnd == aCorner) {
xPos++;
}
else if (eBEndIEnd == aCorner) {
else if (eLogicalCornerBEndIEnd == aCorner) {
xPos++;
rgYPos++;
yPos++;
}
else if (eBEndIStart == aCorner) {
else if (eLogicalCornerBEndIStart == aCorner) {
rgYPos++;
yPos++;
}

View file

@ -35,14 +35,6 @@ struct nsColInfo
int32_t aNumCellsSpan);
};
enum Corner
{
eBStartIStart = 0,
eBStartIEnd = 1,
eBEndIEnd = 2,
eBEndIStart = 3
};
struct BCInfo
{
nsTArray<BCData> mIEndBorders;
@ -213,7 +205,7 @@ public:
nscoord aSize,
bool aChanged);
void SetBCBorderCorner(::Corner aCorner,
void SetBCBorderCorner(mozilla::LogicalCorner aCorner,
nsCellMap& aCellMap,
uint32_t aCellMapStart,
uint32_t aYPos,

View file

@ -5733,7 +5733,8 @@ nsTableFrame::CalcBCBorders()
}
else {
tlCorner.Update(eLogicalSideIEnd, currentBorder);
tableCellMap->SetBCBorderCorner(eBStartIStart, *iter.mCellMap, 0, 0, colIdx,
tableCellMap->SetBCBorderCorner(eLogicalCornerBStartIStart,
*iter.mCellMap, 0, 0, colIdx,
LogicalSide(tlCorner.ownerSide),
tlCorner.subWidth,
tlCorner.bevel);
@ -5783,7 +5784,7 @@ nsTableFrame::CalcBCBorders()
currentBorder = info.GetIStartEdgeBorder();
BCCornerInfo& tlCorner = (0 == rowB) ? bStartCorners[0] : bEndCorners[0];
tlCorner.Update(eLogicalSideBEnd, currentBorder);
tableCellMap->SetBCBorderCorner(eBStartIStart, *iter.mCellMap,
tableCellMap->SetBCBorderCorner(eLogicalCornerBStartIStart, *iter.mCellMap,
iter.mRowGroupStart, rowB, 0,
LogicalSide(tlCorner.ownerSide),
tlCorner.subWidth,
@ -5822,7 +5823,7 @@ nsTableFrame::CalcBCBorders()
bStartCorners[info.GetCellEndColIndex() + 1] :
bEndCorners[info.GetCellEndColIndex() + 1];
trCorner.Update(eLogicalSideBEnd, currentBorder); // bStart-iEnd
tableCellMap->SetBCBorderCorner(eBStartIEnd, *iter.mCellMap,
tableCellMap->SetBCBorderCorner(eLogicalCornerBStartIEnd, *iter.mCellMap,
iter.mRowGroupStart, rowB,
info.GetCellEndColIndex(),
LogicalSide(trCorner.ownerSide),
@ -5830,7 +5831,7 @@ nsTableFrame::CalcBCBorders()
trCorner.bevel);
BCCornerInfo& brCorner = bEndCorners[info.GetCellEndColIndex() + 1];
brCorner.Set(eLogicalSideBStart, currentBorder); // bEnd-iEnd
tableCellMap->SetBCBorderCorner(eBEndIEnd, *iter.mCellMap,
tableCellMap->SetBCBorderCorner(eLogicalCornerBEndIEnd, *iter.mCellMap,
iter.mRowGroupStart, rowB,
info.GetCellEndColIndex(),
LogicalSide(brCorner.ownerSide),
@ -5899,7 +5900,7 @@ nsTableFrame::CalcBCBorders()
if (info.GetCellEndColIndex() < damageArea.EndCol() &&
rowB >= damageArea.StartRow()) {
if (0 != rowB) {
tableCellMap->SetBCBorderCorner(eBStartIEnd, *iter.mCellMap,
tableCellMap->SetBCBorderCorner(eLogicalCornerBStartIEnd, *iter.mCellMap,
iter.mRowGroupStart, rowB,
info.GetCellEndColIndex(),
LogicalSide(trCorner->ownerSide),
@ -5908,7 +5909,7 @@ nsTableFrame::CalcBCBorders()
}
// store any corners this cell spans together with the aja cell
for (int32_t rX = rowB + 1; rX < rowB + segLength; rX++) {
tableCellMap->SetBCBorderCorner(eBEndIEnd, *iter.mCellMap,
tableCellMap->SetBCBorderCorner(eLogicalCornerBEndIEnd, *iter.mCellMap,
iter.mRowGroupStart, rX,
info.GetCellEndColIndex(),
LogicalSide(trCorner->ownerSide),
@ -5945,7 +5946,7 @@ nsTableFrame::CalcBCBorders()
// update/store the bEnd-iStart & bEnd-IEnd corners
BCCornerInfo& blCorner = bEndCorners[colIdx]; // bEnd-iStart
blCorner.Update(eLogicalSideIEnd, currentBorder);
tableCellMap->SetBCBorderCorner(eBEndIStart, *iter.mCellMap,
tableCellMap->SetBCBorderCorner(eLogicalCornerBEndIStart, *iter.mCellMap,
iter.mRowGroupStart,
info.GetCellEndRowIndex(),
colIdx,
@ -5954,7 +5955,7 @@ nsTableFrame::CalcBCBorders()
BCCornerInfo& brCorner = bEndCorners[colIdx + 1]; // bEnd-iEnd
brCorner.Update(eLogicalSideIStart, currentBorder);
if (info.mNumTableCols == colIdx + 1) { // bEnd-IEnd corner of the table
tableCellMap->SetBCBorderCorner(eBEndIEnd, *iter.mCellMap,
tableCellMap->SetBCBorderCorner(eLogicalCornerBEndIEnd, *iter.mCellMap,
iter.mRowGroupStart,
info.GetCellEndRowIndex(), colIdx,
LogicalSide(brCorner.ownerSide),
@ -6026,7 +6027,7 @@ nsTableFrame::CalcBCBorders()
if (info.GetCellEndRowIndex() < damageArea.EndRow() &&
colIdx >= damageArea.StartCol()) {
if (hitsSpanBelow) {
tableCellMap->SetBCBorderCorner(eBEndIStart, *iter.mCellMap,
tableCellMap->SetBCBorderCorner(eLogicalCornerBEndIStart, *iter.mCellMap,
iter.mRowGroupStart,
info.GetCellEndRowIndex(), colIdx,
LogicalSide(blCorner.ownerSide),
@ -6036,7 +6037,7 @@ nsTableFrame::CalcBCBorders()
for (int32_t c = colIdx + 1; c < colIdx + segLength; c++) {
BCCornerInfo& corner = bEndCorners[c];
corner.Set(eLogicalSideIEnd, currentBorder);
tableCellMap->SetBCBorderCorner(eBEndIStart, *iter.mCellMap,
tableCellMap->SetBCBorderCorner(eLogicalCornerBEndIStart, *iter.mCellMap,
iter.mRowGroupStart,
info.GetCellEndRowIndex(), c,
LogicalSide(corner.ownerSide),