Changeset 31081 in webkit
- Timestamp:
- Mar 16, 2008, 1:17:54 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r31075 r31081 1 2008-03-16 Darin Adler <darin@apple.com> 2 3 Reviewed by Mitz. 4 5 - test for http://bugs.webkit.org/show_bug.cgi?id=14941 6 <rdar://problem/5404093> textarea value from JavaScript includes extra newline 7 8 * fast/forms/textarea-paste-newline.html: Updated test to expect correct behavior instead 9 of expecting the bug. 10 11 * fast/forms/textarea-trailing-newline-expected.txt: Added. 12 * fast/forms/textarea-trailing-newline.html: Added. 13 1 14 2008-03-15 Darin Adler <darin@apple.com> 2 15 -
trunk/LayoutTests/fast/forms/textarea-paste-newline.html
r25332 r31081 15 15 var result2 = ta.value; 16 16 17 if (result1 == "abc\n \n" && result2 == "abc\nabc\n\n")17 if (result1 == "abc\n" && result2 == "abc\nabc\n") 18 18 document.write("<p>Hooray, the test was successful!</p>"); 19 19 else if (result1 == "") 20 20 document.write("<p>The test failed; doesn't work in release builds of Safari because paste is not allowed.</p>"); 21 21 else 22 document.write("<p>The test failed, result 1 was '" + result1.replace("\n", "\\n") + "' and result 2 was '" + result2.replace("\n", "\\n") + "'. This test demonstrates a bug (5299425): the final '\\n' in a textarea is reported by .value even if it is collapsed.</p>");22 document.write("<p>The test failed, result 1 was '" + result1.replace("\n", "\\n") + "' and result 2 was '" + result2.replace("\n", "\\n") + "'.</p>"); 23 23 } 24 24 </script> -
trunk/WebCore/ChangeLog
r31080 r31081 1 2008-03-16 Darin Adler <darin@apple.com> 2 3 Reviewed by Mitz. 4 5 - fix http://bugs.webkit.org/show_bug.cgi?id=14941 6 <rdar://problem/5404093> textarea value from JavaScript includes extra newline 7 8 Test: fast/forms/textarea-trailing-newline.html 9 10 * rendering/RenderTextControl.cpp: 11 (WebCore::RenderTextControl::finishText): Added code to strip the trailing 12 newline. It's possible there are some obscure cases where this is not wanted, 13 but I couldn't find any. If someone finds a case where this is bad, we can 14 make the code conditional. 15 1 16 2008-03-16 Darin Adler <darin@apple.com> 2 17 -
trunk/WebCore/rendering/RenderTextControl.cpp
r30973 r31081 556 556 String RenderTextControl::finishText(Vector<UChar>& result) const 557 557 { 558 // Remove one trailing newline; there's always one that's collapsed out by rendering. 559 size_t size = result.size(); 560 if (size && result[size - 1] == '\n') 561 result.shrink(--size); 562 563 // Convert backslash to currency symbol. 558 564 UChar symbol = backslashAsCurrencySymbol(); 559 565 if (symbol != '\\') { 560 size_t size = result.size(); 561 for (size_t i = 0; i < size; ++i) 566 for (size_t i = 0; i < size; ++i) { 562 567 if (result[i] == '\\') 563 568 result[i] = symbol; 569 } 564 570 } 565 571
Note:
See TracChangeset
for help on using the changeset viewer.