Re: dir=auto makes no sense for descendant user-visible attributes

Hi Najib,

>    (since estimation is a heuristic that sometimes gives the wrong
>    answer)". "Don't care" of backward compatibility:
>       1. Title, Alt, ... don't contain  mixed (rtl+ltr)  text very
>          often.

I don't see anything specific about title, alt, etc, and RTL text (at least
Hebrew) does tend to use LTR words enough (for brands, acronyms, loan
words) to make this too much of a concern, IMO.

What about the attribsdir proposal?

Aharon


On Sun, Feb 26, 2012 at 7:28 PM, Najib Tounsi <ntounsi@emi.ac.ma> wrote:

> Hi Aharon, others,
>
> I would prefer your first sugestion: "to divorce user-visible attributes
> from their elements' directionality completely, always estimating the
> directionality of each attribute by its content." (your first email:
> http://lists.w3.org/Archives/**Public/public-i18n-bidi/**
> 2012JanMar/0041.html<http://lists.w3.org/Archives/Public/public-i18n-bidi/2012JanMar/0041.html>
> ).
>
>  1. It is more easy to specify and to implement. (And may be to accept
>     by HTML5 WG?).
>  2. The second proposal: "to divorce it only for elements under the
>     influence of dir=auto", is an exception to a rule (dir=auto) which
>     does not need more complications. (I don't like exceptions, even
>     though they confirm a rule.)
>  3. You say: "This suffers from backwards compatibility problems
>
>     (since estimation is a heuristic that sometimes gives the wrong
>     answer)". "Don't care" of backward compatibility:
>        1. Title, Alt, ... don't contain  mixed (rtl+ltr)  text very
>           often.
>        2. And if they do, authors rarely take care of putting
>           LRE/RLE-PDF where necessary. May be by ignorance or because
>           cases  where the text is displayed unexpectedly, are not
>           very general cases? (some authors also type the attribute
>           value visually as they wish it to display. Others who will
>           to put LRE/RLE-PDF in their content, find it difficult to
>           deal with. These are the only control characters that cannot
>           be expressed by a mnemonic entity such as &lmr; etc. You
>           have to remember #x202B; (RLE) and #x202C; (PDF). )
>
> So backward compatibility, is not so important in this case.
>
> Your first solution, divorce title/alt...   from there element and let
> them have their own estimated direction, is IMHO a better solution.
>
> Best, Najib
>
>
> Aharon (Vladimir) Lanin wrote:
>
>> Ok, let's see if anyone else responds.
>>
>> On Fri, Feb 24, 2012 at 7:28 PM, Ehsan Akhgari <ehsan@mozilla.com<mailto:
>> ehsan@mozilla.com>> wrote:
>>
>>    I'm fine with attribsdir as you proposed, although I'm not quite
>>    sure about the more complex syntax, since it's so different to the
>>    way other attributes in HTML work.
>>
>>    Let's hear what others think.
>>
>>    Cheers,
>>    --
>>    Ehsan
>>    <http://ehsanakhgari.org/>
>>
>>
>>
>>    On Thu, Feb 23, 2012 <tel:2012> at 11:53 PM, Aharon (Vladimir)
>>
>>    Lanin <aharon@google.com <mailto:aharon@google.com>> wrote:
>>
>>        Good example.
>>
>>        In the past, Ian has already rejected titledir etc.
>>
>>        Perhaps they will be more receptive to attribsdir, since it's
>>        just one attribute and tackles some serious problems.
>>
>>        Your example could be handled by also allowing syntax like
>>        "title:rtl;placeholder:ltr". Even just " placeholder:ltr"
>>        could do if the other attributes then follow the default
>>        (which in this case would presumably be rtl despite dir=ltr on
>>        the <input>). Since it does not inherit, there would not be
>>        too much difficulty supporting the complex syntax.
>>
>>        But attribsdir would still be useful even if it only allowed a
>>        simple value.
>>
>>        Aharon
>>
>>        On Feb 23, 2012 <tel:2012> 6:11 PM, "Ehsan Akhgari"
>>
>>        <ehsan@mozilla.com <mailto:ehsan@mozilla.com>> wrote:
>>
>>            How about something like:
>>
>>            <input name="phone" title="TELEPHONE" placeholder="(123)
>>            456-7890">
>>
>>            If we introduce an attribsdir attribute, I can see people
>>            asking to differentiate between different attributes, such
>>            as the example above.  >From a bidi perspective, the
>>            ultimate solution is to have a directional attribute for
>>            every user visible attribute, such as titledir,
>>            placeholderdir, etc.  But honestly I don't expect such a
>>            proposal to be easily accepted in WHATWG, given the recent
>>            resistance towards placeholderdir.
>>
>>            --
>>            Ehsan
>>            <http://ehsanakhgari.org/>
>>
>>
>>            On Thu, Feb 23, 2012 <tel:2012> at 6:49 AM, Aharon
>>            (Vladimir) Lanin <aharon@google.com
>>
>>            <mailto:aharon@google.com>> wrote:
>>
>>                Well, I, for one, am not so happy with my proposal :-).
>>
>>                Its solution is to apply dir=auto to the individual
>>                user-visible attributes, even though in most cases the
>>                values of such attributes are not dynamic, but
>>                localized to the page locale, e.g. (in an English
>>                page) <input dir="auto" name="purpose"
>>                placeholder="The purpose of your visit.">. Using
>>                estimation for them is not just wasteful, but bound to
>>                reach the wrong conclusion occasionally.
>>
>>                And it does not address the long-standing issue of no
>>                way to set the directionality of an attribute (other
>>                than using formatting characters). The canonical
>>                examples are:
>>
>>                - <input dir="ltr" name="telephone" title="PHONE
>>                NUMBER.">, which has to be worked around
>>                as <span title="PHONE NUMBER."><input dir="ltr"
>>                name="telephone"></span>
>>                - <input dir="ltr" name="telephone" placeholder="PHONE
>>                NUMBER.">, which has no workaround other than RLE + PDF.
>>
>>                What if we could instead have a new attribute,
>>                attribsdir="ltr|rtl|auto", which would determine the
>>                directionality in which the element's user-visible
>>                attributes must be displayed. A very important part of
>>                this would be the default value. IMO, it would be best
>>                if it could default to the dir attribute value of the
>>                closest ancestor - or the element itself unless it is
>>                <input> or <textarea> - that has an explicit dir
>>                attribute with a value other than "auto". If there is
>>                no such ancestor, the default is "ltr". Thus:
>>
>>                - the only way to get attribsdir=auto is to specify it
>>                explicitly
>>                - the explicit dir attribute value of <input> and
>>                <textarea>, which is presumably meant to correspond to
>>                the directionality of their content, not their
>>                user-visible attributes, does not affect their
>>                default attribsdir.
>>                - with the exceptions of <input dir="...">, <textarea
>>                dir="...">, and <whatever dir=auto>, the result is
>>                backward-compatible.
>>
>>                Examples:
>>
>>                1. <html><body><div title="?">: ltr
>>
>>                2. <html dir=rtl><body><div title="?">: rtl
>>
>>                3. <html><body><div dir=rtl title="?">: rtl
>>
>>                4. <html><body><div><div dir=rtl><div><div title="?">: rtl
>>
>>                5. <html dir=rtl><body><div><input dir=ltr
>>                title="?"> : rtl
>>
>>                6. <html><body><div dir=rtl><div dir="auto"
>>                title="?">hello</div>: rtl
>>
>>                7. <html><body><div dir=rtl><div dir="auto">ltr
>>                content<div title="?">: rtl
>>
>>                8. <html dir=rtl><body><div
>>                title="?" attribsdir="ltr">: ltr
>>
>>                9. <html dir=rtl><body><div
>>                title="?" attribsdir="auto">: auto
>>
>>                Even if we couldn't get the <input> and <textarea>
>>                exception, we would still be ok - the page would just
>>                have to specify attribsdir explicitly on the
>>                problematic inputs.
>>
>>                Aharon
>>
>>                On Thu, Feb 23, 2012 <tel:2012> at 11:32 AM, "Martin
>>                J. Dürst" <duerst@it.aoyama.ac.jp
>>
>>                <mailto:duerst@it.aoyama.ac.jp**>> wrote:
>>
>>                    On 2012/02/23 1:11, Ehsan Akhgari wrote:
>>
>>                        On Wed, Feb 22, 2012 <tel:2012> at 10:04 AM,
>>                        Aharon (Vladimir) Lanin<aharon@google.com
>>                        <mailto:aharon@google.com>
>>
>>
>>                            wrote:
>>
>>
>>                            One possibility is to divorce user-visible
>>                            attributes from their elements'
>>                            directionality completely, always
>>                            estimating the directionality of each
>>                            attribute by its content. This suffers
>>                            from backwards compatibility
>>                            problems (since estimation is a heuristic
>>                            that sometimes gives the wrong
>>                            answer).
>>
>>                            A better possibility is to divorce it only
>>                            for elements under the
>>                            influence of dir=auto. Thus, if an element
>>                            has dir=auto (explicitly or
>>                            implicitly, the latter being the case
>>                            for<bdi>), each of the attributes in
>>                            the subrtree rooted at that element, with
>>                            the exception of elements
>>                            specifying dir="ltr" or dir="rtl" and
>>                            their descendants, must be displayed
>>                            to the user as if they had a dir=auto of
>>                            heir own.
>>
>>
>>                        I like the second proposal better.  Although I
>>                        have to say that it has been
>>                        worded a bit vaguely.  What I have in mind is
>>                        for the title attribute in
>>                        the following example to have a resolved RTL
>>                        direction:
>>
>>                        <p dir="auto" title="RTL TEXT followed by ltr
>>                        text">ltr text FOLLOWED BY
>>                        RTL TEXT</p>
>>
>>
>>                    I agree with Ehsan that the second proposal is
>>                    better. It's something that comes quite naturally
>>                    once one gets used to it.
>>
>>                    Regards,    Martin.
>>
>>
>>
>>
>>
>>
> --
> Najib TOUNSI (tounsi at w3.org)
> W3C Office in Morocco (http://www.w3c.org.ma/)
> Ecole Mohammadia d'Ingénieurs, BP. 765 Agdal-RABAT Morocco
> Mobile: +212 (0) 661 22 00 30
>
>
>

Received on Monday, 27 February 2012 11:20:21 UTC