Bug 1673370 - Simplify nsTableRowGroupFrame::GetBCBorderWidth. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D94730
This commit is contained in:
Alex Henrie 2020-10-27 02:33:25 +00:00
parent f9e0ccb2a1
commit 40234649bd

View File

@ -1656,21 +1656,19 @@ nsresult nsTableRowGroupFrame::GetFrameName(nsAString& aResult) const {
LogicalMargin nsTableRowGroupFrame::GetBCBorderWidth(WritingMode aWM) {
LogicalMargin border(aWM);
nsTableRowFrame* firstRowFrame = nullptr;
nsTableRowFrame* lastRowFrame = nullptr;
for (nsTableRowFrame* rowFrame = GetFirstRow(); rowFrame;
nsTableRowFrame* firstRowFrame = GetFirstRow();
if (!firstRowFrame) {
return border;
}
nsTableRowFrame* lastRowFrame = firstRowFrame;
for (nsTableRowFrame* rowFrame = firstRowFrame->GetNextRow(); rowFrame;
rowFrame = rowFrame->GetNextRow()) {
if (!firstRowFrame) {
firstRowFrame = rowFrame;
}
lastRowFrame = rowFrame;
}
if (firstRowFrame) {
border.BStart(aWM) = PresContext()->DevPixelsToAppUnits(
firstRowFrame->GetBStartBCBorderWidth());
border.BEnd(aWM) = PresContext()->DevPixelsToAppUnits(
lastRowFrame->GetBEndBCBorderWidth());
}
border.BStart(aWM) = PresContext()->DevPixelsToAppUnits(
firstRowFrame->GetBStartBCBorderWidth());
border.BEnd(aWM) =
PresContext()->DevPixelsToAppUnits(lastRowFrame->GetBEndBCBorderWidth());
return border;
}