summaryrefslogtreecommitdiffstats
path: root/layout/tables/nsTableFrame.cpp
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-10-23 11:10:13 +0000
committerMoonchild <moonchild@palemoon.org>2020-10-23 11:10:13 +0000
commit6eba9263cc8176b310704bca88e7c679e0405b4f (patch)
treea43ce82fa1204ba4004dd759befda7b888d1e8f2 /layout/tables/nsTableFrame.cpp
parent2cd89d58452f18eeffdbe0bfb86b2116297e041d (diff)
downloadUXP-6eba9263cc8176b310704bca88e7c679e0405b4f.tar
UXP-6eba9263cc8176b310704bca88e7c679e0405b4f.tar.gz
UXP-6eba9263cc8176b310704bca88e7c679e0405b4f.tar.lz
UXP-6eba9263cc8176b310704bca88e7c679e0405b4f.tar.xz
UXP-6eba9263cc8176b310704bca88e7c679e0405b4f.zip
[layout] Re-order rowgroups if reflowing.
This logic was missing for tfoot. See existing code in second hunk.
Diffstat (limited to 'layout/tables/nsTableFrame.cpp')
-rw-r--r--layout/tables/nsTableFrame.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp
index 3e7607e4f..7e11a978b 100644
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -2933,17 +2933,28 @@ 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()) {
+ if (thead->GetNextInFlow()) {
+ reorder = true;
+ }
nscoord desiredHeight;
nsresult rv = SetupHeaderFooterChild(aReflowInput, thead, &desiredHeight);
if (NS_FAILED(rv))
return;
}
if (tfoot) {
+ if (tfoot->GetNextInFlow()) {
+ reorder = true;
+ }
nsresult rv = SetupHeaderFooterChild(aReflowInput, tfoot, &footerHeight);
if (NS_FAILED(rv))
return;
}
+ if (reorder) {
+ // Reorder row groups, because the reflow may have changed what's next-in-flow.
+ OrderRowGroups(rowGroups, &thead, &tfoot);
+ }
}
// if the child is a tbody in paginated mode reduce the height by a repeated footer
bool allowRepeatedFooter = false;
@@ -3013,8 +3024,9 @@ nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
// 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())
+ if (kidFrame->GetNextInFlow()) {
reorder = true;
+ }
LogicalPoint kidPosition(wm, aReflowInput.iCoord, aReflowInput.bCoord);
ReflowChild(kidFrame, presContext, desiredSize, kidReflowInput,
@@ -3022,7 +3034,7 @@ nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
kidReflowInput.ApplyRelativePositioning(&kidPosition, containerSize);
if (reorder) {
- // reorder row groups the reflow may have changed the nextinflows
+ // Reorder row groups, because the reflow may have changed what's next-in-flow.
OrderRowGroups(rowGroups, &thead, &tfoot);
childX = rowGroups.IndexOf(kidFrame);
if (childX == RowGroupArray::NoIndex) {