You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by Apache Wiki <wi...@apache.org> on 2005/06/16 10:27:50 UTC

[Xmlgraphics-fop Wiki] Update of "TableLayout/BreakHandling" by JeremiasMaerki

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Xmlgraphics-fop Wiki" for change notification.

The following page has been changed by JeremiasMaerki:
http://wiki.apache.org/xmlgraphics-fop/TableLayout/BreakHandling

The comment on the change is:
Breaks inside tables, describing the problem.

New page:
= Break handling inside tables with the Knuth approach =

== The difficulty ==

The normal block-level LMs handle hard breaks in a fashion that the current element list is prematurely ended using a Knuth Penalty with p=-INFINITE. Additional calls to getNextKnuthElements() return the next element list. This is also related to the way that the page breaker does its job. Normally it would handle a whole page-sequence at once, but in the case of a hard break, you get two (or more in case of multiple breaks) element lists (before and after the break) which are all handled separately by the page breaker.

Table layout (and similarly for lists) has the added complexity of creating combined elements lists. It means synchronizing multiple element list sources at the same time. It's not just a matter of returning early when a hard break is encountered but it is also necessary to check where the other simultaneously active element lists are broken, and to find out how to restart the element generation for the next list.

== Current status (2005-06-16) ==

The TableContentLayoutManager is designed to deliver a single element list for a whole table without currently respecting break-before and break-after properties on any level. The class (and its helpers) needs to be made restartable. This page is dedicated to find out how this should be done and to document this decision.

== Where are hard breaks possible inside tables? ==

According to the spec:
 * fo:table
 * fo:table-row
 * finally inside the block-level content of table-cells but not on fo:table-cells itself.

Just for completeness, here are the nodes on which hard breaks or possible inside lists as they will be quite similar to tables:
 * fo:list-block
 * fo:list-item
 * finally inside the block-level content of list-item-labels and list-item-bodies.

== Approach ==

It is best to look at the most complex case first, which are the breaks on table-cell content. I expect the rest to automatically click into place after that. The only non-trivial place will be the breaks on fo:table-row if a row is inside a multi-row row group in which case the problem is similar to the breaks inside table-cell content.

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org