[layout] Avoid negative availSize.BSizes in paginated table reflow.
parent
4e0e2a7193
commit
edd9f55543
|
@ -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…
Reference in New Issue