W3C home > Mailing lists > Public > www-style@w3.org > July 2008

Re: CSS 2.1 text-align:justify issue [CSS2.1] [css3-text]

From: Bert Bos <bert@w3.org>
Date: Fri, 25 Jul 2008 16:26:05 +0200
Cc: "www-style@w3.org" <www-style@w3.org>
To: Undisclosed.Recipients: ;
Message-Id: <200807251626.05426.bert@w3.org>

On Monday 21 July 2008 23:42, fantasai wrote:
> 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.
>
> Recorded as CSS2.1 Issue 53:
>    http://csswg.inkedblade.net/spec/css2.1#issue-53
>
> Proposed text:
>
>    Replace
>      "If the computed value of text-align is 'justify' while the
> computed value of white-space is 'pre' ... initial value."
>    with
>      "When 'text-align' is 'justify', characters and letter-spacing
> whose computed value of white-space is not 'normal' and not 'nowrap'
> must not be stretched (or shrunk) during justification."

I think the idea is fine, although it may be a bit late to change it 
now. It was already in the CR four years ago. But maybe we can contact 
the implementers outside the WG that we know and ask if they mind 
changing their code...

I don't like the proposed text very much, though. How about this:

In 16.2, replace

    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.

with

    If the computed value of 'text-align' is 'justify' and the computed
    value of white-space is 'pre', 'pre-line' or 'pre-wrap', then the
    actual value of 'text-align' is set to the initial value.

    If an element has a computed value for 'white-space'
    of 'pre', 'pre-line' or 'pre-wrap', then neither the glyphs in that
    element nor the spaces between them must be stretched or shrunk for
    the purposes of justification.

    *Note* that this applies also to elements to which 'text-justify'
    itself does not apply, e.g., inline elements in a justified
    block-level element.

The first paragraph just adds the missing 'pre-wrap', but otherwise 
keeps the notion of using the initial value for 'text-align', which 
disappeared in Elika's rewrite.

The second tries to express what Elika's text said, but, I think, more 
precisely.

The third is a note to explain what the difference between those two 
paragraphs is.

> I also noticed that the note at the end of the section should be
> normative, not non-normative.
>
> Proposal:
>
>    Make note after example normative.

No objection, but it doesn't seem to matter. It's redundant, hence the 
note. It's also true, so you can make it normative. But whether 
normative or not, it is not a testable statement.



Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos                               W3C/ERCIM
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France
Received on Friday, 25 July 2008 14:26:46 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:10 GMT