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

On Fri, Sep 11, 2015 at 3:48 PM, Florian Rivoal <florian@rivoal.net> wrote:

> Hi,
>
> Sorry for the late answer.
>
> On 25 Aug 2015, at 22:59, Koji Ishii <kojiishi@gmail.com> wrote:
>
> I was re-reading NY F2F minutes[1] on the topic and came up with a few
> questions. Clarifications appreciated.
>
> 1. There's a resolution saying:
>   RESOLVED: pre-wrap preserves all spaces visibly and allows
>             wrapping before and after every space (to go into level
>             3 and mark as at risk)
> but this is not in the ED yet, am I correct? I remember I saw some PR from
> Florian (thank you for that) and would like to confirm this isn't done yet.
>
>
> It was this PR, https://github.com/w3c/csswg-drafts/pull/27
> As far as I am concerned, the PR does everything the resolution asked for,
> so I consider it done. Do you think I missed something?
>

You're right, I was only looking at the 'white-space' property and missed
"The White Space Processing Rules" was changed in this PR.

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?

3. I saw the discussion saying:
>   Similar to Word behavior.
>   So IE probably has the best behavior but isn't spec compliant.
>   We should fix it.
> but Word does not wrap at spaces, it just overflows to the right margin,
> so the same as Chrome/Safari.
>
>
> "Similar to word" is not what we resolved on for pre-wrap. We have a
> simpler and less magical behavior. The value that allows UAs to match
> platform conventions and do smart things, such as behaving like word, or
> going the OS X behavior is pre-wrap-auto, not pre-wrap.
>

Thanks, couldn't read that from minutes, so it's helpful.

4. In IE, as far as I looked at it, repetitive space characters cause wrap,
> but not by allowing break before and after space characters. It looks like
> "word + one or more spaces" is treated as unbreakable. The resolution above
> looks like different from IE, different from Word, and different from any
> other implementations.
>
>
> Right. Every browser today has different behavior, and we resolved to
> allow them to keep these behaviors under pre-wrap-auto.
>
> An old bug in Chromium[2] got my attention recently, but the resolution
> does not look to give the desired behavior to me. Could someone clarify?
>
>
> Implementing pre-wrap according to the spec as it is now would fix this
> bug. The current chrome behavior, if google likes it, can be preserved, but
> it should be called pre-wrap-auto.
>

Yeah, but I'm worried that AL + SP could be more trouble than it fixes, so
hesitant to fix as the spec says.

/koji

Received on Friday, 11 September 2015 07:24:29 UTC