mirror of
https://github.com/roytam1/basilisk55.git
synced 2026-05-26 15:02:46 +00:00
import from UXP: Preserve newlines in textarea placeholders (7ae2bd83)
This commit is contained in:
@@ -2266,7 +2266,11 @@ nsTextEditorState::UpdatePlaceholderText(bool aNotify)
|
||||
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(mTextCtrlElement);
|
||||
content->GetAttr(kNameSpaceID_None, nsGkAtoms::placeholder, placeholderValue);
|
||||
nsContentUtils::RemoveNewlines(placeholderValue);
|
||||
if (mTextCtrlElement->IsTextArea()) { // <textarea>s preserve newlines...
|
||||
nsContentUtils::PlatformToDOMLineBreaks(placeholderValue);
|
||||
} else { // ...<input>s don't
|
||||
nsContentUtils::RemoveNewlines(placeholderValue);
|
||||
}
|
||||
NS_ASSERTION(mPlaceholderDiv->GetFirstChild(), "placeholder div has no child");
|
||||
mPlaceholderDiv->GetFirstChild()->SetText(placeholderValue, aNotify);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user