Bug 1493978 - Recognize Mac newlines as well as Windows newlines in the string passed to alert/confirm r=qdot
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 17 Oct 2018 17:36:11 +0000
changeset 490152 4868fc98a7b612a705d306b60f4c89707791f714
parent 490151 a58c07d9a7fa325c65fb00b7a6b2b8cc25a7af1d
child 490153 e949dd73c0ed807bd6c66988b098432d59667b4a
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersqdot
bugs1493978
milestone64.0a1
Bug 1493978 - Recognize Mac newlines as well as Windows newlines in the string passed to alert/confirm r=qdot Differential Revision: https://phabricator.services.mozilla.com/D8896
dom/base/nsGlobalWindowOuter.cpp
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -4587,16 +4587,17 @@ nsGlobalWindowOuter::AlertOrConfirm(bool
 
   nsAutoString title;
   MakeScriptDialogTitle(title, &aSubjectPrincipal);
 
   // Remove non-terminating null characters from the
   // string. See bug #310037.
   nsAutoString final;
   nsContentUtils::StripNullChars(aMessage, final);
+  nsContentUtils::PlatformToDOMLineBreaks(final);
 
   nsresult rv;
   nsCOMPtr<nsIPromptFactory> promptFac =
     do_GetService("@mozilla.org/prompter;1", &rv);
   if (NS_FAILED(rv)) {
     aError.Throw(rv);
     return false;
   }