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; 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 { enum LogicalAxis {
eLogicalAxisBlock = 0x0, eLogicalAxisBlock = 0x0,
eLogicalAxisInline = 0x1 eLogicalAxisInline = 0x1
@ -31,6 +31,14 @@ enum LogicalSide {
eLogicalSideIEnd = (eLogicalAxisInline << 1) | eLogicalEdgeEnd // 0x3 eLogicalSideIEnd = (eLogicalAxisInline << 1) | eLogicalEdgeEnd // 0x3
}; };
enum LogicalCorner
{
eLogicalCornerBStartIStart = 0,
eLogicalCornerBStartIEnd = 1,
eLogicalCornerBEndIEnd = 2,
eLogicalCornerBEndIStart = 3
};
} // namespace mozilla } // namespace mozilla
enum nsStyleUnit : uint8_t { 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 // (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. // it would be BStartIStart. For eBEndIEnd, store it in the entry to the bEnd-wards. etc.
void void
nsTableCellMap::SetBCBorderCorner(Corner aCorner, nsTableCellMap::SetBCBorderCorner(LogicalCorner aCorner,
nsCellMap& aCellMap, nsCellMap& aCellMap,
uint32_t aCellMapStart, uint32_t aCellMapStart,
uint32_t aRowIndex, uint32_t aRowIndex,
@ -1076,15 +1076,15 @@ nsTableCellMap::SetBCBorderCorner(Corner aCorner,
int32_t yPos = aRowIndex; int32_t yPos = aRowIndex;
int32_t rgYPos = aRowIndex - aCellMapStart; int32_t rgYPos = aRowIndex - aCellMapStart;
if (eBStartIEnd == aCorner) { if (eLogicalCornerBStartIEnd == aCorner) {
xPos++; xPos++;
} }
else if (eBEndIEnd == aCorner) { else if (eLogicalCornerBEndIEnd == aCorner) {
xPos++; xPos++;
rgYPos++; rgYPos++;
yPos++; yPos++;
} }
else if (eBEndIStart == aCorner) { else if (eLogicalCornerBEndIStart == aCorner) {
rgYPos++; rgYPos++;
yPos++; yPos++;
} }

View file

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

View file

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