- From: Richard Ishida <ishida@w3.org>
- Date: Wed, 08 Feb 2012 09:10:19 +0000
- To: "Aharon (Vladimir) Lanin" <aharon@google.com>
- CC: Matitiahu Allouche <matial@il.ibm.com>, "public-i18n-core@w3.org" <public-i18n-core@w3.org>
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? 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. 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 09:13:03 UTC