Re: Alignment of paragraphs with unicode-bidi: plaintext [css3-text] [css3-writing-modes]

On 04/01/2012 07:38 AM, Aharon (Vladimir) Lanin wrote:
> Thanks for the response and for the kind words!
>
> I am very happy and relieved that we agree on the ideas. I also like most of your changes to the wording. However, I think the
> wording still needs a little tweaking.
>
> For unicode-bidi:plaintext, the spec currently has:
>
>       An element immediately contains a bidi paragraph if it is a block
>
>       container or bidi-isolating inline and no other such elements intervene
>       between it and the bidi paragraph.
>
>
> I have three issues here:
> - It does not say that the element has to contain the paragraph.
> - I think that the "intervene" is a little too loose for a definition.
> - I don't think that that the "inline" in "bidi-isolating inline" is necessary.
>
> Thus, I would tweak it a little further:
>
> An element immediately contains a bidi paragraph if both of the following conditions hold for the element but not for any of
> its descendants:
> - The element contains the entire paragraph.
> - The element is either bidi-isolating or a containing block.

Ok, I have
       An element immediately contains a bidi paragraph if the element itself,
       but none of its descendants, is a block container or bidi-isolating
       inline that contains the entire bidi paragraph.

Does that look right?

> For alignment,  the spec currently has:
>
>     The start and end edges of a line box are determined by the inline base direction of the "bidi paragraph" to which it
>     belongs. In most cases, this means using the containing block's computed ‘direction’. However if containing block has
>     ‘unicode-bidi: plaintext’ [CSS3-WRITING-MODES], the inline base direction of its line boxes will be determined by the bidi
>     paragraphs it immediately contains. In the case of an empty bidi paragraph, the direction used is that of the previous
>     bidi paragraph in the containing block, or, if this is the first bidi paragraph in the containing block, then the
>     ‘direction’ property is used.
>
>
> (Thanks for making the additional change re empty bidi paragraphs.)
>
> My issues here:
> - I am not sure why you use the term "inline base direction" (of a bidi paragraph) instead of just "base direction". How is
> the base direction "inline"? (This is not new. You were already using "inline base direction" before my suggested changes.)

See http://dev.w3.org/csswg/css3-writing-modes/#text-flow
It's to contrast it with the block flow direction.

> - There is no definition of how a line box "belongs" to a bidi paragraph. (This was already a problem in my proposal. The
> "belonging" was explained outside of the change I suggested.) I think that the "to which it belongs" has to be expanded to an
> actual definition, which is composed of two parts:
>    - The line box contains text belonging to the bidi paragraph

This isn't technically true, since all the text could belong to a bidi paragrah within the bidi paragraph to which the line 
box belongs.

>    - The bidi paragraph is immediately contained by the line box's containing block.

Right.

> - In the current wording, the first sentence ("the start and end edges of a line box are determined by the inline base
> direction of the "bidi paragraph" to which it belongs") is incorrect when that paragraph is empty. To deal with this, the
> empty paragraph handling has to be further integrated into the rest of the definition.
> - "Empty paragraph" is not defined. The naive definition - a paragraph containing nothing - is incorrect, since it also has to
> cover a paragraph containing nothing but the terminating (B-class) character.
>
> So, here is my attempt at revised wording.
>
> Most of the time, the start and end edges of a line box are determined by the containing block's computed ‘direction’.
> However, if the containing block has ‘unicode-bidi: plaintext’, they are determined by the base direction of the bidi
> paragraphs the containing block immediately contains [CSS3-WRITING-MODES], in the following manner. Each line box displays
> some part of exactly one bidi paragraph immediately contained by the line box's containing block. If this or some preceding
> bidi paragraph immediately contained by the containing block is non-empty (i.e. contains characters other than the terminating
> bidi-paragraph-breaking character, if any), that non-empty bidi paragraph's base direction determines the line box's start and
> end edges. Otherwise, they are determined by the the containing block's computed ‘direction’.

Alright, here's mine:

       In most cases, the start and end edges of a line box are determined
       by the containing block's computed 'direction'.
       However if its containing block has ''unicode-bidi: plaintext'' [[!CSS3-WRITING-MODES]],
       the start and end edges of a line box will be determined by
       the inline base direction of the bidi paragraph to which it belongs:
       that is, the bidi paragraph immediately contained by the line box's
       containing block for which the line box holds content.
       If that bidi paragraph contains no content (i.e. contains no atomic
       inlines or characters other than the paragraph-breaking character,
       if any), the direction used is that of the previous bidi paragraph
       in the containing block, or, if this is the first bidi paragraph in
       the containing block, then that given by the 'direction' property
       of the containing block.

Thoughts?

>     Fixed the incorrect example. I should probably add some more of yours, too. :)
>
>
> I agree that more examples are necessary. Here is what I would suggest adding (this includes the explanations,which I think
> would be quite useful to the reader):

Ok, added.

Another question: should this definition also affect text-indent?
What about hanging-punctuation?

~fantasai

Received on Thursday, 12 April 2012 22:43:48 UTC