Bug 1859446 Part 2 - Remove TableRowGroupReflowInput::tableFrame. r=layout-reviewers,jfkthame

`tableFrame` is seldom used, and all the functions that need the table frame
have already got it via `GetTableFrame()` helper.

Differential Revision: https://phabricator.services.mozilla.com/D191152
This commit is contained in:
Ting-Yu Lin
2023-10-17 17:30:01 +00:00
parent f609a78727
commit c1e9dcd8c9

View File

@@ -34,18 +34,14 @@ namespace mozilla {
struct TableRowGroupReflowInput { struct TableRowGroupReflowInput {
const ReflowInput& reflowInput; // Our reflow input const ReflowInput& reflowInput; // Our reflow input
nsTableFrame* tableFrame;
// The available size (computed from the parent) // The available size (computed from the parent)
mozilla::LogicalSize availSize; mozilla::LogicalSize availSize;
// Running block-offset // Running block-offset
nscoord bCoord; nscoord bCoord;
TableRowGroupReflowInput(const ReflowInput& aReflowInput, explicit TableRowGroupReflowInput(const ReflowInput& aReflowInput)
nsTableFrame* aTableFrame)
: reflowInput(aReflowInput), : reflowInput(aReflowInput),
tableFrame(aTableFrame),
availSize(aReflowInput.AvailableSize()), availSize(aReflowInput.AvailableSize()),
bCoord(0) {} bCoord(0) {}
@@ -401,12 +397,12 @@ void nsTableRowGroupFrame::ReflowChildren(
aReflowInput.bCoord += cellSpacingB; aReflowInput.bCoord += cellSpacingB;
if (!reflowAllKids) { if (!reflowAllKids) {
if (IsSimpleRowFrame(aReflowInput.tableFrame, kidFrame)) { if (IsSimpleRowFrame(tableFrame, kidFrame)) {
// Inform the row of its new bsize. // Inform the row of its new bsize.
kidFrame->DidResize(); kidFrame->DidResize();
// the overflow area may have changed inflate the overflow area // the overflow area may have changed inflate the overflow area
const nsStylePosition* stylePos = StylePosition(); const nsStylePosition* stylePos = StylePosition();
if (aReflowInput.tableFrame->IsAutoBSize(wm) && if (tableFrame->IsAutoBSize(wm) &&
!stylePos->BSize(wm).ConvertsToLength()) { !stylePos->BSize(wm).ConvertsToLength()) {
// Because other cells in the row may need to be aligned // Because other cells in the row may need to be aligned
// differently, repaint the entire row // differently, repaint the entire row
@@ -1345,7 +1341,7 @@ void nsTableRowGroupFrame::Reflow(nsPresContext* aPresContext,
nsTableFrame::CheckRequestSpecialBSizeReflow(aReflowInput); nsTableFrame::CheckRequestSpecialBSizeReflow(aReflowInput);
nsTableFrame* tableFrame = GetTableFrame(); nsTableFrame* tableFrame = GetTableFrame();
TableRowGroupReflowInput state(aReflowInput, tableFrame); TableRowGroupReflowInput state(aReflowInput);
const nsStyleVisibility* groupVis = StyleVisibility(); const nsStyleVisibility* groupVis = StyleVisibility();
bool collapseGroup = StyleVisibility::Collapse == groupVis->mVisible; bool collapseGroup = StyleVisibility::Collapse == groupVis->mVisible;
if (collapseGroup) { if (collapseGroup) {