This ensures that the ranges of the shaped glyphs are monotonically
decreasing in right-to-left-text, thus avoiding nonsensical results
in find_safe_to_break that later causes a panic (see #1373).
Additionally, debug assertions have been added to catch non-monotonic
glyph ranges.
This still not gives the "footnote and entry" are on same page invariant for blocks, but at least we do not get random extraneous page breaks anymore.
Relevant issues: #1275, #1433
Fixes#1216 both by hardening the rounded rectangle against negative size and by ensuring that the negative size doesn't occur in the first place for this case.
Having a table span multiple pages can cause an alignment bug in the
table itself. If the first region in a cell in a grid row is empty, all
other cells in this row will skip the first region. A misalignment bug
can occur, since the calculation of all region sizes happen before the
skip. The overall size allocated for the content of a cell with multiple
regions and content in the first region thus is too little.
Fixes#963