Specify expected behavior for when users change input field directionality #9244
Labels
i18n-tracker
Group bringing to attention of Internationalization, or tracked by i18n but not needing response.
topic: editing
topic: forms
The spec infers but doesn't say explicitly that users can change the directionality of input fields. For the
dirname
attribute to properly submit the user-set directionality, this action needs to set thedir
attribute on the element. Session restore also seems to assume in a note that that is how it should work.Chromium, WebKit and Gecko allow users to change directionality and all set the
dir
attribute when doing so, at least for (some)input
andtextarea
elements. See https://www.w3.org/International/questions/qa-html-dir#userexplicit (contrary to what is currently stated there, Firefox does setdir
: w3c/i18n-drafts#469).For
contenteditable
it's not interoperable: Gecko setsdir
on thebody
element (bug 962015), Chromium setsstyle="direction: rtl;"
on all paragraphs in the editable host (inserting adiv
if neccessary), WebKit setsstyle="direction: rtl;"
on the selected paragraph (inserting adiv
if neccessary). I think Gecko's behavior is not great since it affects the entire page, not just the editable area. But usingdir
seems better thanstyle
. I suppose per-paragraph directionality is better than per editing host.cc @whatwg/forms @vinhill
The text was updated successfully, but these errors were encountered: