This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 13482 - dir=auto needs to work on value of input and textarea elements
Summary: dir=auto needs to work on value of input and textarea elements
Status: CLOSED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: LC1 HTML5 spec (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-31 07:52 UTC by Aharon Lanin
Modified: 2011-08-25 03:25 UTC (History)
6 users (show)

See Also:


Attachments

Description Aharon Lanin 2011-07-31 07:52:32 UTC
As currently specified (http://dev.w3.org/html5/spec/Overview.html#the-dir-attribute), dir=auto determines an element's directionality by scanning the element's text node descendants.

Unfortunately, this spec does not give sufficient consideration to <input> and <textarea> nodes, for which dir=auto was always envisioned to work based on their current value, i.e. to potentially change the element's directionality when the user types into them. As a result, dir=auto as currently implemented in WebKit does not do anything useful for input elements, and only works on a textarea's initial value, without changing as the user modifies it.

Furthermore, a dir=auto element's directionality should not be dependent on the text nodes in a descendant <textarea>, since these usually do not change dynamically when the user types into the textarea, and since a textarea should behave in this regard just like an input element.

Thus:

- For input and textarea elements with dir=auto, the directionality should be determined not by the element's descendants, but by the element's current value, and should change as the latter changes.

- For other elements, the text node descendants under a descendant textarea element should be excluded, just like those in script and style elements.
Comment 1 Ian 'Hixie' Hickson 2011-08-03 21:31:57 UTC
Seems reasonable.
Comment 2 Michael[tm] Smith 2011-08-04 05:04:42 UTC
mass-moved component to LC1
Comment 3 Ian 'Hixie' Hickson 2011-08-11 21:12:46 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: see diff given below
Rationale: Concurred with reporter's comments.
Comment 4 contributor 2011-08-11 21:13:01 UTC
Checked in as WHATWG revision r6420.
Check-in comment: fix dir=auto for <textarea> and <input> text fields.
http://html5.org/tools/web-apps-tracker?from=6419&to=6420
Comment 5 Aharon Lanin 2011-08-12 04:00:12 UTC
(In reply to comment #4)
> Checked in as WHATWG revision r6420.

The fix looks good to me. I will close the bug in a few days. Just want to let others have a look at it first.
Comment 6 Ehsan Akhgari [:ehsan] 2011-08-25 03:23:32 UTC
Looks very good to me, thanks!  I'll update the Mozilla bug.