[Bug 15488] New: it makes no sense to limit the placeholder attribute to values of the same direction as the <input>

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

           Summary: it makes no sense to limit the placeholder attribute
                    to values of the same direction as the <input>
           Product: HTML WG
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HTML5 spec (editor: Ian Hickson)
        AssignedTo: ian@hixie.ch
        ReportedBy: aharon.lists.lanin@gmail.com
         QAContact: public-html-bugzilla@w3.org
                CC: mike@w3.org, public-html-wg-issue-tracking@w3.org,
                    public-html@w3.org, public-i18n-bidi@w3.org


Currently, the HTML spec
(http://dev.w3.org/html5/spec/Overview.html#text-rendered-in-native-user-interfaces)
states that "text from elements (either attribute values or the contents of
elements) is expected to be rendered in a manner that honors the directionality
of the element from which the text was obtained." While this is usually what
one wants, there are cases that it is does not suit the placeholder attribute.

For example, say that one has a Hebrew or Arabic page containing an <input
type="text"> intended for the user to enter a snippet of JavaScript. One would
then make it <input type="text" dir="ltr">, since JavaScript code is always
LTR. One might want a placeholder on the input, however, that would be in the
language of the rest of the page, and thus RTL. According to the spec, however,
it would be displayed in LTR, and thus garbled. Another example would be an
<input type="tel">, since telephone numbers are always LTR, but one would might
easily want an RTL placeholder on it.

We had a similar problem with the title attribute in
https://www.w3.org/Bugs/Public/show_bug.cgi?id=10818: the title's value
sometimes needs to have one direction while the element needs another. With the
title attribute, however, we at least had a workaround: wrap the element in a
span, move the title to the span, and set the dir attribute on both elements as
each needs. This does not work for placeholder because placeholder does not
work on a <span>.

Two possible solutions to this problem are:

1. define a placeholderdir attribute for <input>.

2. always display the placeholder as if it had dir=auto.

The second possibility is not perfect, but at least setting the placeholder
description explicitly is more easily done by prefixing it with an &lrm; or
&rlm; than by wrapping it in LRE|RLE and PDF 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 Tuesday, 10 January 2012 05:10:36 UTC