Re: Rework of Bidi inline article

After reading another part of your comments, I think I can better guess 
the answer to some of the questions below...

On 08/02/2012 09:10, Richard Ishida wrote:
> Aharon,
>
> The key area where I'm trying to ensure clarity is the section "Putting
> it all together in HTML5". I'm not sure whether your comments around
> that section are stream-of-consciousness notes written as you work
> through the text, or a stand-back commentary on all the alternatives
> proposed. I suspect the former. I included an intact section of your
> last email at the bottom of this email. Immediately below I'll address
> certain points slightly out of the original order.
>
> Given
>
>  > The way you have it for the third algorithm is pretty close to what I
>  > want.
>
> and
>
>  > I do not want
>  > an application to use dir=auto (or <bdi> without dir) if the true
>  > direction is available to it. Thus, I want an application to wrap the
>  > content in <bdi dir=...> if it knows the direction.
>
> I have the following new version of the algorithm:
>
> =================
> 1. If you know the phrase's direction, then
> (a) if the phrase is not wrapped by another element, wrap the phrase in
> <bdi dir="ltr"> or <bdi dir="rtl">. (If the phrase is wrapped by a span
> element, replace the span with this).
> (b) if the phrase is already tightly wrapped by an element (other than
> span), add dir="auto" to that element
> (c) in the rare cases where step (b) fails because the first letter of
> the phrase is not strongly typed the right way, put an extra bdi element
> around the phrase with dir="rtl" or dir="ltr" as appropriate (is it
> worth mentioning this?)
>
> 2. If you don't know the phrase's direction, ie. the text will be
> inserted at run time, then
> (a) if the phrase is not wrapped by another element, wrap the phrase in
> bdi. (Without an explicit dir value, dir="auto" is implied.)
> (b) if the phrase is already tightly wrapped by an element, add
> dir="auto" to the element.
> ==================
>
>
>  > And, as explained
>  > above, it is important to do this even if that direction is the same as
>  > the context's, if the phrase might contain any opposite-direction
>  > characters.
>
> I still don't understand what you mean by this. Can you give me an example?


I'm guessing that you are referring here to the case where the phrase's 
direction is unknown, and the text inserted is likely to be often in the 
same direction as the surrounding content.  If so, I propose to add a 
para just after point 2 to say that.


>
> Wrt the above algorithm:
>  > The differences is that I would like you to add a case where the
>  > application happens to know the phrase's direction, as a separate datum.
>
> Please expand.

I think you mean that you want a point 3 which deals with the case where 
an application has a way of deducing the direction of the inserted text. 
  There are a number of other suggestions earlier in your note that 
refer to such as case.

I think that this is an unusual case, and I'm currently inclined to have 
a separate section that addresses this scenario, rather than further 
complicate the normal scenario with extra points.


RI

>
>
> Cheers,
> RI
>
>
> On 07/02/2012 13:20, Aharon (Vladimir) Lanin wrote:
>> Putting it all together in HTML5:
>>
>> Regarding your alternatives, I do not want the page (or application)
>> author to have to figure out if the phrase could be followed inline by
>> something problematic. And I do not want an application author to have
>> to figure out whether dir=auto will result in the direction that the
>> application knows is the right direction. In other words, I do not want
>> an application to use dir=auto (or <bdi> without dir) if the true
>> direction is available to it. Thus, I want an application to wrap the
>> content in <bdi dir=...> if it knows the direction. And, as explained
>> above, it is important to do this even if that direction is the same as
>> the context's, if the phrase might contain any opposite-direction
>> characters.
>>
>> Here is an updated text for this section (hopefully, with the
>> problematic parts clarified):
>> --- start ---
>> To summarize, in HTML5, to make sure that a phrase that contains (or, in
>> an application, might contain) any opposite-direction characters is
>> displayed correctly, do the following:
>>
>> 1. If the phrase is already tightly wrapped in an element that has
>> non-inline display (e.g. a <p> or <div> element), and setting this
>> element's alignment to the "start" of the phrase's direction happens to
>> be desirable, set the existing element's dir attribute. If you do not
>> know the phrase's direction, set the dir attribute to "auto". If the
>> phrase is known to have the same direction as the context, it is not
>> necessary to set it.
>> 2. Otherwise, if you know the phrase's overall direction (or have a
>> better way of determining it than the method used by dir="auto"), wrap
>> the phrase in <bdi dir="ltr"> or <bdi dir="rtl">, as appropriate. Since
>> the phrase contains (or might contain) some opposite-direction
>> characters, do this even when the phrase's overall direction is the same
>> as the context.
>> 3. (Optional) Otherwise, if the phrase is already tightly wrapped by an
>> element with inline display, add dir="auto" to the element.
>> 4. Otherwise, wrap the phrase in <bdi>. Without an explicit dir value,
>> dir="auto" is implied.
>> --- end ---
>>
>
>> Using bdi and dir="auto" for our use cases:
>> The way you have it for the third algorithm is pretty close to what I
>> want. The differences is that I would like you to add a case where the
>> application happens to know the phrase's direction, as a separate datum.
>

-- 
Richard Ishida
Internationalization Activity Lead
W3C (World Wide Web Consortium)

http://www.w3.org/International/
http://rishida.net/

Received on Wednesday, 8 February 2012 10:31:43 UTC