[Bug 17835] The directionality of a textarea should be determined based on its parent if its value does not have any strong characters

https://www.w3.org/Bugs/Public/show_bug.cgi?id=17835

--- Comment #18 from Aharon Lanin <aharon.lists.lanin@gmail.com> ---
(In reply to comment #16)
> Ok. Well, first, type=tel dir=auto can be rtl always. (Maybe it should even
> be rtl if dir="" is omitted entirely?)

I presume you meant ltr, not rtl. Telephone numbers need to be displayed LTR.

While I do think it would be neat to have dir=ltr by default on <input
type=tel> (no dir attribute at all), I do *not* think that it is worth making a
special case for <input type=tel dir=auto>. We are primarily talking about
<textarea>, <input type=text> and other elements here, which may well be used
to enter/dispay a phone number.

After your change, the spec now says:

--> If the element's dir attribute is in the rtl state
--> If the element is an input element whose type attribute is in the Telephone
state, and the dir attribute is in the auto state
        The directionality of the element is 'rtl'.

The second line needs to be removed, both because it makes the telephone input
RTL (it should be LTR) and because I do not think the <input type=tel dir=auto>
case is important.

Furthermore, the Telephone state should be restored to the list in:

--> If the element is an input element whose type attribute is in the Text,
Search, URL, or E-mail state, and the dir attribute is in the auto state

Instead, if you do want to make <input type=tel> default to LTR (which I think
is a good idea), where you now have:

--> If the element is a root element and the dir attribute is not in a defined
state (i.e. it is not present or has an invalid value)
        The directionality of the element is 'ltr'.

You should change "a root element" to "a root element or a an input element
whose type attribute is in the Telephone state"

> I've made <textarea dir=auto> default to RTL if it contains RTL characters,
> parent if empty, LTR otherwise.

You actually did that not just for <textarea>, but also for <input>, and for
all elements except the root element and <bdi>. Looks good, except that I do
not think there is any reason to have the special case for <bdi>.

> How about other elements? What direction should this be in?
> 
>    <div dir=rtl>
>      <div dir=auto>1.</div>
>      RTLRTLRTL...
>    </div>
> 
> ...?

That <div dir=auto>1.</div> is non-empty and thus should be LTR. That's what
the spec currently says, and that's what I want.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Tuesday, 21 May 2013 08:51:26 UTC