On Tue, Feb 17, 2004 at 09:31:52PM +0100, Finn Bock wrote: > > [J.Pietschmann] > > >The layout context has the actual IPD MinOptMax. There is no > >inherent reason it should have a link to a parent context or the > >property subsystem, it's only necessary to have a method to > >resolve a property expression given a set of MinOptMax for > >the various traits which can be used as references for > >percentages. Like > > textIndent=propertyManager.get(TEXT_INDENT).resolve(layoutContext); > > Right, but it doesn't have all the base lengths. For some base lengths > it is one of the parent layout contexts that has the trait, like ipd of > the containing reference area. How could we get hold of that trait if > the LayoutContexts isn't linked together? > > Whatever object that is passed to the resolve() method must also AFAICT > also have a reference to the FO so that the resolve() can find the right > LayoutContext in the LayoutContext tree to use as base. > > Perhaps I'm missing something fundamental in your suggestion, but I just > can see how there is enough information in a single LayoutContext to > resolve relative lengths that is inherited from a parent fo:element.
In the LayoutContext design, one does not climb a tree to find the relevant information; instead, the information is propagated downward for ready reference. Each getNextBreakPoss call gets a LayoutContext from its caller, and constructs one for its own calls to getNextBreakPoss. It should make sure that the latter LayoutContext contains all the relevant information, such as the width of the containing block and of the containing reference area. Either it copies it from the LayoutContext it received from its caller, or it inserts new values, as appropriate. In principle it should contain the dimensions that correspond to the percent based length types listed in LengthBase. Regards, Simon Pepping -- Simon Pepping home page: http://www.leverkruid.nl