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(). The inherited value should not be stored, but used in the computation of the property value. This should be implemented by the property maker. 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. 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. If you find wrong results, then the problem must be elsewhere. Is there a book or treatise on these subjects, where we can read how a knowledgeable author interprets these difficult parts of the spec? Regards, Simon On Fri, Jan 07, 2005 at 09:26:15AM +0100, Jeremias Maerki wrote: > Finn or Simon, > > would you please check if it is acceptable to put the inherited values > directly into the CommonMarginBlock? It might have been cleaner to > always get the value via the parent FO but I think in this case it helps > simplifying the code in TraitSetter and BlockLayoutManager. > > On 07.01.2005 09:21:21 jeremias wrote: > > jeremias 2005/01/07 00:21:21 > > > > Modified: src/java/org/apache/fop/fo/properties CommonMarginBlock.java > > src/java/org/apache/fop/layoutmgr TraitSetter.java > > BlockLayoutManager.java > > Log: > > Bugfix for start-indent calculation for nested blocks. The inherited > > start-indent wasn't taken into account as described in 5.3.2 of the spec. > > Minor style and javadoc improvements on the way. > > <snip/> > > > Revision Changes Path > > 1.5 +34 -2 > > xml-fop/src/java/org/apache/fop/fo/properties/CommonMarginBlock.java > > > > Index: CommonMarginBlock.java > > =================================================================== > > RCS file: > > /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/CommonMarginBlock.java,v > > retrieving revision 1.4 > > retrieving revision 1.5 > > diff -u -r1.4 -r1.5 > > --- CommonMarginBlock.java 28 Oct 2004 10:00:24 -0000 1.4 > > +++ CommonMarginBlock.java 7 Jan 2005 08:21:21 -0000 1.5 > > @@ -1,5 +1,5 @@ > > /* > > - * Copyright 1999-2004 The Apache Software Foundation. > > + * Copyright 1999-2005 The Apache Software Foundation. > > * > > * Licensed under the Apache License, Version 2.0 (the "License"); > > * you may not use this file except in compliance with the License. > > @@ -70,6 +70,16 @@ > > public Length endIndent; > > > > /** > > + * The inherited "start-indent" property. > > + */ > > + public Length inheritedStartIndent; > > + > > + /** > > + * The inherited "end-indent" property. > > + */ > > + public Length inheritedEndIndent; > > + > > + /** > > * Create a CommonMarginBlock object. > > * @param pList The PropertyList with propery values. > > */ > > @@ -84,5 +94,27 @@ > > > > startIndent = pList.get(Constants.PR_START_INDENT).getLength(); > > endIndent = pList.get(Constants.PR_END_INDENT).getLength(); > > + > > + if (!pList.getFObj().generatesReferenceAreas()) { > > + inheritedStartIndent = pList.getParentPropertyList() > > + .get(Constants.PR_START_INDENT).getLength(); > > + inheritedEndIndent = pList.getParentPropertyList() > > + .get(Constants.PR_END_INDENT).getLength(); > > + } > > + } > > <snip/> > > > > Jeremias Maerki > -- Simon Pepping home page: http://www.leverkruid.nl