Closed Bug 1508868 Opened 11 months ago Closed 11 months ago
alert/confirm/prompt should normalize newlines
Currently calling these with the JS string 'Line 1.1\nLine 1.2\rLine 1.3\r\nLine 1.4\n\rLine 2.1' gives Line 1.1 Line 1.2Line1.3 Line 1.4 Line 2.1 instead of the expected Line 1.1 Line 1.2 Line 1.3 Line 1.4 Line 2.1 --- Spec change: https://github.com/whatwg/html/pull/4105 (Manual) tests: https://github.com/web-platform-tests/wpt/pull/13600 Spec: https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#simple-dialogs , e.g. for alert() steps 5 and 7.
When I filed for this spec change, I also filed bug 1493978 here which is fixed, so I'm not sure what's up here.
As far as I can tell from running the test in Nightly on macOS it was fixed for alert/confirm, but not prompt. Do you want to take this John?
Priority: -- → P3
Assignee: nobody → jdai
It seems that only prompt didn't follow the spec.  https://whatpr.org/html/4105/ba1c3c3...2197ed5/timers-and-user-prompts.html /form-control-infrastructure.html We already follow the spec. /form-elements.html It has been handled at bug 1391044 /infrastructure.html There is nothing to do with the code change. /parsing.html Clarify with <hsivonen> the outcome should be indistinguishable from what the spec requires.  https://searchfox.org/mozilla-central/source/parser/html/javasrc/Tokenizer.java#1545-1557 /timers-and-user-prompts.html It has been handled at bug 1493978 with alert/confirm, but not prompt.
Status: NEW → ASSIGNED
According to spec, prompt should normalize newlines.  https://whatpr.org/html/4105/ba1c3c3...2197ed5/timers-and-user-prompts.html
I apparently had not restarted my Firefox Nightly in a while, which explains my results in the OP. I can confirm with the latest nightly alert and confirm are correct, and only prompt has the OP behavior.
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/91f749609e5d prompt should normalize newlines. r=smaug
You need to log in before you can comment on or make changes to this bug.