I'm not sure it is always possible to do this: sometimes the representation of a block depends on the properties of a higher level block. For example:
outer block | --------- | | inner inner block block 1 2
In order to decide whether there can be a page break between the lines generated by innerBlock1 and innerBlock2, we must know: - if inner block 1 has keep-with-next - if inner block 2 has keep-with-previous - if outer block has keep-together This can be done if the outer BlockLM calls receives the elements created by its child, looks at them and adds / removes / corrects; could this be done if the inner BlockLMs directly give their element to the top-level LM?
I would pass the element on the immidiate parent, which recursively passes them on the top-level LM in the direction. For inline, the toplevel would be LineLM and for blocks it would be the PageLM.
BTW, what about your great refactoring of all the knuth code?
I do not have the time atm to do the followup and bugfixes, so it will have to wait. If anyone also wants to commit it, feel free.