[Bug 13769] WF3: Add trim="" attribute to <textarea>, <input type=text/search>, <form>, and <fieldset> (applying to all contained fields of appropriate types) that strips leading and trailing whitespace from the value

http://www.w3.org/Bugs/Public/show_bug.cgi?id=13769

--- Comment #31 from Marat Tanalin | tanalin.com <mtanalin@yandex.ru> 2011-10-11 23:56:38 UTC ---
(In reply to comment #30)
> Regarding textarea, I fear people would use it inappropriately, so it would be
> a problem. For example, one could imagine this very textarea I'm using right
> now being marked trim="", since most of the time that makes sense. But if I had
> started this comment with some indented code, it would break the first line's
> indentation.

There is no much sense to start a _message_ from indentation in general and
from code in particular. Code in message is usually prepended with a summary
what code is related for. If any of leading/trailing whitespace characters in
particular field is important (for example, if a textarea is intended _exactly_
to type _code_ and only _code_ into it), then author will just not use trim
attribute for such textarea at all.

> I could see an argument for trimming just leading and trailing newlines, rather
> than newlines and spaces; what do you think?

I think it would be inconsistent with server-side trimming as well as
JavaScript String.trim() function and therefore confusing. There is quite clear
and well-known definition of what is string trimming, and there is no need for
inventing a fantom difficulties and unexpected limitations here.

> For the fieldset case, do you have an example of a Web page that groups
> controls in this way? I don't want to add it to fieldset unless it's clear that
> authors really are using fieldset in this way, otherwise it's just bloat.

It's well-known usability principle for forms: to group related (required ones
in particular) fields together. For example, imagine big registration form that
starts from a few required fields (like username, password, and e-mail)
followed by optional ones (like living city or ICQ number). I could of course
create an live example of such form for you, but I doubt it makes much sense.
After all, both forms and fieldsets are containers for fields, and if we could
use trim attribute for forms, why couldn't we use this on fieldset to get more
flexibility?

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Tuesday, 11 October 2011 23:56:40 UTC