Re: CSS 2.1 text-align:justify issue

On 06/22/2008 09:20 PM, Robert O'Callahan wrote:
> http://www.w3.org/TR/CSS21/text.html says
> "If the computed value of text-align is 'justify' while the computed
> value of white-space is 'pre' or 'pre-line', the actual value of
> text-align is set to the initial value."
>
> There are two problems:
> 1) white-space can apply to inline elements, so this statement doesn't
> achieve the apparent intent of disabling text-align:justify on
> white-space:pre/pre-line elements. One could have a white-space:normal,
> text-align:justify block containing a big lump of white-space:pre
> content, or likewise a white-space:pre, text-align:justify block
> containing white-space:normal content.
> 2) Why are pre-line and pre singled out here, but pre-wrap is not?
> pre-line without any newlines present behaves just like pre-wrap.
>
> I suggest this be replaced by a statement somewhere that preformatted
> spaces may not be stretched by text-align:justify.

Ok, I've worked through this issue a few times, and I think the whole
paragraph should simply be deleted and instead replaced with a statement
that "Lines that end in a forced break must not be justified, and are
instead aligned as if text-align had its initial value." or somesuch.

The original intent of the paragraph, afaict
   http://lists.w3.org/Archives/Member/w3c-css-wg/2000OctDec/0263.html
   http://lists.w3.org/Archives/Member/w3c-css-wg/2000AprJun/0084.html
was to clarify that force-wrapped lines do not get justified and are
instead start-aligned.

But with the introduction of 'pre-line', 'pre-wrap', and the application
of 'white-space' to inline elements, this paragraph now introduces an
arbitrary restriction for, afaict, no good reason. If the author is
specifically requesting both preserved white space and justification,
then he should get justification on any soft-wrapped lines. (If he
didn't want justification, he would simply not specify justification.
And if he wants justification on hard-wrapped lines, then he can use
the additional justification controls from CSS3 Text.)

If inheritance through <pre> is a problem, then we should address that
in the default style sheet.

   pre { text-align: initial; }

~fantasai

Received on Wednesday, 7 July 2010 12:26:43 UTC