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





--- Comment #3 from Andreas L. Delmelle <adelme...@apache.org>  2009-07-16 
14:03:20 PST ---

Just some additional notes explaining the behavior, that even though it seems
unexpected, is actually OK.

For compound properties, specifying only one of the components is equivalent to
setting all the other components to their initial value. They are not
initialized with the inherited value, since the components are NOT(!) separate
properties. Implicit inheritance is always defined on the level of the complete
property. If one of the components appears as a specified value, the entire
property is no longer inherited. If we want to inherit some of the components
and override others, we need to use explicit values of 'inherit'. (Seems to be
precisely one of the prime use-cases for that keyword)

IOW:
<block space-before="2em">
  <block space-before.conditionality="retain">

is semantically equivalent to

<block space-before.optimum="2em"
              space-before.conditionality="discard"
              space-before.precedence="0">
  <block space-before.optimum="0pt"
                space-before.conditionality="retain"
                space-before.precedence="0">

To achieve the expected result, the correct spec would be:
<block space-before="2em">
  <block space-before.optimum="inherit" space-before.conditionality="retain">

Technically, in FOP (see also the Wiki about property resolution) specified
values are always processed first and added to the PropertyList. Later, when
binding the PropertyList to the FObj, if there was no specified value for a
given applicable property, inheritance will always be tried before reverting to
the initial value.
When processing the specified properties, and encountering a specified
component, we first check if the compound property already exists on the
PropertyList. In this context, we don't try inheritance, as we're actually
looking for a base property that possibly resulted from other components that
were processed before (= appeared earlier in the Attributes). 
If it does not exist, then we generate that base property, also bypassing
inheritance, since we're creating an instance for a specified value.

I think this is completely in line with the Recommendation (5.1.4), which hints
at the inherited value actually being a fallback for an absent specified value
(not a replacement for the initial value; note the order of the resolution
rules in 5.1.1).

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