On Tue, 30 Aug 2005 08:27 am, Manuel Mall wrote:
> Finn,
>
> thanks a lot for looking at this.
>
> On Tue, 30 Aug 2005 03:19 am, Finn Bock wrote:
> > [Jeremias Maerki on ]
<snip/>
> > I'm hardly a specialist on the layout system, and that is where a
> > good sized part of Manuels patch is, but in the property system I
> > do not like the hack to LineHeightPropertyMaker and
> > FontSizePropertyMaker that test for a PercentLength since it will
> > not work for expressions. I assume that a FixedLength is returned
> > because somebody
> > (BlockLM.createLineManager?) tries to resolve line-height before a
> > context is available. The solution is to delay resolution of
> > line-height, by passing the Length into the LineLM.
>
> Agree, and I have a solution for that ready to go.
>
I think this deserves some further comment / discussion. One, IMO 
important, reason I want to do the evaluation during the FO parsing 
stage is that once we are in the LMs we lost the property inheritance 
information. That is something like:
   <fo:block font-size="120%">
      <fo:block>Text</fo:block>
   </fo:block>

looks to the LM like:
   <fo:block font-size="120%">
      <fo:block font-size="120%">Text</fo:block>
   </fo:block>

but that is clearly incorrect as we should inherit the calculated value 
not the specified value.

If we do the resolution at FO parsing time the LM see:
   <!-- assuming we have a 12pt base font-->
   <fo:block font-size="14.4pt">
      <fo:block font-size="14.4pt">Text</fo:block>
   </fo:block>
and all is fine.

The same applies to line-height. Luckily the vast majority of properties 
which allow percentage specification don't inherit by default 
(exceptions are: provisional-label-separation and 
provisional-distance-between-starts). However, most properties allow 
the "inherit" keyword. This will currently give wrong results, e.g.:

   <fo:block margin="10%" padding="5pt">
      <fo:block margin="inherit">Text</fo:block>
   </fo:block>

would be seen by the LM as:

   <fo:block margin="10%" padding="5pt">
      <fo:block margin="10%">Text</fo:block>
   </fo:block>

resulting in the wrong margin being applied to the inner block.

This is a pretty hard problem to solve I think given that we have lost 
the information if a value is specified or inherited at the LM stage. 
However, it may(?) not occur very often in practice so I am tempted to 
ignore it for the time being.

Manuel

PS: I can imagine Victor smiling now :-) : "I told you so that not 
leaving all property resolution to the LM stage is going to cause 
trouble". 

<snip/>
> > regards,
> > finn

Manuel

Reply via email to