While working on the implementation of hyphenation-ladder-count, I noticed
that at the moment the property system can return "illegal" values
coming from the fo file instead of the "fallback" value defined by the
specs.
There are significant differences in wording between XSL 1.0 and 1.1: for
example, concerning hyphenation-ladder-count 1.0 has (7.15.2):
"<integer> an integer greater than or equal to 1"
While 1.1 (7.16.2) reads:
"<number> an integer greater than or equal to 1. If a zero, negative, or
non-integer value is provided, the value will be rounded to the nearest
integer value greater than or equal to 1"
So, should the property be improperly set to -0.5:
- if we want to follow closely 1.0, we should stop with an error
- if we follow 1.1 we should continue using 1 instead, maybe with a
warning message
There are other properties with a "validity range" and a fallback value:
column-count, initial-page-number, column-number, number-columns-repeated,
number-columns-spanned, number-rows-spanned, hyphenation-{push,
remain}-character-count; only hyphenation-ladder-count does not have a
fallback value in 1.0, so maybe this was just an oversight.
Note that the fallback value is different, in general, from the default
value, as it is derived from the illegal value by rounding.
At the moment the layout process continues with the incorrect values, and
this could create errors in several different places; for example a
non-integer value would probably create an error if we assign it to an
integer variable, a negative integer value could create an
IllegalArgumentException if we use it as the size of an array (this
happens, for example, with a negative column-count) ...
Regards
Luca