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

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

From: fantasai <fantasai@escape.com>
Date: Wed, 05 Nov 2003 14:40:58 -0500
Message-ID: <3FA9524A.9090201@escape.com>
Cc: www-style@w3.org, W3c I18n Group <w3c-i18n-ig@w3.org>

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.)

 > 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.

~fantasai
Received on Wednesday, 5 November 2003 14:41:03 GMT

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