Re: [css-text] Confused about the White Space Processing Details in CSS Text Module Level 3

On 12/04/2013 12:19 AM, Jon Ronnenberg wrote:
> Hi
>
> I'm the author of white-space[1] and is trying to comprehend the
> changes in the latest CSS Text Module Level 3 draft[2]. Especially
> part 4, about white space processing. In the last draft[3] and on
> the www-style list, it's been noted that web authors, myself
> included, would like to specify that white space between HTML
> elements are discarded.
>
> In the latest draft[2], the noted issue is gone,

Yes. It's closed for this level, but will be re-opened for Text
Level 4. (The reasoning for that is that for the type of trimming
that's wanted, it's often inappropriate to inherit it. So we'd
have to split the property into an inheritable one and a
non-inheritable one, figure out how line breaks play into this,
etc. Wrt use cases, using Flexbox for layout instead of inline
blocks will help a lot of cases, and also allow easier tweaking
of the resulting layout. Inline blocks weren't really designed
for these layout use cases.)

> but as far as I can tell, the spec now states that white space
> should be removed between HTML elements.

I'm not sure what you mean here.

> *My questions are:*
>
>  1. How do we, according to spec, retain a zero-width space
>     character near the segment break, to get the desired result?

You can't, in this level.

>  2. Removing and reinstating white space seems buggy to me. Is
>     there an error in the specs?

No, it's intentional. We're clearing out all the white space that
is being used for indentation. We're left with segment breaks,
which we can then look at in relation to the surrounding text to
figure out if that sequence should be collapsed to a space or
to nothing.

In between block elements, another effect takes place: an empty
anonymous box containing only collapsible whitespace is collapsed
away. http://www.w3.org/TR/CSS21/visuren.html#box-gen

So in your example, there will be white space between the inline
block elements, but not before or after (due to the stripping
rules at the beginning and end of a line). If the <li>s were blocks,
there would be no white space, because of the anonymous box rule
from CSS2.1.

> I understand the reason to have soft wrap opportunities and my
> questions is by no means a suggestion to get rid of them. I'm
> only concerned about converting segment breaks to white space
> between HTML elements. I think the specs are aiming at content text.
> E.g:
>
> <p>
> Lorem ipsum dolor sit amet, consectetur<!-- segment break -->
> adipisicing elit, sed do eiusmod tempor<!-- segment break -->
> incididunt ut labore et dolore magna aliqua.<!-- segment break -->
> </p>
>
> The above should reinstate white space between "consectetur"
> and "adipisicing" etc.

Yes, exactly.

Is there anything you need further clarification on?

~fantasai

Received on Thursday, 8 May 2014 23:25:52 UTC