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

Re: [whatwg] Should editable elements have placeholder attribute?

From: Ryosuke Niwa <rniwa@webkit.org>
Date: Wed, 2 May 2012 10:35:37 -0700
Message-ID: <CABNRm62+0_XiDfNqu+zK08BR32MLkdQr_Y2Vr4QkKPSRuAPv2w@mail.gmail.com>
To: Charles Pritchard <chuck@jumis.com>
Cc: whatwg@lists.whatwg.org, David Hyatt <hyatt@apple.com>, Adele Peterson <adele@apple.com>, Aryeh Gregor <ayg@aryeh.name>, Ojan Vafai <ojan@chromium.org>
On Wed, May 2, 2012 at 10:15 AM, Charles Pritchard <chuck@jumis.com> wrote:

> On 5/2/12 10:08 AM, Ryosuke Niwa wrote:
>> On Wed, May 2, 2012 at 10:06 AM, Ojan Vafai<ojan@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?
> Is this something we might have a CSS selector for in the future?

Sounds reasonable. We already have empty pseudo element but that won't
apply to div with just <br>.

So we'd have a css selector of something like:
> ul[text()=""] { content: attr(placeholder); }

Such a CSS selector will be very expensive to implement. I don't think we
want something that generic. I think just adding a pseudo element that
matches a visibly empty element will be fine.

- Ryosuke
Received on Wednesday, 2 May 2012 17:36:33 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:07:52 UTC