mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-13 10:47:31 +09:00
[layout] Avoid negative availSize.BSizes in paginated table reflow.
This commit is contained in:
parent
c9b506acfd
commit
cc0dab1b67
1 changed files with 11 additions and 9 deletions
|
|
@ -103,6 +103,14 @@ struct TableReflowInput {
|
||||||
availSize.BSize(wm) = std::max(0, availSize.BSize(wm));
|
availSize.BSize(wm) = std::max(0, availSize.BSize(wm));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ReduceAvailableBSizeBy(WritingMode aWM, nscoord aAmount) {
|
||||||
|
if (availSize.BSize(aWM) == NS_UNCONSTRAINEDSIZE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
availSize.BSize(aWM) -= aAmount;
|
||||||
|
availSize.BSize(aWM) = std::max(0, availSize.BSize(aWM));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
@ -2681,9 +2689,7 @@ nsTableFrame::PlaceChild(TableReflowInput& aReflowInput,
|
||||||
aReflowInput.bCoord += aKidDesiredSize.BSize(wm);
|
aReflowInput.bCoord += aKidDesiredSize.BSize(wm);
|
||||||
|
|
||||||
// If our bsize is constrained, then update the available bsize
|
// If our bsize is constrained, then update the available bsize
|
||||||
if (NS_UNCONSTRAINEDSIZE != aReflowInput.availSize.BSize(wm)) {
|
aReflowInput.ReduceAvailableBSizeBy(wm, aKidDesiredSize.BSize(wm));
|
||||||
aReflowInput.availSize.BSize(wm) -= aKidDesiredSize.BSize(wm);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -3003,9 +3009,7 @@ nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
|
||||||
kidReflowInput.mFlags.mIsTopOfPage = false;
|
kidReflowInput.mFlags.mIsTopOfPage = false;
|
||||||
}
|
}
|
||||||
aReflowInput.bCoord += cellSpacingB;
|
aReflowInput.bCoord += cellSpacingB;
|
||||||
if (NS_UNCONSTRAINEDSIZE != aReflowInput.availSize.BSize(wm)) {
|
aReflowInput.ReduceAvailableBSizeBy(wm, cellSpacingB);
|
||||||
aReflowInput.availSize.BSize(wm) -= cellSpacingB;
|
|
||||||
}
|
|
||||||
// record the presence of a next in flow, it might get destroyed so we
|
// record the presence of a next in flow, it might get destroyed so we
|
||||||
// need to reorder the row group array
|
// need to reorder the row group array
|
||||||
bool reorder = false;
|
bool reorder = false;
|
||||||
|
|
@ -3170,9 +3174,7 @@ nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
|
||||||
aReflowInput.bCoord += kidRect.BSize(wm);
|
aReflowInput.bCoord += kidRect.BSize(wm);
|
||||||
|
|
||||||
// If our bsize is constrained then update the available bsize.
|
// If our bsize is constrained then update the available bsize.
|
||||||
if (NS_UNCONSTRAINEDSIZE != aReflowInput.availSize.BSize(wm)) {
|
aReflowInput.ReduceAvailableBSizeBy(wm, cellSpacingB + kidRect.BSize(wm));
|
||||||
aReflowInput.availSize.BSize(wm) -= cellSpacingB + kidRect.BSize(wm);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue