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

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

From: Uri Bernstein <urib@google.com>
Date: Wed, 11 May 2011 15:18:47 +0300
Message-ID: <BANLkTi=jC_WhxRmN-CC7UPjBt+R_7-dU5Q@mail.gmail.com>
To: fantasai <fantasai.lists@inkedblade.net>
Cc: "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>
This seems reasonable to me.
One question - do you literally mean "the element's parent's direction", or
do you actually mean "the element's containing block's direction"? I think
the latter makes more sense.

--Uri.


On Wed, May 11, 2011 at 00:55, fantasai <fantasai.lists@inkedblade.net>wrote:

> 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 Wednesday, 11 May 2011 13:25:07 GMT

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