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

Hi.
From: aharon@google.com
Date: Sun, 15 Apr 2012 16:34:18 +0300
To: fantasai.lists@inkedblade.net
CC: public-i18n-bidi@w3.org; www-style@w3.org
Subject: Re: Alignment of paragraphs with unicode-bidi: plaintext [css3-text] [css3-writing-modes]

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


> It is not immediately obvious that the "that contains the entire bidi paragraph" clause applies to both the "block container" and "bidi-isolating inline" cases. It may be a little > clearer if it is phrased as:


> An element immediately contains a bidi paragraph if the element itself, but none of its descendants, both contains the entire bidi paragraph and is either a block container > or bidi-isolating inline.

Thanks for this correction; much better wording!

>>> I am not sure why you use the term "inline base direction">>> (of a bidi paragraph) instead of just "base direction".
>> See http://dev.w3.org/csswg/css3-writing-modes/#text-flow

>> It's to contrast it with the block flow direction.
> Writing Modes defines inline base direction as a property of a writing mode (along with block flow direction). The definition being proposed for Text, on the other hand, is 
> talking about a property of a bidi paragraph. An "inline base direction" property has never been defined for paragraphs. What UAX #9 does define for paragraphs is 
> "paragraph embedding level" and then "paragraph direction [...] in some contexts [...] also known as the base direction". Writing Modes itself, when talking about a 
> property of a paragraph, uses the terms "paragraph embedding level" and "base directionality", but not "inline base direction".


> I have no problem with Text talking about the inline base direction of a line box. (This, I think is what Writing Modes is actually talking about). In fact, perhaps Text should > actually give a precise definition of a line box's inline base direction (as we have been discussing here), and then simply say that "the start and end edges of a line box are 
> relative to the line box's inline base direction".


>>     In most cases, the start and end edges of a line box are determined
> Or, according to the approach above, "the inline base direction of a line box is 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:
> Drop "inline", as explained above.


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


> I think a "However" would be appropriate at the start of this sentence."However" is fine with me here. In fact it's needed. In English it's certainly possible to begin sentences with "however" (and even sometimes with "but," or "and, but more rarely).

(I wish I had more comments/insights than this to offer; sorry.)
Best,

--C. E. Whitehead
cewcathar@hotmail.com
>>     inlines or characters other than the paragraph-breaking character,>>     if any),

>>     the direction used is
> the line box's inline base direction is derived from
>>     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.
> I think I have a much better idea here: instead of deriving it from the previous bidi paragraph (which is actually ill-defined), derive it from the preceding line box (in the 
> same containing block). Thus, this would be:


> However, if that bidi paragraph contains no content (i.e. contains no atomic> inlines or characters other than the paragraph-breaking character, if any),> the line box has the same inline base direction as the preceding line box in

> its containing block, or, if it is the containing block's first line box, the> computed 'direction' of the containing block.
>> Another question: should this definition also affect text-indent?


> Yes! This underscores the need for defining the inline base direction of a line box.
>> What about hanging-punctuation?
> I guess. If I understand correctly, the concept comes from East Asian languages, with which I am not familiar.


> Aharon
On Fri, Apr 13, 2012 at 1:43 AM, fantasai <fantasai.lists@inkedblade.net> wrote:


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 Monday, 16 April 2012 19:53:58 UTC