summaryrefslogtreecommitdiffstats
path: root/layout
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-10-23 11:10:13 +0000
committerMoonchild <moonchild@palemoon.org>2020-10-24 10:39:36 +0000
commitfcc0241430167671b9049b8e6eebcbff0b587b21 (patch)
tree210a9e813f076e0d992c4abc2a586c9d213deab7 /layout
parent24657db6290c7bbd3829cc38ff3321a725218dc1 (diff)
downloadUXP-fcc0241430167671b9049b8e6eebcbff0b587b21.tar
UXP-fcc0241430167671b9049b8e6eebcbff0b587b21.tar.gz
UXP-fcc0241430167671b9049b8e6eebcbff0b587b21.tar.lz
UXP-fcc0241430167671b9049b8e6eebcbff0b587b21.tar.xz
UXP-fcc0241430167671b9049b8e6eebcbff0b587b21.zip
[layout] Re-order rowgroups if reflowing.
This logic was missing for tfoot. See existing code in second hunk.
Diffstat (limited to 'layout')
-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 6d3527307..eb8efb0ec 100644
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -2934,17 +2934,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;
@@ -3014,8 +3025,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,
@@ -3023,7 +3035,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) {