W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2012

[whatwg] Should editable elements have placeholder attribute?

From: Aryeh Gregor <ayg@aryeh.name>
Date: Wed, 2 May 2012 13:02:10 +0300
Message-ID: <CAKA+AxkhLU1WVOFA-hnjcixg2Yjt=qWiPhRRZpHYD=JsW-H3ig@mail.gmail.com>
On Wed, May 2, 2012 at 9:59 AM, Ryosuke Niwa <rniwa at webkit.org> wrote:
> Great. I think the tricky part will be defining exactly how and when the
> placeholder is displayed.
>
> e.g. Should it be treated as if there is a text node in the editable
> element? Should we ignore things like "<br>" or collapsible spaces when
> determining whether the element is empty or not?

Currently the spec isn't clear about this for <input>, so I don't
think it needs to specify exactly for <textarea> or contenteditable
either.  It can be left as a UI decision.  As far as QoI goes, I think
you'd want to display it as long as there's no visible text or images
or things.  <p><br></p> should still display the placeholder, and
probably so should <p><font color=red><br></font></p>, etc.  As long
as there's no text (or <img>, etc.) that's visible to the user -- if
it *looks* empty, the placeholder should display.

But this should be up to the UA.
Received on Wednesday, 2 May 2012 03:02:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:08 GMT