W3C home > Mailing lists > Public > www-style@w3.org > September 2009

Re: Pseudo-Classes :button and :input

From: Tobias Herp <Tobias.Herp@gmx.de>
Date: Mon, 21 Sep 2009 22:58:03 +0200
Message-ID: <4AB7E8DB.1060803@gmx.de>
To: Sergey Ilinsky <castonet@yahoo.co.uk>
CC: Boris Zbarsky <bzbarsky@MIT.EDU>, www-style@w3.org
Sergey Ilinsky wrote:
> --- On Fri, 18/9/09, Tobias Herp <tobias.herp@gmx.de> wrote:
>> Only what I wrote:
>> - :textual-input to match any textual input
>>   (except file input if you must)
>> - :button-input to match any button input (where appropriate, and
>>   with the possible exception of file controls)
> Isn't the pseudo-element selector a better fit for that purpose?

Well... maybe: For the text or button parts of input[type="file"] (...)
or any type introduced by HTML5 which will likely be composed of more
than one component, :button-input and :textual-input look very much like
:first-child or :first-line (or ::first-child/::first-line) and make
elements accessible which could not be specified otherwise.
A ::textual-input selector would keep on to be combinable to
input::textual-input (and exclude textareas which would be matched by

On the other hand, for input[type="button"] (reset, submit),
:button-input would match the entire element.

I'm not sure whether it is a good idea to introduce a different syntax
for "pseudo-elements"; ::before and ::after (CSS3) would be new
notations for the :before and :after elements already known to CSS2.1.
(Thinking about it, I consider the :: syntax a *bad* idea.)

> Pseudo-classes are more often used for interaction states (at least they were in the beginning), like :hover or :focus, while pseudo-elements (using :: selector) - for "pseudo"/"shadow" content (like ::first-letter or ::before)

As I understand it, "pseudo-elements" are entities which would be
otherwise completely unselectable because they are not part of the
element tree, like ::before or ::first-letter.

In the beginning, there was no special syntax for pseudo-elements,
distinguishing them from pseudo-classes.  Since ...

* the difference is difficult,
* ::before (etc.) instead of :before would break compatibility (!), and
* there is a cloudy zone in-between (e.g. for [:]:button-input),

I consider it better to drop this "::" idea.

> BTW, There is already a special pseudo-element defined in the CSS3-UI for the value box
> ::value

I couldn't find it at
http://www.w3.org/TR/css3-selectors/#pseudo-elements; can you provide a
What is a "value box"?
(input[type="hidden"] has a value [but no box], input[type="submit"] can
have one)

Received on Monday, 21 September 2009 21:05:29 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:39 UTC