Closed Bug 40508 Opened 25 years ago Closed 18 years ago

Message of the alert dialog truncated if no whitespace in a long message

Categories

(Core :: XUL, defect, P2)

defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: desale, Assigned: jag+mozilla)

References

()

Details

(Keywords: dom0, testcase, Whiteboard: [nsbeta3-])

Attachments

(1 file)

If we create alert message by joining different parts, like by joining different strings, and variables, and if message is longer than one line, then it gets truncated and alert does not show whole message. STEPS TO REPRODUCE: 1] please load the testcase I'm attaching. 2] You'll see two buttons which generate alert messages. 3] Click first button. You'll see alert message with truncated message at end. 4] click second button. You'll see alert message with full message. EXPECTD RESULTS: alert generated by clicking second button is expected on cliking first button too. Both alerts should be same. ACTUAL RESULTS: First alert truncates message at the end. EXPLAINATION: Alert generation functions used for both alerts. ALERT1: function showlongalert1(){ var winname, winwidth, winheight, wintool, winmenu, winscroll, winresize; winname= 'myWindow'; winwidth= 400; winheight = 300; wintool = 'yes'; winmenu = 'yes'; winscroll = 'yes'; winresize = 'yes'; var mainWin = 'window.open("http://www.yahoo.com","' + winname + '"'; var winOpt = ',"width=' + winwidth + ',height=' + winheight; winOpt = winOpt + ',toolbar=' + wintool + ',menubar=' + winmenu; winOpt = winOpt + ',scrollbars=' + winscroll + ',resizable=' + winresize + '")'; mainWin = mainWin + winOpt; alert(mainWin); } ALERT2: function showlongalert2(){ var mainWin = 'window.open("http://www.yahoo.com","myWindow","width=400, height=300, toolbar=yes, menubar=yes, scrollbars=yes, resizable=yes")'; alert(mainWin); } Both functions should generate same alert. Message is same. Just message generation is different.
Attached file Testcase
Changing priority and seviarity.
Severity: normal → major
Priority: P3 → P2
I believe that the alert window uses the XUL <html> element to contain this text, so it just uses HTML line-breaking rules --- if you place a line in a browser window with no spaces between words, it will extend past the right edge of the viewport (if it has enough characters). Same thing applies here.
This bug has been marked "future" because the original netscape engineer workingon this is over-burdened. If you feel this is an error, that you or another known resource will be working on this bug,or if it blocks your work in some way -- please attach your concern to the bug for reconsideration.
Target Milestone: --- → Future
I guess we can live with future mark. Its not blocking anything.
Status: NEW → ASSIGNED
Marking this nsbeta3 because I think alerts should work from all directions.
Keywords: nsbeta3
Marking as [nsbeta3-] a number of bugs that were already marked Future (but not [nsbeta3-]) because the Netscape engineer the bug is assigned to is overburdened. If you disagree with this decision, please provide information about customer and user impact, but please do not clear the [nsbeta3-] unless you are reassigning the bug to yourself and committing to a fix within the nsbeta3 timeframe.
Whiteboard: [nsbeta3-]
Keywords: dom0
For the record, the alert dialog is coded here: http://lxr.mozilla.org/seamonkey/source/xpfe/global/resources/content/commonDialog.xul commonDialog.js in the same directory fills the text of the alert. It does so by splitting (.split(\n)) the string passed in, apparently where there are whitespaces or new line characters. It then creates one <html> tag for each line of text that was split. I can't figure out (I haven't really thought much about it either) how to fix the dialog so that it wraps better, but I hope this comment helps other people finding a solution.
Summary: alert message gets truncated. → Message of the alert dialog truncated if no whitespace in a long message
Just need to introduce whitespace into a text run of more than "N" characters, where "N" is some reasonable number (e.g., what length does 4.x break at?).
NS4 breaks after "toolbar=yes,", i.e. it shows the alert like this: ********************************************* window.open("http://www.yahoo.com","myWindow","width=400,height=300,toolbar=yes, menubar=yes,scrollbars=yes,resizable=yes ********************************************* (I hope your screen is long enough to see it) In my book, that makes 80 chars per line.
*** Bug 137746 has been marked as a duplicate of this bug. ***
Reassigning to XP Apps. The DOM has no control over how the alert box shows the text that's being alert'ed, the DOM code calls through the prompt service, which is provided by the embedding app, i.e. mozilla when running mozilla. This is something that needs to be fixed on the XP Apps side of things, if it needs to be fixed at all.
Assignee: jst → sgehani
Status: ASSIGNED → NEW
Component: DOM Level 0 → XP Apps
OS: Windows 95 → All
QA Contact: desale → paw
Hardware: PC → All
Target Milestone: Future → ---
The dialog is supposed to be sized to content. Apparently a layout issue (not an XPApps issue for sure since we don't control the dialog).
Assignee: sgehani → attinasi
Component: XP Apps → Layout
QA Contact: paw → petersen
CC'ing danm who is going to examine whether the prompt service itself should toss in line breaks.
Target Milestone: --- → Future
Keywords: testcase
A duplicate similar report of this bug is in bug 228514: http://bugzilla.mozilla.org/show_bug.cgi?id=228514
*** Bug 228514 has been marked as a duplicate of this bug. ***
let's reset this bug. fwiw IE 6.0.2800.1106 on w2k (1600x1200) shows 6144 characters. The number of lines varies based on the width of the characters used...
Assignee: attinasi → jag
Component: Layout → XP Toolkit/Widgets
QA Contact: chrispetersen → jrgmorrison
Target Milestone: Future → ---
Viewing the URL in Firefox 0.9.3 shows just a black box.
*** Bug 248395 has been marked as a duplicate of this bug. ***
*** Bug 259968 has been marked as a duplicate of this bug. ***
I think this one was fixed a while ago for Firefox.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: