On Tue, 30 Aug 2005 04:16 pm, Manuel Mall wrote:
> On Tue, 30 Aug 2005 04:05 pm, Finn Bock wrote:
> > [Manuel]
> >
> > >>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>
> >
> > True, but the percentbase of the second 120% should be the same as
> > the base of the first.
>
> Yes, but this is exactly the problem. The "real" percentbase, that is
> the actual value to use, is determined in the general case during
> layout. So the LM just sees 'font-size="120%"' and now has to figure
> out the base to use. But it doesn't know that the 120% was actually
> inherited in the 2nd case and that it would need to backtrack to the
> parent to determine the base from there.
>

Here is my solution: Instead of the parent FO I store with every 
LengthBase the actual FO on which the property was defined.

This FO is passed into the length base resolution interface implemented 
by the LMs. An LM instead of attempting to resolve against itself will 
first traverse the LM chain upwards (starting with itself) until it 
finds the LM responsible for that FO. It will then call the resolution 
method on that LM.

I think it works and solves the inheritance problem (basically by 
storing the inheritance information in the properties but only for 
percentage based property values).

I'll put a revised patch together.

> > They are both 120% of a value on <fo:flow>. So
> > when evaluated, the result values will be the same. All inheritance
> > must be resolve by the property system.
> >
> > Otherwise it is a bug.
> >
> > The reason for keeping the values as percentage is to support
> > font-size="120% + 1pt" and to *really* open the discussion it
> > should be noted that the spec does *not* require additive operation
> > on relative lengths. Only multiplications are required.
>
> I wouldn't worry about that. The current system handles it fine.
>
> > Once the expression engine in fop tried to use that by calculating
> > a factor to be applied to relative lengths.
> >
> > Does svn view have an attic?
> >
> > http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/trunk/src/java/or
> >g/ apache/fop/fo/
> >
> >
> > If it does I could propably find the code, it wasn't pretty.
> >
> > regards,
> > finn
>
> Manuel

Manuel

Reply via email to