Re: per-paragraph auto-direction, a.k.a. dir=uba

Fantasai wrote: "I suggest "plaintext" instead of "uba" because it's 
clearer what the
behavior and the intended use case is. (Since we're only allowing uba
on <textarea> and using dir=auto for first-strong, we don't need the
name to be so cryptically short.)"
The fact that we only tackle <textarea> now does not mean that the 
"uba/plaintext" behavior will never be used for other types of elements. 
Consequently, we should not choose terminology or syntax that would limit 
our freedom to extend this feature to other elements.
This is said in general, I have no marked preference for "uba" versus 
"plaintext". I seem to recall that both terms were mentioned at the f2f, 
and "uba" was the one retained, but this is rather moot, since the final 
syntax and terminology will be selected by the HTML5 WG anyway.

Shalom (Regards),  Mati
           Bidi Architect
           Globalization Center Of Competency - Bidirectional Scripts
           IBM Israel
           Phone: +972 2 5888802    Fax: +972 2 5870333    Mobile: +972 52 
2554160




From:   fantasai <fantasai.lists@inkedblade.net>
To:     "Aharon (Vladimir) Lanin" <aharon@google.com>
Cc:     Matitiahu Allouche/Israel/IBM@IBMIL, "Phillips, Addison" 
<addison@lab126.com>, Adil Allawi <adil@diwan.com>, Behdad Esfahbod 
<behdad@behdad.org>, Ehsan Akhgari <ehsan@mozilla.com>, 
public-i18n-bidi@w3.org, public-i18n-bidi-request@w3.org, Shachar Shemesh 
<shachar@shemesh.biz>
Date:   14/09/2010 20:55
Subject:        Re: per-paragraph auto-direction, a.k.a. dir=uba



On 09/14/2010 08:39 AM, Aharon (Vladimir) Lanin wrote:
> I second Mati's proposal. As Ehsan has pointed out <textarea readonly>
> can be used to display plain text (as opposed to edit it), even though
> somewhat awkwardly. And if we work out a bigger proposal, we can tweak
> the bugs filed on HTML5 and CSS3. Right now it is imperative to produce
> a new draft of the proposal and file the bugs (October 1 deadline for
> HTML5..., apparently).
>
> I do want to put dir=uba under the dir=auto umbrella, via
> autodirmethod=first-strong|any-rtl|uba. autodirmethod inherits; dir does
> not. The default would probably be first-strong.
>
> Is this agreeable to everyone? Please respond.
>
> Here is a quick spec for dir=auto:
>
>     * Using dir=auto with autodirmethod=uba would (by default) set
>       unicode-bidi to "uba" and direction according to first-strong.
>       (Note that this includes leaving direction at the inherited value
>       if the content is neutral.)
>     * For elements other than <textarea>, unicode-bidi:uba is treated as
>       unicode-bidi:isolate.
>     * On <textarea>, unicode-bidi:uba means that:
>           o The UBA on the textarea content is invoked specifying only a
>             default paragraph level (in icu4j terminology, either
>             LEVEL_DEFAULT_LTR or LEVEL_DEFAULT_RTL), based on the the
>             element's own direction value as calculated above. (This
>             makes the all-neutral paragraphs use the same direction as
>             the first paragraph that is not all-neutral.)
>           o Each UBA paragraph’s lines’ alignment is determined by the
>             paragraph’s resolved base level when the element's
>             text-align is start or end.

This is too complicated. If uba cannot in fact be triggered on anything
other than a <textarea>, then it should not be allowed on anything other
than a <textarea>. I suggest having

   dir=ltr|rtl|auto|plaintext
   autodirmethod=first-strong|any-rtl

I suggest "plaintext" instead of "uba" because it's clearer what the
behavior and the intended use case is. (Since we're only allowing uba
on <textarea> and using dir=auto for first-strong, we don't need the
name to be so cryptically short.)

> # The part of the text after the first X characters (where the text in
> nodes excluded above are not part of the count). Do we need this? If
> so, what's a good X value? 100?

And I think that for any-rtl having an X value is both better for
performance and more likely to give good results. If the first X
characters are LTR, where X is longer than most LTR phrases commonly
imported into RTL text, chances are any RTL characters after that
are not indicating the paragraph's main direction.

~fantasai

Received on Tuesday, 14 September 2010 21:35:47 UTC