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

--- Comment #7 from Andreas L. Delmelle <adelme...@apache.org> 2011-02-04 
05:23:24 EST ---
Created an attachment (id=26604)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26604)
potential fix

Looking closer at this, so far, I have not found a possibility to generate a
node in BreakingAlgorithm that merely produces a break, but does not include at
least one element... Comparing to the case of a forced break, or the cases
where it does work as expected, the difference is always that there is a
penalty element preceding the content that should be kept together.

So, it looks more and more like we cannot avoid somehow inserting that
auxiliary penalty. The quick hack I tried earlier, adds this penalty
unconditionally, to all block lists. Another, slightly more attractive
alternative would be to have the BreakingAlgorithm alter the paragraph and have
it insert this penalty when appropriate. That would fix the issue without
having to adapt all the testcases that observe the element lists.

Attached minimal patch fixes the issue by conditionally adding the auxiliary
penalty in recoverFromTooLong(). If the lastTooLong node would be the first
real break, we add the penalty to enable the creation of a node representing a
break before the first box.
It still 'broke' one layout test: fox_disable-column-balancing.xml. Checking
closer, this actually seems to fix the test, rather than break it. The failing
check was followed by another, commented check. Removing the failing one, and
uncommenting the other, the layout test suite passes completely.

Bug 49877 also seems to be fixed by the patch, so I am going to mark that as a
duplicate to begin with.

-- 
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