On 10.01.2005 22:00:01 Simon Pepping wrote: > Section 5.3.2 of the spec is really hard to understand. I combine it > with 5.1.4 about Inheritance. Then my guess is this: > > <fo:block margin-left="1pc">A test file > <fo:inline-container start-indent="1.5pc"> > <fo:block margin-left="1pc">A test file</fo:block> > </fo:inline-container> > </fo:block> > > The computed value of start-indent on the outer block is 'start-indent > = inherited_value_of(start-indent) + margin-corresponding + > padding-corresponding + border-corresponding-width' = 0 + 1pc + 0 + > 0. The computed value of start-indent on the inner block is > 'start-indent = inherited_value_of(start-indent) + > margin-corresponding + padding-corresponding + > border-corresponding-width' = 1.5pc + 1pc + 0 + 0. > > In this case: > > <fo:block margin-left="1pc">A test file > <fo:inline-container> > <fo:block margin-left="1pc">A test file</fo:block> > </fo:inline-container> > </fo:block> > > the computed value of start-indent on the outer block is 'start-indent > = inherited_value_of(start-indent) + margin-corresponding + > padding-corresponding + border-corresponding-width' = 0 + 1pc + 0 + > 0. The computed value of start-indent on the inner block is > 'start-indent = inherited_value_of(start-indent) + > margin-corresponding + padding-corresponding + > border-corresponding-width' = 1pc + 1pc + 0 + 0. The inherited value > uses the calculated value (sect. 5.1.4). That is the value that should > be returned by > pList.getParentPropertyList().get(Constants.PR_START_INDENT).getLength().
I agree with your interpretation. > The inherited value should not be stored, but used in the computation > of the property value. This should be implemented by the property > maker. In the meantime I've rewritten that part and removed the two fields I introduced on CommonMarginBlock. But the code needs some more work until I'm ready to check in. All testcases pass again but I don't have any tests for writing mode changes which is important for the MarginPropertyMaker I wrote to get the computed margin values. > When I run the above examples in a debugger, I find that the computed > start-indent values CommonMarginBlock.startIndent are exactly like I > argue above they should be. Yes. > There does not seem to be a need to add > the inherited value later; the property maker already has done so. See > IndentPropertyMaker.compute(PropertyList). It uses > propertyList.getInherited(baseMaker.propId).getNumeric()) to get the > inherited value. Earlier FOP developers understood this part well. I understand, but I think you're talking exclusively about the property resolution phase (right?) while I found that I need the computed value of the margin property (not only the explicit one as is currently the case) and the inherited start-indent for the layout manager code and to set traits correctly. > If you find wrong results, then the problem must be elsewhere. Yes, in the layout managers. > Is there a book or treatise on these subjects, where we can read how a > knowledgeable author interprets these difficult parts of the spec? I don't know. We're probably stuck with the FO-related mailing lists. Please have patience with me while I'm learning my way into layout. I can already feel my understanding of the whole thing growing from hour to hour and I'm grateful for any insight you can provide. I'm sorry for being a moving target. It's too bad that the ICLayoutManager is still empty so your examples above cannot be tested, yet, but I have other examples that help show similar effects with what already works. Jeremias Maerki