[Bug 16564] New: 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=16564

           Summary: The directionality of a textarea should be determined
                    based on its parent if its value does not have any
                    strong characters
           Product: HTML WG
           Version: unspecified
          Platform: PC
               URL: http://www.whatwg.org/specs/web-apps/current-work/mult
                    ipage/elements.html#the-dir-attribute
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HTML5 spec (editor: Ian Hickson)
        AssignedTo: ian@hixie.ch
        ReportedBy: ehsan@mozilla.com
         QAContact: public-html-bugzilla@w3.org
                CC: mike@w3.org, public-html-wg-issue-tracking@w3.org,
                    public-html@w3.org


This is what the spec currently says:

If the element is a textarea element and the dir attribute is in the auto state

    If the element's value contains a character of bidirectional character type
AL or R, and there is no character of bidirectional character type L anywhere
before it in the element's value, then the directionality of the element is
'rtl'. Otherwise, the directionality of the element is 'ltr'.

I think we need to revise this sentence: "Otherwise, the directionality of the
element is 'ltr'."  Here's the problematic scenario:

Consider the following document:
<body dir="rtl">
  <textarea dir="auto">RTL TEXT</textarea>
</body>

When you delete all of the characters inside the text area, according to the
spec the directionality gets switched to ltr, which causes the cursor to jump
back to left when the textarea is empty.  If you start entering an RTL
character again, the cursor flips back to the right side.  This is inconsistent
with the case where the default value of the textarea and the value you enter
are both LTR.

I don't remember why the spec was written in this way, but I need we need to
revise it to make the directionality depend on the direction of the parent
element if a dir=auto textarea has a value with no strong characters.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Received on Thursday, 29 March 2012 06:11:56 UTC