Re: [css-text] white-space: pre-wrap

On 09/24/2015 03:13 AM, Florian Rivoal wrote:
>>>> 2. The resolved behavior would give you a bit strange experience if a word ends at the right margin, then you'd see the space character on the beginning of the next line. Are we sure we want this behavior?
>>>
>>> I think so. The author asked for preserve and wrap, that's what he gets. For "smart" perserve and wrap, allowing UAs to decide what to do about spaces left at the end of the line, you can use the pre-wrap-auto value instead.
>>>
>>> And if the author wants to be explicit (rather than automagic) about removing spaces at the end of the line, there's the pre-wrap-trim value to be added in level 4 (I'll send a pull request about this shortly).
>>
>> Preserving is fine, I agree, but can you share in what use cases who asked to wrap before a space character?
>>
>> Take an example: "hello world" and it hits right margin after "o". You will then see a space at the beginning of the 2nd line.
>>
>> So to re-word my question, break between SP + SP is ok, but I wonder whether AL + SP makes sense or not, and whether this is intentional?
>
> The main point of the F2F discussion was SP+SP. Whether AL+SP should be a special case was briefly mentioned during the discussion, and we prefered keep the model simple and predictable. I think that's particularly valuable in editable text fields using pre-wrap: whenever you press space, you visibly insert a space, if there was room on the line, then it goes there. If there is not, it goes to the next line. That makes editing much more predictable and understandable.

Spaces introduce a break opportunity after them, but not before them.
There's an additional rule in Unicode that SP+SP does not break, and
that is the rule we're removing. However, AL+SP still will not break.

~fantasai

Received on Thursday, 24 September 2015 16:21:33 UTC