RE: [CSS21] [CSS3 Text] Should 'text-transform: uppercase' apply to input type="text" (text entered, typed in text field by user)?


[Kang-Hao (Kenny) Lu:]
> 
> > If the author applies text-transform to form input but no longer
> > applies it when the value is displayed back to the user, is the
> > problem with text-transform?
> 
> I am not sure I understand this...

Say I create a new account and the form uses text-transform to capitalize
my user name. But after I log back in my user name is displayed in some corner
of the page without text-transform i.e. it looks different than it did in
the account creation page or the login page. This could look odd to the user
but I think this is an application problem, not something we should fix by
making text-transform mess with the value sent over the wire.

> 
> > Conversely, should we require text-transform to affect the value that
> > is submitted then I suspect it won't be very reliable in practice e.g.
> > because a stylesheet didn't load, a number of existing UAs may not
> > apply this property to the content of form controls but applying it to
> > existing forms could break applications that did not expect it to apply to
> form controls or affect the field value etc.
> 
> I agree.
> 
> > Overall I think of this as a display-only feature pending use-cases that
> prove otherwise.
> > And even then I would be concerned about the compat impact.
> 
> I can't quite believe there's a use case of applying 'text-transform' to an
> input control. I guess browsers just implement this for consistency and I
> don't have a strong argument otherwise, but this behavior is still weird to
> me.
> 
Is it weirder than writing:

input[type="text"] { text-transform: uppercase; }

...and the property having no effect, when it very well might work if you instead
selected some custom jQuery-built control instead?

The use-cases may be rare, or weird. But the web is large, weird is not that
uncommon and the workaround would be ugly so it may in fact be simpler to be consistent.
And looking over the horizon to ways authors may build and use controls in the future 
- shadow DOM - I don't expect this property to be treated specially either.

Received on Tuesday, 26 June 2012 16:08:23 UTC