Commit f959b720 authored by Emilio Cobos Álvarez's avatar Emilio Cobos Álvarez
Browse files

Bug 1663439 - Re-order rowgroups if reflowing a tfoot with an already split...

Bug 1663439 - Re-order rowgroups if reflowing a tfoot with an already split next-in-flow. r=TYLin, a=tjr

As the reflow may destroy the next-in-flow. See existing code.

Differential Revision: https://phabricator.services.mozilla.com/D90146
parent 68f696ef
......@@ -2888,15 +2888,22 @@ void nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
// using the footer's prev-in-flow's height instead of reflowing it again,
// but there's no real need.
if (isPaginated) {
bool reorder = false;
if (thead && !GetPrevInFlow()) {
reorder = thead->GetNextInFlow();
nscoord desiredHeight;
nsresult rv = SetupHeaderFooterChild(aReflowInput, thead, &desiredHeight);
if (NS_FAILED(rv)) return;
}
if (tfoot) {
reorder = reorder || tfoot->GetNextInFlow();
nsresult rv = SetupHeaderFooterChild(aReflowInput, tfoot, &footerHeight);
if (NS_FAILED(rv)) return;
}
if (reorder) {
// Reorder row groups - the reflow may have changed the nextinflows.
OrderRowGroups(rowGroups, &thead, &tfoot);
}
}
// if the child is a tbody in paginated mode reduce the height by a repeated
// footer
......@@ -2965,8 +2972,7 @@ void nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
aReflowInput.ReduceAvailableBSizeBy(wm, cellSpacingB);
// record the presence of a next in flow, it might get destroyed so we
// need to reorder the row group array
bool reorder = false;
if (kidFrame->GetNextInFlow()) reorder = true;
const bool reorder = kidFrame->GetNextInFlow();
LogicalPoint kidPosition(wm, aReflowInput.iCoord, aReflowInput.bCoord);
aStatus.Reset();
......@@ -2975,7 +2981,7 @@ void nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
aStatus);
if (reorder) {
// reorder row groups the reflow may have changed the nextinflows
// Reorder row groups - the reflow may have changed the nextinflows.
OrderRowGroups(rowGroups, &thead, &tfoot);
childX = rowGroups.IndexOf(kidFrame);
if (childX == RowGroupArray::NoIndex) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment