Use the second set of test cases attached to Bug #36010 as an example. When setting word-spacing="0pt" (which should (nearly) be the same as word-spacing="normal" or no word-spacing at all) the block is not justified. Same applies for the word-spacing="-3pt" example. However, word-spacing="normal" works fine as does something like <fo:block text-align="justify" word-spacing.optimum="6pt" word-spacing.minimum="3pt" word-spacing.maximum="12pt">.
I'm not sure whether this behaviour is wrong. The recommendation (7.16.8) states that "<space> This allows the user to specify a range of adjustments in addition to the default space between words. The minimum and maximum values specify the limits of the adjustment." Setting word-space="0pt" (which means .minimum="0pt", .optimum="0pt", .maximum="0pt") you tell the application that there is no possible space adjustment, so there is no way to justify the text, unless adjusting explicitly-set letter-spacing. But I could just be wrong, is there any clarifying opinion?
Luca, interesting point. It was my understanding from the reading of the spec that "normal" and "0pt" are virtually the same: For "normal": .optimum = ("the normal inter-word space, as defined by the current font and/or the UA" - "the inline-progression-dimension of the glyph-area obtained by formatting the fo:character") / 2, .maximum = .optimum, .minimum = .optimum, .precedence = force, and .conditionality = discard. For a <length>: .optimum = <length> / 2, .maximum = .optimum, .minimum = .optimum, .precedence = force, and .conditionality = discard. These two formulas would give the same values for length="0pt" assuming "the normal inter-word space, as defined by the current font and/or the UA" is the same as "the inline-progression-dimension of the glyph-area obtained by formatting the fo:character". But when specifying "normal" the block is properly justified.
The spec contains many comments that these feature are very user agent- dependant. So I think we have some liberty (or uncertainty) on how we implement this. IMO text-align="justify" should probably override a restricting word-spacing setting. In this case it should probably simply contribute minimum and optimum values but not allow the maximum constraint to restrict the stretchability necessary for the justification.
Yes, the spec gives quite a bit of leeway to the UA. Are you saying it is probably OK that the cases word-spacing="normal" and word-spacing="0pt" produce different output (with respect to justification)? I am quite unsure about that.
I'm unsure, too, but indeed, reading the thing again, word-spacing="0pt" and word-spacing="normal" seem to be the same. The space is in addition (!) to the normal spacing so it should not really be a real interaction with the spacing generated by text-align="justify". The spec says that there "may be implementation-specific limits" when word-spacing is negative. I still think that justification mostly overrides word-spacing if its restrictions cannot be met.
Maybe there is a case (although unlikely, I must admit!) which could make significant to have word-spacing="0pt" != word-spacing="normal" Let's suppose I want some text to be justified modifying only the letter spaces, while I desire word-spaces to have all the same width: I would easily set letter-spacing.minimum, .optimum and .maximum as I wish, and word- spacing="0pt". But if word-spacing="0pt" is the same as "normal", to avoid word space adjustment I should set word-spacing.minimum="Xpt", .optimum="0pt" and .maximum="-Y", where X and Y are meant to "undo" the stretch and shrink of a word space (which are application dependent, so I could not know them). To be more clear: I thought that a word space min-opt-max values come from the size of a space character, let's call it W, according to the font; if the property "word-spacing" is explicitly set, then the resulting min-opt-max size is: W + .minimum, W + .optimum, W + .maximum while when word-spacing is "normal" we use some hard-coded, default values, obtaining: W + UA.min, W + UA.opt, W + UA.max But if I don't succeed in convincing you, I won't insist :-)
As I said, I'm unsure about this. Simply the fact that there is an enum value "normal" for word-space and the default is not "0pt" suggests that you're probably right and "normal" may indeed have a different meaning. Let's simply make sure all the variants are documented using test cases. They are so precious in discussions like these. I almost sound like I'm obsessed with test cases, but then I probably am. :-)
Luca, your interpretation seems reasonable but I interpreted the spec to suggest for the "normal" case: .maximum = .optimum and .minimum = .optimum. This appears to be in conflict with your interpretation that allows for .maximum <> .optimum and .minimum <> .optimum in the "normal" case. Of course being so new to all of this I won't insist either :-).
I tend to agree with Luca here. If text-align="justify" then it is perfectly reasonable that word spacing is adjusted and if the user has specified a word- spacing min/max with no leeway then justification may not work. This seems reasonable as word-spacing is an advanced setting and so users who change it should be aware that it may have ramifications on justification. Another way of looking at this is text-align="justify" is the case where word- spacing="0pt" != word-spacing="normal" Again, this seems reasonable. I am inclined to reject this bug, but perhaps we should wait for opinions from other committers first.
resetting P2 open bugs to P3 pending further review