NEW 23723
TEXTAREA is stripping newlines when form is posted
https://bugs.webkit.org/show_bug.cgi?id=23723
Summary TEXTAREA is stripping newlines when form is posted
jasneet
Reported 2009-02-03 17:52:55 PST
I Steps: 1. Go to http://supportforums.blackberry.com/rim/board/message? board.id=feedback_ideas&thread.id=496 2. Create a reply 3. Click Insert Code 4. Type or paste text with newlines 5. Press Insert 6. Press Submit II Issue: When Insert is pressed, the text is put correctly into the body of the message via javascript but when submit is pressed, it appears that the newlines are stripped as evidenced by the lack of newlines in the resulting message. III Other Browsers: IE7: ok FF3: ok IV Nightly tested: 40471 Bug in Chromium : http://code.google.com/p/chromium/issues/detail?id=2007
Attachments
Matthew Heidemann
Comment 1 2009-08-26 10:45:09 PDT
It looks like in the LayoutTests/fast/forms/textarea-crlf.html that is the expected behavior. I'm not sure why or if there is a spec that says it should be that way. Based on the test, it looks like it's stripping the carriage return as soon as the value is assigned in the dom. Also when innerHTML is assigned the same result happens. Tested on Nightly 47686.
Ahmad Saleem
Comment 2 2022-08-10 16:54:23 PDT
I am unable to reproduce this based on steps mentioned in Comment 0 but I looked in Chrome bug and found that it was fixed in this commit: Link - https://chromium.googlesource.com/chromium/src.git/+/e26eb3267527f0d5633283cef06a13995e0d41eb From above commit, I took test cases: Test Case 1 - https://jsfiddle.net/3s2u8xaz/show I get following in all browsers: *** Safari 15.6 on macOS 12.5 *** FAILED: expected "hello world webkit" but got "hello world webkit" *** Firefox Nightly 105 *** FAILED: expected "hello world webkit" but got "hello world webkit" *** Chrome Canary 106 *** PASS ________ Test Case 2 - https://jsfiddle.net/c6o28euz/show *** Safari 15.6 on macOS 12.5 *** This is a testharness.js-based test. FAIL TEXTAREA with white-space:nowrap should not increase the number of EOLs assert_equals: expected "a\n\n b\n" but got "" Harness: the test ran to completion. *** Firefox Nightly 105 *** This is a testharness.js-based test. FAIL TEXTAREA with white-space:nowrap should not increase the number of EOLs assert_equals: expected "a\n\n b\n" but got "" Harness: the test ran to completion. *** Chrome Canary 106 **** This is a testharness.js-based test. FAIL TEXTAREA with white-space:nowrap should not increase the number of EOLs assert_equals: expected "a\n\n b\n" but got "" Harness: the test ran to completion. ______ Test Case 3 - https://jsfiddle.net/z1gn46x2/show *** Safari 15.6 on macOS 12.5 *** This is a testharness.js-based test. FAIL TEXTAREA should not remove the last EOL on paste. Can't find variable: eventSender Harness: the test ran to completion. *** Chrome Canary 106 *** This is a testharness.js-based test. FAIL TEXTAREA should not remove the last EOL on paste. eventSender is not defined Harness: the test ran to completion. *** Firefox Nightly 105 *** This is a testharness.js-based test. FAIL TEXTAREA should not remove the last EOL on paste. eventSender is not defined Harness: the test ran to completion. _______ I think I botched on test case 2 and 3 but I just copied the scripts from Chrome test case. Just wanted to share update on this bug. Since on Test Case 1 - Safari do give different result compared to Chrome, I am going to change status to "New".
Radar WebKit Bug Importer
Comment 3 2022-08-11 11:28:07 PDT
Note You need to log in before you can comment on or make changes to this bug.