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

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 UTC