[Webkit-unassigned] [Bug 28001] New: <input> should not trim initial value to maxLength

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 4 15:16:53 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=28001

           Summary: <input> should not trim initial value to maxLength
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
               URL: http://software.hixie.ch/utilities/js/live-dom-viewer/
                    saved/190
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Forms
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: pkasting at google.com
            Blocks: 27454


In WebKit, <input value=foobar maxLength=3> displays a textfield containing
"foo".  In Firefox, IE, and Opera, it displays "foobar".  We should match this.
 (Testcase at the URL above.)

This probably also applies to values set by scripting the DOM.

When the value is longer than maxLength, and the user attempts to modify the
value in place, IE and Firefox apply the following algorithm:
* Delete the selected character(s)
* If the value is now shorter than maxLength, insert characters from the user's
attempted insertion value, stopping when the length of the element's value
equals maxLength.

Opera is stranger; its first step is:
* If deleting the selected character(s) will not make the resulting value
shorter than maxLength, abort without doing anything; otherwise, delete the
selected character(s) and proceed.

As a result, when the element contains "foobar" with maxLength 3, and the
clipboard contains "zyx":
* On IE and Firefox, selecting "r" and typing a key or pasting will delete "r".
 On Opera, this will do nothing.
* On IE and Firefox, selecting "foo" and typing a key or pasting will delete
"foo".  On Opera, this will do nothing.
* On all three browsers, selecting "ooba" and pasting will result in "fzr".

I think the IE and Firefox behavior, while at first stranger, is more
consistent.

-- 
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