Bug 938563 - Select all + copy on textarea doesn't copy linebreaks, r=margaret

This commit is contained in:
Mark Capella 2013-11-20 13:57:20 -05:00
parent ef16000bab
commit 8f4ee1cb7d

View File

@ -331,9 +331,15 @@ var SelectionHandler = {
return "";
let selection = this._getSelection();
if (selection)
return selection.toString().trim();
return "";
if (!selection)
return "";
if (this._targetElement instanceof Ci.nsIDOMHTMLTextAreaElement) {
return selection.QueryInterface(Ci.nsISelectionPrivate).
toStringWithFormat("text/plain", Ci.nsIDocumentEncoder.OutputPreformatted | Ci.nsIDocumentEncoder.OutputRaw, 0);
}
return selection.toString().trim();
},
_getSelectionController: function sh_getSelectionController() {