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

Re: Pseudo-Classes :button and :input

From: Tobias Herp <Tobias.Herp@gmx.net>
Date: Wed, 16 Sep 2009 22:23:59 +0200
Message-ID: <20090916202359.322930@gmx.net>
To: www-style@w3.org
Boris Zbarsky schrieb:
> On 9/16/09 12:01 PM, Tobias Herp wrote:
>> - a pseudo-class :input which would match any textual input, e.g.
>>    input[type="text"], input[type="password"], textarea,
>>    and the textual input box of input[type="file"]
> Note that this last might not exist.

Right. So what?

If it doesn't exist, it just won't be displayed.
If it /does/ exist, it will look like any other textual input control.

>> - a pseudo-class :button which would match any type of buttons, e.g.
>>    input[type="button"], input[type="submit"], button,
>>    and the button part of input[type="file"]
> And again, this last might not exist.

Again: so what?

>> Something like this would not only solve the file input problem
> Only by assuming a particular (fairly broken, imo) internal makeup for
> file inputs.

Yes; but this "fairly broken internal makeup" is all most of us have
(and perhaps will ever have).

>> which currently need every single of these items listed separately.
> Why is that a serious problem requiring new syntax and new code in
> browsers?

Well, /of course/ there might be more /serious/ problems.
But it's not "new syntax", it's just two new pseudo-classes, and it is IMHO a very logical and intuitive solution.
And there is new code in browsers all the time; this feature should be much easier to implement than e.g. generated content (which is still not supported by IE).

It solves problems for file input;
it is convenient for the others.

It's quite logical that, if I specify a whole bunch of properties for textual input fields (e.g. padding, background color), I want all of them look the same; I /might/ want e.g. display password fields slightly differently, but very likely I would want to use at least the same properties for all other textual input controls.

The same is true for all types of buttons; very likely, I would want only the submit button to look /slightly/ different (e.g. font-weight:bolder).

> It seems like exactly the use case attribute selectors were
> created for...

No, not really.
I know about the attribute selectors; but they just *don't work* for the file type input elements.

Consider a slightly different background color for input[type="text"]:focus.  You can't treat input[type="file"]:focus the same (at least for browsers which display a button), because it would change the background color of the button as well, which is almost certainly not what you want.



Schönen Gruß aus Dortmund,


Mit freundlichen Grüßen

Tobias Herp
Fon 0231 / 1 88 05 24
Mobil 0170 / 380 17 60
Wittekindstraße 29
44139 Dortmund
Received on Wednesday, 16 September 2009 20:24:39 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 11 February 2015 12:34:29 UTC