Bug 1508868 - prompt should normalize newlines. r=smaug
authorJohn Dai <jdai@mozilla.com>
Wed, 21 Nov 2018 21:33:27 +0000
changeset 504119 91f749609e5dd544cc02924a1b56436af137cfa0
parent 504118 eab58dd901f7d09fdc771c55853a37359a0c1c92
child 504120 1b9f8a4d684b76ef30a20811f1bdb7e6fd49d27f
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1508868
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1508868 - prompt should normalize newlines. r=smaug According to spec[1], prompt should normalize newlines. [1] https://whatpr.org/html/4105/ba1c3c3...2197ed5/timers-and-user-prompts.html Differential Revision: https://phabricator.services.mozilla.com/D12551
dom/base/nsGlobalWindowOuter.cpp
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -4698,16 +4698,17 @@ nsGlobalWindowOuter::PromptOuter(const n
 
   nsAutoString title;
   MakeScriptDialogTitle(title, &aSubjectPrincipal);
 
   // Remove non-terminating null characters from the
   // string. See bug #310037.
   nsAutoString fixedMessage, fixedInitial;
   nsContentUtils::StripNullChars(aMessage, fixedMessage);
+  nsContentUtils::PlatformToDOMLineBreaks(fixedMessage);
   nsContentUtils::StripNullChars(aInitial, fixedInitial);
 
   nsresult rv;
   nsCOMPtr<nsIPromptFactory> promptFac =
     do_GetService("@mozilla.org/prompter;1", &rv);
   if (NS_FAILED(rv)) {
     aError.Throw(rv);
     return;