Bug 49979

Summary: Trailing carriage return stripped from text form field
Product: WebKit Reporter: Jamie <jamie.mckinney>
Component: FormsAssignee: Nobody <webkit-unassigned>
Status: UNCONFIRMED ---    
Severity: Normal CC: ap
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Android   
OS: Android   

Description Jamie 2010-11-23 09:32:16 PST
On Android 2.1 and 2.1 and iPhone 3GS (other versions not tested) if a form field of type 'text' has a trailing carriage return, that carriage return is not submitted.  Leading carriage returns are not stripped, nor are carriage returns within the text of a field value, only trailing carriage returns seem to be stripped.

Since this issue exists in the android and iphone browsers, but not chrome and safari (on windows 7), I'm not sure if this is a webkit bug or not.  A test case is below.

<html>
<head><title></title></head>
<body>
<!--
if this page renders as #test# then the carriage return has been stripped
if it renders as:
#test
#
then it hasn't
-->
<pre>
<? echo "#" . $_GET['foo1'] . "#" ?>
</pre>
<form name="frmTest" id="frmTest" method="GET" action="">
<input type="hidden" name="foo1" value="test
"/><!-- note the carriage return inside field 'foo1' -->
<input type="submit" value="go" />
</form>
</body>
</html>