Closed Bug 115997 Opened 18 years ago Closed 9 years ago

alert()/confirm()/prompt() containing too much text is larger than the screen

Categories

(Core :: XUL, defect)

defect
Not set

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: atmjav, Unassigned)

References

(Depends on 1 open bug)

Details

Attachments

(6 files, 1 obsolete file)

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.6+) Gecko/20011218
BuildID:    2001121803

When an alert()/confirm()/prompt() window contains to much text it's larger than
the screen. I think it is good idea to add a vertical scrollbar that appear when
alert text is too large.

Reproducible: Always
Steps to Reproduce:
1. (for resolution 800x600) Execute this script:
alert("zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz zzzzz
zzzzz zzzzz zzzzz zzzzz");


Actual Results:  Alert window with titlebar upper than top screen edge, without
OK button.

Expected Results:  Alert window with OK button, not larger than (screen
width)-30 x (screen height)-80
XP apps.  ccing ui people.
Assignee: rods → blakeross
Status: UNCONFIRMED → NEW
Component: HTML Form Controls → XP Apps: GUI Features
Ever confirmed: true
OS: Windows 98 → All
QA Contact: madhur → sairuh
Hardware: PC → All
could you pls attach a screenshot? thx!
Too large alert window appeared (image, prom the top of the screen to the
taskbar). (classic)
Too large alert window appeared (image, prom the top of the screen to the
taskbar). (modern)
-> hewitt
Assignee: blaker → hewitt
Status: NEW → ASSIGNED
Target Milestone: --- → Future
Depends on: 79623
Summary: When an alert()/confirm()/prompt() window contains to much text it's larger than the screen → alert()/confirm()/prompt() containing too much text is larger than the screen
See also bug 40508 (Message of the alert dialog truncated if no whitespace in a
long message) -- different issue bug similiar
Product: Core → Mozilla Application Suite
*** Bug 254299 has been marked as a duplicate of this bug. ***
Attached image Characters cut off
I was able to replicate this using:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060124 Firefox/1.5.0.1

Also, if you do the following: alert("1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111")
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111")

The box cuts off the text. See screenshot.
Duplicate of this bug: 184055
Attached file testcase with horizontal flooding (obsolete) —
It's not just vertical overflow which is a problem...
sorry, posted wrong attachment
Attachment #279808 - Attachment is obsolete: true
I have a solution for this bug, vetted over IRC by Enn.  Patch coming.
Assignee: hewitt → guifeatures
Status: ASSIGNED → NEW
QA Contact: bugzilla
Attached patch patch, v1Splinter Review
Attachment #279965 - Flags: review?
Attachment #279965 - Flags: review? → review?(enndeakin)
This patch adds scrollbars if the text is too big - and doesn't if the text isn't.

It may not be sufficient for accessibility purposes.  I don't know of any way to scroll the main box via keystrokes.  I'd take suggestions for that.
Assignee: guifeatures → ajvincent
QA Contact: guifeatures
Status: NEW → ASSIGNED
Component: XP Apps: GUI Features → XP Toolkit/Widgets: XUL
Product: Mozilla Application Suite → Core
Target Milestone: Future → mozilla1.9 M9
Requesting blocking1.9: this bug is for a usability issue with alerts, prompts & confirmation dialogs where the buttons simply aren't visible.

If the general approach is acceptable (I don't have any other ideas right now), then I can modify the patch as needed for 1.9.

I'm tempted to request approval-1.8.1 at the appropriate time, but it's probably a bit late...
Flags: blocking1.9?
Comment on attachment 279965 [details] [diff] [review]
patch, v1


>   // display the main text
>-  var messageParent = document.getElementById("info.box").getElementsByTagName('description')[0];
>+  var mainText = document.getElementById("info.box");
>+  var messageParent = mainText.getElementsByTagName('description')[0];
>   // XXX the substr(0, 10000) part is a workaround for bug 317334
>   messageParent.textContent = gCommonDialogParam.GetString(0).substr(0, 10000);
> 
>+  var hboxTarget = dialog.getElementsByTagName("hbox")[0];

Is there a reason this code has been using getElementsByTagName to find elements rather than just using an id?
 
>+  var boxObject = document.getBoxObjectFor(mainText);
>+  if (boxObject.width > 640) {
>+    if (boxObject.height > 480) {
>+      hboxTarget.style.overflow = "scroll";
>+      hboxTarget.style.height = "480px";
>+    } else {
>+      hboxTarget.style.overflow = "-moz-scrollbars-horizontal";
>+    }
>+    hboxTarget.style.width = "640px";
>+  } else if (boxObject.height > 480) {
>+    hboxTarget.style.overflow = "-moz-scrollbars-vertical";
>+    hboxTarget.style.height = "480px";
>+  }

Looks OK. I guess just using a maxwidth/maxheight doesn't work well?
(In reply to comment #16)
> Is there a reason this code has been using getElementsByTagName to find
> elements rather than just using an id?

Not a good one, but I tend to favor minimalist patches that fix the reported problem over grand ones in the first review pass.  I can expand the scope if you like.

> Looks OK. I guess just using a maxwidth/maxheight doesn't work well?

It might; I need to test that when I get home.  It didn't work on Fx2.

Also, I'm not sure I picked the right hboxTarget.  Look at all the elements inside the selected hbox...
Comment on attachment 279965 [details] [diff] [review]
patch, v1

Going to assume a new patch is coming.
Attachment #279965 - Flags: review?(enndeakin) → review-
Flags: blocking1.9? → blocking1.9-
Whiteboard: [wanted-1.9]
Flags: wanted1.9+
Whiteboard: [wanted-1.9]
Alex: any plans to update this patch? I noticed this same problem again over in bug 244273
Not immediately, no.  I'm still swamped at work.
Duplicate of this bug: 425182
Flags: wanted1.9-
Flags: wanted1.9+
Flags: wanted-next+
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: guifeatures → xptoolkit.widgets
Target Milestone: mozilla1.9beta1 → ---
The patch in bug 357725 might help here.
Also, see bug 481914, where it is made clear that the dialog is also used in mobile.
Duplicate of this bug: 313783
Assignee: ajvincent → nobody
Status: ASSIGNED → NEW
This has been fixed with the new alert() system in Firefox 4.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
No way for the user to reach any buttons if the filename is longer than the screen here in
Mozilla/5.0 (X11; Linux i686; rv:12.0a2) Gecko/20120302 Firefox/12.0a2 Iceweasel/12.0a2

A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.

Script: http://maps.gstatic.com/cat_js/intl/zh-TW_tw/mapfiles/399b/maps2/%7Bmain,mod_util,mod_act,mod_act_s,mod_actbr,mod_appiw,mod_hotel_price,mod_lyrs,mod_mssvt,mod_qop,mod_qopa,mod_rating_widget,mod_rst,mod_strr,mod_truffle%7D.js:903A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.
You need to log in before you can comment on or make changes to this bug.