Bug 1270310 - Part 4: Bypass line break conversion if element is single line. r=peterv

For single line text controls we shouldn't need to convert line breaks.
This commit is contained in:
Eric Rahm 2016-05-05 15:52:28 -07:00
parent e69bdc29f2
commit cb79780013

View File

@ -5780,14 +5780,16 @@ HTMLInputElement::SaveState()
return rv;
}
rv = nsLinebreakConverter::ConvertStringLineBreaks(
value,
nsLinebreakConverter::eLinebreakPlatform,
nsLinebreakConverter::eLinebreakContent);
if (!IsSingleLineTextControl(false)) {
rv = nsLinebreakConverter::ConvertStringLineBreaks(
value,
nsLinebreakConverter::eLinebreakPlatform,
nsLinebreakConverter::eLinebreakContent);
if (NS_FAILED(rv)) {
NS_ERROR("Converting linebreaks failed!");
return rv;
if (NS_FAILED(rv)) {
NS_ERROR("Converting linebreaks failed!");
return rv;
}
}
break;