W3C home > Mailing lists > Public > www-style@w3.org > November 2003

Re: [CSS2.1] Text 16.6.2 Bidirectionality with Whitespace Collapsing

From: Tex Texin <tex@i18nguy.com>
Date: Wed, 05 Nov 2003 16:53:23 -0500
Message-ID: <3FA97153.24349964@i18nguy.com>
To: fantasai <fantasai@escape.com>
Cc: www-style@w3.org, W3c I18n Group <w3c-i18n-ig@w3.org>

see below:

fantasai wrote:
> 
> Tex Texin wrote:
>  >
>  > http://www.w3.org/TR/2003/WD-CSS21-20030915/text.html#q9
> ...
>  > Or at least I assume ignoring bidi formatting characters and ignoring
>  > the directionality settings of elements are the same. (Maybe the css
>  > text should clarify that.)
> 
> That sentence is there so that spaces separated by bidi formatting
> characters will collapse; whether a character follows another character
> is independent of reordering. (Think: which side comes first -- left or
> right? The order we're talking about here has to be the byte order.)

Yes, the sentence says spaces separated by bidi formatting characters will
collapse.
However, supposing instead of the Unicode bidi formatting characters e.g. RLE,
supposing we use
<span dir="rtl">. The effect should be the same right?

Therefore I was thinking it might be worth pointing out that the direction of
elements is not to be considered
either, in this sentence.
"For each inline (including anonymous inlines), the following steps are
performed, ignoring bidi formatting characters as if they were not there:"

So, all of these spaces collapse together:
 <rtl> </rtl><ltr> </ltr><rtl> </rtl><ltr> </ltr>

Some people might think they need to be treated separately.



> 
>  > However, your example is different in that the ltr element doesn't have a
>  > trailing space.
>  >
>  >  "some <rtl> TEXT</rtl>"   versus "some<rtl> TEXT</rtl>"
>  >
>  > So the leading rtl space in your example remains, and therefore when, as stated
>  > in the CSS algorithm-
>  >
>  > "Inlines are laid out, taking bidi reordering into account"
>  >
>  > the space should be treated as rtl.
> 
> Quite.
> 
>  > However, we are talking about collapsing spaces and there is no collapsing
>  > going on. If there were multiple spaces at the front of the rtl element they
>  > would collapse as expected. Spaces at the end of the ltr element would collapse
>  > as described in the geo faq, with the leading rtl space not collapsing into the
>  > trailing ltr spaces.
> 
> You're missing the point. All of this can be inferred from the rules given in
> the CSS spec and the BiDi algorithm. The section 16.6.2 and the FAQ you mention
> are there (I believe) primarily for reinforcement -- to draw the readers'
> attention to this effect of the processing rules. They're not there to explain
> the interaction of bidi and collapsing so much as to explain unexpected whitespace
> behavior that results from whitespace and bidi processing.
> 
> The best way to avoid such behavior is to avoid leading and trailing spacing in
> elements. That is all.

Yes, but the spaces are going to have to be somewhere, they are not always in
the middle of elements.
The GEO FAQ concluded it was better to have them in the beginning.

(Although, I think the natural tendency is to put them trailing, just prior to
beginning the next element.

If I have a <a href=".">link</a> it feels more natural to start the new content
with data rather than spaces.

Maybe that is just me.)

tex

> 
> ~fantasai

-- 
-------------------------------------------------------------
Tex Texin   cell: +1 781 789 1898   mailto:Tex@XenCraft.com
Xen Master                          http://www.i18nGuy.com
                         
XenCraft		            http://www.XenCraft.com
Making e-Business Work Around the World
-------------------------------------------------------------
Received on Wednesday, 5 November 2003 16:54:19 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:25 GMT