Bug 65429 - RTL: When an input value is remembered, its direction should be remembered too
Summary: RTL: When an input value is remembered, its direction should be remembered too
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: History (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-31 02:56 PDT by Aharon (Vladimir) Lanin
Modified: 2011-11-29 01:06 PST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aharon (Vladimir) Lanin 2011-07-31 02:56:26 PDT
The HTML5 spec (http://dev.w3.org/html5/spec/Overview.html#the-session-history-of-browsing-contexts) now contains the following note:

"User agents that persist the value of form controls are encouraged to also persist their directionality (the value of the element's dir attribute). This prevents values from being displayed incorrectly after a history traversal when the user had originally entered the values with an explicit, non-default directionality."

This change was made as a result of http://www.w3.org/Bugs/Public/show_bug.cgi?id=10823, which was filed on the basis of http://www.w3.org/International/docs/html-bidi-requirements/#remember-input-dir. Here is the proposal made there:

"The HTML specification should state that whenever a user agent stores a user-provided <input> or <textarea> text value for later use (such as auto-completion), it should also store the nominal direction value the element had when displaying this value. This may be the original direction of the element, or may have been set by the user for that value via the user agent's UI, or may have been set for that value by page scripts. If the user agent later recalls and displays this value, e.g. in an auto-completion dropdown, it should be displayed in its stored direction. If the value is assigned to an element, the element's dir value should be set to its stored direction."

Please note that the spec is somewhat ambiguous in its formulation, namely "directionality (the value of the element's dir attribute)". The element's dir attribute may have the value "ltr", "rtl", or "auto" - or it may be entirely absent, in which case the element inherits its directionality (but not its dir attribute). An element's directionality, on the other hand is always either ltr or rtl - never auto or undefined. The better interpretation for the HTML5 spec is probably to use the element's dir attribute when it is present and valid, not its directionality. That way, if the dir attribute was originally auto (and was not explicitly set by the user or page scripts), it will stay auto after a history traversal, so if the user then changes it to a value of the opposite direction, its directionality will be reevaluated, instead of being left equal to that of the previous value. However, for an input without a dir attribute, it is probably best to remember the element's directionality.