Created attachment 23002 [details] fo file Dear all, When a page contains strechable spaces, it sometimes happens that a list item is allowed to overflow the region-body. See the attached *.fo file for an example. The page should have been broken before point 25 to fit on the page, but instead it is broken after this point and point 25 overflows the footer. All the best, Chris
*** Bug 49608 has been marked as a duplicate of this bug. ***
See simpler test case attached in bug #49608
Without even looking at the code, I can almost feel what is the issue here (see also my notes about the partial cause for Bugzilla 49801): ElementListUtils.calcContentLength(), which is used in list-layout to generate the 'list-parts'. During element-list buildup, this method calculates a content-length that does not take into account space-resolution (i.e. all the spaces are still unresolved SpaceElements). By the time the algorithm has to compute the most optimal break, those elements will have been resolved. Some may have disappeared, others add a forced space of a certain width. Something similar is bound to pop up for table-cells, sooner or later, as it also uses calcContentLength(). BTW: it just occurred to me that we may want to have that method return a MinOptMax, rather than an int. As such, it could more easily take into account stretchability of spaces, without necessarily having to know more about the actual breaks or space-resolution...?
resetting P2 open bugs to P3 pending further review