mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
Bug 1391044 - Preserve newlines in textarea placeholders. r=bz
MozReview-Commit-ID: 7h1dXSd4Ci7 --HG-- extra : rebase_source : 9fe03a61f12b04dae0778d1aa0b3c95ee3fb3d8f
This commit is contained in:
parent
c5dd8401e2
commit
1fe91d8a29
@ -494,7 +494,11 @@ nsTextControlFrame::CreatePlaceholderIfNeeded()
|
||||
// Do we need a placeholder node?
|
||||
nsAutoString placeholderTxt;
|
||||
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::placeholder, placeholderTxt);
|
||||
nsContentUtils::RemoveNewlines(placeholderTxt);
|
||||
if (IsTextArea()) { // <textarea>s preserve newlines...
|
||||
nsContentUtils::PlatformToDOMLineBreaks(placeholderTxt);
|
||||
} else { // ...<input>s don't
|
||||
nsContentUtils::RemoveNewlines(placeholderTxt);
|
||||
}
|
||||
|
||||
if (placeholderTxt.IsEmpty()) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user