Bug 23723
| Summary: | TEXTAREA is stripping newlines when form is posted | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | jasneet <jasneet> |
| Component: | Forms | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | ahmad.saleem792, ap, bfulgham, cdumez, jasneet, matthew.heidemann, rniwa, webkit-bug-importer, wenson_hsieh |
| Priority: | P2 | Keywords: | InRadar |
| Version: | 525.x (Safari 3.1) | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| URL: | http://supportforums.blackberry.com/rim/board/message.... | ||
jasneet
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Matthew Heidemann
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
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
<rdar://problem/98519842>