W3C home > Mailing lists > Public > www-style@w3.org > May 2011

[CSS21] [css3-writing-modes] We got the bidi box model backwards

From: fantasai <fantasai.lists@inkedblade.net>
Date: Tue, 10 May 2011 14:55:55 -0700
Message-ID: <4DC9B46B.3030107@inkedblade.net>
To: "www-style@w3.org" <www-style@w3.org>, "public-i18n-bidi@w3.org" <public-i18n-bidi@w3.org>, Simon Montagu <smontagu@smontagu.org>, "'Aharon (Vladimir) Lanin'" <aharon@google.com>
http://www.w3.org/TR/CSS21/box.html#bidi-box-model

   # When the element's 'direction' property is 'ltr', the left-most generated box of
   # the first line box in which the element appears has the left margin, left border
   # and left padding, and the right-most generated box of the last line box in which
   # the element appears has the right padding, right border and right margin.
   #
   # When the element's 'direction' property is 'rtl', the right-most generated box
   # of the first line box in which the element appears has the right padding, right
   # border and right margin, and the left-most generated box of the last line box in
   # which the element appears has the left margin, left border and left padding.

The issue is when inlines are broken across lines. Right now we decide which side
of the first/last box to draw the start/end decorations on based on the element's
'direction' property. But I believe it should be the element's /parent's/ direction
property.

Here's why:

Consider that you are embedding some text, e.g. a quote, into a paragraph. You
want to space it off a bit from the surrounding content, like this:

   q {
     margin: 0 0.5em;
   }

   |Here is some text   AND HERE IS MY QUOTE|
   |THAT CONTINUES ON THE LINE   and my text|
   |continues.                              |

If the quote happens to be of opposite-direction text, the separation doesn't
work anymore, because we placed the box decorations based on the quote's
directionality and not the paragraph's directionality.

   |Here is some text ETOUQ YM SI EREH DNA  |
   |  ENIL EHT NO SEUNITNOC TAHT and my text|
   |continues.                              |

Now, we definitely want the left border on the left side and the right border
on the right side, but I'm starting to think we should have chosen differently
which side is the "broken" side when the element breaks across lines.

Here's the example again using brackets to represent borders.

   |Here is some text  [AND HERE IS MY QUOTE|
   |THAT CONTINUES ON THE LINE]  and my text|
   |continues.                              |

   |Here is some text ETOUQ YM SI EREH DNA] |
   | [ENIL EHT NO SEUNITNOC TAHT and my text|
   |continues.                              |

Aharon, smontagu -- thoughts?

Is this something we should fix?

~fantasai
Received on Tuesday, 10 May 2011 21:59:29 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:40 GMT