On Sep 26, 2005, at 07:01, Manuel Mall wrote:
On Mon, 26 Sep 2005 05:25 am, Andreas L Delmelle wrote:
BTW, stumbled upon an interesting issue:
Does anyone know how percentages should be viewed in case the page's
height is indefinite? Or would this simply be something the user
shouldn't be doing at all (i.e. define the page-height to be
"indefinite", so that its ultimate value depends on the laid out
content, and at the same time define certain properties as having a
value that is a percentage of the page-height...?) My common sense
tells me that this is a circular reference, so the results are
"unpredictable", and I can safely create a pageHeightContext with bpd
set to Integer.MAX_VALUE...
I would say
a) in the case of percentages being defined on an indefinite base value
the behaviour is not defined in the spec, ie. left to the user agent.
b) in terms of protecting the user from him/herself
:-) Yeah, most people do need protection from themselves, don't they?
Even the best of us do --or should I say: _especially_ the best of us
;-)
a base value of 0 in this case may be preferable, at least you
wont get huge margins or regions. This could be caught in the
SimplePercentBase constructor so you don't have to have if-then-else
everywhere.
Alternatively,
c) if we want to be really nice to the user we could instead catch it
in
the percentage evaluation, in LengthBase.getBaseLength check if the
value to be returned is MAX_VALUE and if so force it down to 0 and log
a warning for the user.
Agreed. Which one of the two --well, perhaps the latter is indeed the
nicest, so I'll have a look at that ASAP.
Thanks for the FB.
Cheers,
Andreas