W3C home > Mailing lists > Public > www-style@w3.org > May 2012

Re: [css3-text] interaction of hanging-punctuation:force-end, text-align and text-justify

From: Florian Rivoal <florianr@opera.com>
Date: Sat, 05 May 2012 07:09:49 +0200
To: www-style@w3.org
Message-ID: <op.wdtkmnqf4p7avi@eeeflorian>
On Sat, 05 May 2012 02:03:28 +0200, fantasai  
<fantasai.lists@inkedblade.net> wrote:

> On 05/04/2012 02:02 PM, Florian Rivoal wrote:
>> On Fri, 04 May 2012 20:23:25 +0200, Koji Ishii  
>> <kojiishi@gluesoft.co.jp> wrote:
>>
>>>> If text-align is center or <string>, I am even more at loss when  
>>>> trying to imagine what the
>>>> expected behavior is.
>>>
>>> I hope it's clear now, UA measures string without the ending stop, and  
>>> center the line, if "force-end".
>>
>> Do you mean this?
>>
>> |    ab c de    |,
>>
>> text-align: "." center; hanging-punctuation:force-end;
>> |  1234.56    |,
>> |     1.2     |,
>
> No. You have to understand that hanging-punctuation *does not* mean
> that the punctuation is forced outside the line box.

With allow-end, of course. But I though the goal of force-end was
precisely to do that. As it seems it isn't, maybe force-end isn't a good  
name.

> It means that the punctuation is considered to have a zero advance width
> *when* it is defined to "hang".
>
> That is all. Period.

So, if the only effect of force-end is to not measure the advance of the  
punctuation,
then example 17 should not look the way it does, unless text-align:justify  
is also applied, which should be reflected in the css shown. Otherwise, it  
reinforces the preconception that "hangs" means "is put outsite of the  
line box".

That would also mean that force-end and allow-end have the exact same  
effect on left aligned ltr text and right aligned rtl text. On centered  
text (when the line isn't full), it would just mean a slight shift towards  
the end of the line.

After re-reading the spec, I think that that is indeed what it tries to  
says. In that case, I think we have a terminology issue. I take the  
classical meaning of "a punctuation mark hangs" outside of this spec to be  
that it is put in the padding/margin. Due to that, when I read "When a  
punctuation mark hangs, it is not considered when measuring the line's  
contents for fit, alignment, or justification." I thought it was  
describing an effect of what happens when punctuations is put into the  
padding/margin due to allow-end or force-end.

I now think that this sentences is actually defining what "hangs" means in  
this spec. That should be made more obvious, since it is redefining a term  
that has a preexisting meaning.

Also if "hang" is defined by the above sentence, it is used inconsistently.

  - "At most one punctuation character may hang outside each edge of the  
line." only makes sense with th classical meaning of "hangs".

  - the description of the 'none' value should then probably be "no  
character hangs" rather than "no character can hang", as the later wording  
suggests the classical meaning of "hangs".

  - "Non-zero start and end borders or padding on an inline box are not  
allowed to hang" is problematic, as you have only defined "hang" for  
punctuation marks, not for borders or padding

  - "a period at the end of an inline box with end padding cannot hang  
outside the end edge of a line." does "hang" in this case mean "end up  
outside of the line box" or "isn't measured for the sake of fit,  
alignment, or justification". The sentence makes most sense with the first  
meaning, but even though you say that only the second meaning holds.

If I have now correctly understood the expected behavior, I think a  
rewording is in order, either to make the definition of "hang" more  
explicit and to use it more consistently, or to let "hang" have its  
classical meaning of "ends up outside the line box", and to use another  
term for "isn't measured for fit, alignment, or justification"

If I am still wrong about what this is supposed to mean, then please  
enlighten me.

  - Florian
Received on Saturday, 5 May 2012 05:05:00 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:53 GMT