https://issues.apache.org/bugzilla/show_bug.cgi?id=48380

--- Comment #2 from Andreas L. Delmelle <[email protected]> 2011-01-05 
14:01:49 EST ---
Created an attachment (id=26460)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26460)
proposed patch to ElementListUtils.java

Apologies for the late response...

I noticed the issue did not occur with fox:orphan-content-limit, since that
triggers a call to ElementListUtils.removeLegalBreaksFromEnd(), which was
equipped to deal with SpaceElements, contrary to the method
removeLegalBreaks(), where the exception was thrown. 
Seems like the implementations of both methods were meant to be analogous, but
got out of alignment.
Proposal is to fix this by merging the implementations into one private method,
as they were almost identical anyway (apart from 3-4 lines, which can be
handled rather gracefully through conditionals).
For now, the proposed fix does not alter the behavior in any way, except by
avoiding the potential ClassCastException, although it did get me wondering
whether the treatment of spaces is always correct here... 
Think: consecutive/adjoining spaces with a different precedence value, and
whether it is correct to just add the space's optimum width. Theoretically, it
seems possible that we leave in a break-opportunity that turns out (= after
space-resolution) to leave less content before the break than the constraint
specifies, because we counted 2 spaces here, of which only one is retained in
the eventual output (?)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Reply via email to