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

[whatwg] Should editable elements have placeholder attribute?

From: Ojan Vafai <ojan@chromium.org>
Date: Wed, 2 May 2012 10:49:05 -0700
Message-ID: <CANMdWTtNQwsnDfFPsqDMjCgviS4O7Oo7SfS4+FP-q_3kK+MgKQ@mail.gmail.com>
On Wed, May 2, 2012 at 10:08 AM, Ryosuke Niwa <rniwa at webkit.org> wrote:

> On Wed, May 2, 2012 at 10:06 AM, Ojan Vafai <ojan at chromium.org> wrote:
>> I'm OK with having when the placeholder is displayed be up to the UA. I
>> can see that being platform specific.
>> But, we should spec when content is eligible for showing a placeholder
>> (i.e. we should define what "looks empty" means). I don't see any benefit
>> in browsers behaving differently here. This part is not platform-specific.
>> It's just hard to figure out how to spec it.
> Maybe when element.innerText or element.textContent is empty?

textContent will strip a bunch of visible content (images, iframes, embeds,

Another edge case to consider:
<div contentEditable placeholder=foo><div
Received on Wednesday, 2 May 2012 10:49:05 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:41 UTC