Bug 1365402 - part 1: Normalize CRLF and CR to LF for textarea value property, r=baku

MozReview-Commit-ID: HDN4EfZ3n5K
This commit is contained in:
btian
2017-06-13 10:17:54 +08:00
parent 6bfb28c83e
commit 628a5bc80d
2 changed files with 7 additions and 6 deletions

View File

@@ -243,7 +243,13 @@ HTMLTextAreaElement::GetType(nsAString& aType)
NS_IMETHODIMP
HTMLTextAreaElement::GetValue(nsAString& aValue)
{
GetValueInternal(aValue, true);
nsAutoString value;
GetValueInternal(value, true);
// Normalize CRLF and CR to LF
nsContentUtils::PlatformToDOMLineBreaks(value);
aValue = value;
return NS_OK;
}