[Webkit-unassigned] [Bug 56768] Placeholder functionality should trim the input value on blur.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Dec 6 10:04:03 PST 2011


--- Comment #3 from Benjamin Bertrand <bertrand.design at gmail.com>  2011-12-06 10:04:03 PST ---
Yes, the issue still exists. 

0. What is the explicit placeholder functionality? The HTML5 spec is vague on how to the implement the functionality. The spec does say that the placeholder value _itself_ cannot contain line-breaks, tabs or restricted/whitespace characters. I'm not referring to that. I am referring to the rendering of INPUT tags with an attribute of PLACEHOLDER. 

1. Browsers should validate the user character input by trimming leading and trailing whitespace BEFORE checking if the input is (not) equal to the placeholder value. 

Front-end devs have done this with JavaScript(JS) for years, and more than a few omit this needed step. 

To support this position: 
2.a) This validation step is trivial for a compiled browser. It could be done with a regular expression. 
2.b) It would improve UX greatly: no empty strings, control chars or other trivial whitespace would make it into an HTML Request when submitted via INPUT with a PLACEHOLDER. 
2.c) While server-side systems must handle empty or whitespace character input, this will head-off many such things. 
2.d) Who searches for whitespace? What are their motives? Unless the user has a specific code-based inquiry, there's almost no reason to search for whitespace. And coders are going to have tools that they use that for (grep, etc.) 
2.e) It removes the need for developers to re-implement their own JS override for this oft-overlooked detail in placeholder functionality. 

My point being, if you are going to implement a placeholder, then implement it right. Currently, the PLACEHOLDER attribute implementation is incomplete without trimming. 

Latest versions of Chrome and Safari both display the same behavior; they do not validate the input.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list