Closed Bug 267165 Opened 20 years ago Closed 20 years ago

Input type=text accepts multiline input when pasting

Categories

(Firefox :: General, defect)

x86
Linux
defect
Not set
minor

Tracking

()

VERIFIED DUPLICATE of bug 77932

People

(Reporter: mozilla, Assigned: bugzilla)

References

()

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041030 Firefox/1.0RC1 (Debian package 0.99+1.0RC1-2)
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041030 Firefox/1.0RC1 (Debian package 0.99+1.0RC1-2)

A form element <input type="text"> accepts text input containing newlines when
this input is pasted into it. An example can be found at the URL above: one
can't input a newline with the keyboard (good) but when copying some text from
elsewhere with newlines this can be pasted with no problem (bad).

The HTML-spec explicitly names the type="text" control to be "single-line".
Probably it should only accept the first line of the input as is customary
behaviour for these kinds of controls in user interfaces.

Reproducible: Always
Steps to Reproduce:
1. Create a form with an input type=text control
2. Paste some text with newlines into it

Actual Results:  
Full text with newlines is accepted and sent to server.

Expected Results:  
Only accept first line, just like most operating systems, widget toolkits,
browsers etc allow.
Doesn't happen here in Mozilla1.7 WinXp.
Copying:
one
two
Pasting in your testcase and then submitting, I get returned "one".

So maybe only a Linux problem?
Yes, it's Linux-only (well, by default, Linux has
editor.singleLine.pasteNewlines set to 0, and Windows to 1): see bug 23485 for
at least one branch of discussion for why it's different, though bug 77932 is a
better dup.

*** This bug has been marked as a duplicate of 77932 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.