<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.26.3">
</HEAD>
<BODY>
On Mon, 2010-02-22 at 11:08 +0000, Dean Edwards wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
On 22 February 2010 01:18, Boris Zbarsky <<A HREF="mailto:bzbarsky@mit.edu">bzbarsky@mit.edu</A>> wrote:
> On 2/21/10 7:11 PM, Dean Edwards wrote:
>>
>> Why not just extend :empty to include <input> with no value?
>
> Because that's not backwards-compatible and in fact violates the current CSS
> spec?
>
>> It reads nicely:
>>
>> input[required]:empty:after {
>> content: "This value is required";
>> color: red;
>> }
>
> 1)  :after is not defined for replaced elements (which <input> is).
> Conforming CSS2.1 user agents do a variety of things here, ranging from not
> rendering such content at all to making it a sibling of the thing being
> styled instead of a child.

Fair enough. Ignore the :after example.

> 2)  input[required]:empty is defined to match any input which has an
> attribute named "required" and no kids in the DOM.  It does NOT match an
> input which has kids in the DOM.
>
> So today, input[required]:empty would match:
>
>  <input required value="This is some value">
>
> in an HTML document and would not match the perfectly doable
>
>  <input required="required" value="This is some value">
>    And some random text, too
>  </input>
>
> in an XHTML document.
>
> Unless this is in fact a proposal to completely redefine how :empty matching
> works in some backwards-incompatible way?  Is there evidence that this won't
> break existing consumers?
>

Yes, I'm suggesting redefining how :empty works. For elements that
cannot have children it could mean having no content. e.g. An <input>
with no value or an <img> with no src.

It gets around the need for a new :placeholder pseudo-class:

input[placeholder]:empty {
  color: red;
}

There is a small chance that it could break some pages I guess. If
people are using *:empty than it may start matching some <input>
elements.

I always wanted a pseudo-class that could match <input> with no value.
Extending :empty is probably a bad idea but something like :no-value
would be useful.

-dean
</PRE>
</BLOCKQUOTE>
<BR>
:default might be better, as :no-value would fall over where you use a default value in an input box, unless you use :no-value there too, but that would just not make sense.<BR>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
Thanks,<BR>
Ash<BR>
<A HREF="http://www.ashleysheridan.co.uk">http://www.ashleysheridan.co.uk</A><BR>
<BR>
<BR>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>