Bug 51168

Summary: <textarea> truncates long single lines that are pasted (after about 28k characters)
Product: WebKit Reporter: Jimmy Selgen Nielsen <jimmy.selgen>
Component: FormsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ap, austin.cheney, darin, marijnh+webkit, mathias, mitz, paulirish, tkent
Priority: P2    
Version: 525.x (Safari 3.2)   
Hardware: PC   
OS: Windows XP   

Description Jimmy Selgen Nielsen 2010-12-15 23:16:35 PST
When pasting a large single line of text into a text field, WebKit truncates at around 28k.
The same text, now with line breaks at 130 characters works fine.

I've verified this on Windows XP, using both Safari and Chrome.
IE, Firefox and Opera works as expected.
Comment 1 Darin Adler 2010-12-16 12:25:54 PST
You are saying that the text field takes 28,000 characters, but it would be better if it would take more than 28,000?
Comment 2 Jimmy Selgen Nielsen 2010-12-16 12:58:17 PST
For my particular need, i need to paste around around 500k into a text field.
It may not be pretty, but it's what i need.

Would it be better ? Maybe not, but It would be more consistent.
I would expect a text field to be able to hold any length of text up to some max, regardless of how many CR/LF the text contains.
Comment 3 Darin Adler 2010-12-16 13:00:04 PST
And by text field, do you mean <input type="text"> or <textarea>?
Comment 4 Jimmy Selgen Nielsen 2010-12-16 22:29:09 PST
That would be a TextArea.
Comment 5 Marijn Haverbeke 2011-03-03 01:54:12 PST
I've seen something similar, but it doesn't only seem to happen on pasting, even when the content is present in the HTML, or is injected by a script. I see the same problem on Chrome 9.0 and Chrome 11.0 (Debian Linux, 64-bit). See http://marijnhaverbeke.nl/upload/webkit-textarea.html for an example.

The scrollbar is visible for the whole width of the text, but the text appears 'invisible' past a certain point.

Curiously, the point at which the text gets cut off isn't a fixed number. Putting different strings into the textarea causes different cut-off points. Some texts do not get cut off at all, and there seems to be an 'affinity' for certain points--if I add a few characters to the start of the text in the linked page, it still cuts off after '{if(a.nodeName)'.
Comment 6 austincheney 2012-07-08 15:09:54 PDT
I can demonstrate this bug in Windows 7 with the following steps:

1) Go to http://prettydiff.com/prettydiff.js
2) Copy the code from this JavaScript file to the clipboard
3) Go to http://prettydiff.com/
4) In the first set of options choose "Minify"
5) Paste the code from step 1 and 2 into the input textarea.
6) Verify the entirety of the text contents were pasted into the textarea.
Comment 7 Kent Tamura 2012-08-10 18:07:19 PDT

*** This bug has been marked as a duplicate of bug 29636 ***