Re: ISSUE-229 Combining justification and whitespace:pre*

On Mon, Mar 19, 2012 at 3:12 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> Right now, CSS 2.1 specifies that text-align:justify doesn't do
> anything when combined with whitespace:pre or pre-wrap.  As far as I
> can tell, this was done due to no one having any good use-cases (and
> thus no one knowing how it should really work in some cases).
>
> I've been contacted by some internal people about this, because
> they're working on docs stuff.  They want to both (a) preserve the
> spaces that the user has typed in, like desktop word-processing
> software does, and (b) justify text when the user requests it.  (a)
> can only be done with a whitespace value.  (You can't use &nbsp;,
> because then things don't break properly.)
>
> The troublesome case seems to be combining all of this with tabs,
> because you want tab-stops to still line up between lines.  MS Word's
> behavior is to only justify the part of the line that comes after the
> last tab character on the line, and my internal people say that's fine
> for them too.
>
> Are there any other issues with this that we can resolve while I have
> the ear of relevant people?  If not, can we relax this restriction in
> Text?

Based on discussion at the conf call today, it looks like Text
*already* deals with this case adequately.  In particular, in
'text-align' there's this paragraph:

# In the case of ‘justify’, the UA may stretch or shrink any inline
boxes by adjusting their text in addition to shifting their positions.
(See also ‘text-justify’, ‘letter-spacing’, and ‘word-spacing’.) If an
element's white space is set to be collapsible, then the UA is not
required to adjust its text for the purpose of justification and may
instead treat the text as having no expansion opportunities. If the UA
chooses to adjust the text, then it must ensure that tab stops
continue to line up as required by the white space processing rules.

Except for the accidental error where "collapsible" is used instead of
"non-collapsible", this allows exactly the behavior I was asking for.

So, nothing needs to change in Text.

~TJ

Received on Wednesday, 11 April 2012 18:04:17 UTC