You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Andreas L Delmelle <a_...@pandora.be> on 2005/09/23 18:12:17 UTC
Q: Padding props -- fixed lengths?
Hi,
A question: I noticed that the warning about tables having padding and
border-collapse="collapse" has been commented out recently, since
"hasPadding() now requires context".
Can anyone explain why precisely this was done? IOW: why does a
PercentBaseContext *always* need to be provided? Why is hasPadding()
not simply overloaded --one with a context, and one without?
It almost makes it seem as if padding always needs to be specified as a
percentage-width, or somehow a fixed-length is always interpreted as
"the specified fixed-length * 100%"...?
Thanks,
Andreas
Re: Q: Padding props -- fixed lengths?
Posted by Manuel Mall <mm...@arcus.com.au>.
On Sat, 24 Sep 2005 05:22 pm, Andreas L Delmelle wrote:
> On Sep 24, 2005, at 10:39, Andreas L Delmelle wrote:
> > On Sep 24, 2005, at 03:36, Manuel Mall wrote:
> >> <snip />
> >
> > Thanks for the info Manuel.
>
> Ok then:
> Instead of using hasPadding(), which tries to evaluate the specified
> value, we could also provide a method hasPaddingInfo() (analogous to
> the hasBorderInfo() method I added yesterday).
>
> This method would just check if the padding is null for every side,
> without doing any evaluation. It would allow the check to remain in
> the FOTree --the user would get a warning *if* padding was specified,
> no matter whether it ultimately evaluates to zero or not, just as a
> hint that the eventual value will be ignored by layout.
>
Yes, that's certainly an option and will probably catch 90% or more of
real life cases.
>
>
> Cheers,
>
> Andreas
Rgds
Manuel
Re: Q: Padding props -- fixed lengths?
Posted by Andreas L Delmelle <a_...@pandora.be>.
On Sep 24, 2005, at 10:39, Andreas L Delmelle wrote:
> On Sep 24, 2005, at 03:36, Manuel Mall wrote:
>
>> <snip />
>
> Thanks for the info Manuel.
Ok then:
Instead of using hasPadding(), which tries to evaluate the specified
value, we could also provide a method hasPaddingInfo() (analogous to
the hasBorderInfo() method I added yesterday).
This method would just check if the padding is null for every side,
without doing any evaluation. It would allow the check to remain in the
FOTree --the user would get a warning *if* padding was specified, no
matter whether it ultimately evaluates to zero or not, just as a hint
that the eventual value will be ignored by layout.
Cheers,
Andreas
Re: Q: Padding props -- fixed lengths?
Posted by Andreas L Delmelle <a_...@pandora.be>.
On Sep 24, 2005, at 03:36, Manuel Mall wrote:
> <snip />
Thanks for the info Manuel.
Cheers,
Andreas
Re: Q: Padding props -- fixed lengths?
Posted by Manuel Mall <mm...@arcus.com.au>.
On Sat, 24 Sep 2005 03:45 am, Andreas L Delmelle wrote:
> On Sep 23, 2005, at 18:12, Andreas L Delmelle wrote:
> > <snip />
> > It almost makes it seem as if padding always needs to be specified
> > as a percentage-width, or somehow a fixed-length is always
> > interpreted as "the specified fixed-length * 100%"...?
>
> Or, more correctly: as if the fixed-length is converted to a
> percentage only to be recalculated, so that you end up with the exact
> same value...?
>
> Somehow this seems suboptimal. Let me know if I'm missing anything.
>
Andreas,
I think this is a misunderstanding. Firstly you can specify a padding
width in any way allowed by the spec. However, if you want to get the
computed/absolute value anywhere you need to provide a context for
percentage evaluation as the width in question could have been
specified by the user as a percentage. The property system will only
use the context if the specified value is a percentage otherwise it
will ignore it.
The case in question is tricky as the context is only available during
layout but in this case a padding width is attempted to be evaluated
during fo tree parsing. In the general case that can not be done as if
the width is specified as a percentage you have to wait until layout to
get typically the ipd on which the percentage is based. Therefore the
whole logic of trying to determine "hasPadding" during fo tree
construction is misplaced. This is further complicated by the
possibility that the specified value can be an expression containing a
percentage (eg. 5% - 5pt). There is no way to determine if this
expression evaluates to 0 or not until layout.
> Thanks,
>
> Andreas
HTH
Manuel
Re: Q: Padding props -- fixed lengths?
Posted by Andreas L Delmelle <a_...@pandora.be>.
On Sep 23, 2005, at 18:12, Andreas L Delmelle wrote:
> <snip />
> It almost makes it seem as if padding always needs to be specified as
> a percentage-width, or somehow a fixed-length is always interpreted as
> "the specified fixed-length * 100%"...?
Or, more correctly: as if the fixed-length is converted to a percentage
only to be recalculated, so that you end up with the exact same
value...?
Somehow this seems suboptimal. Let me know if I'm missing anything.
Thanks,
Andreas