<html> content inside popups doesn't size the popup correctly

RESOLVED FIXED in Future

Status

()

Core
XUL
P3
normal
RESOLVED FIXED
18 years ago
10 years ago

People

(Reporter: roc, Assigned: David Hyatt)

Tracking

Trunk
Future
x86
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

I am trying to create a XUL popup containing <html> elements. I can't get
the popup to size correctly in the presence of wrapping text; this is
necessary to make TITLE tooltips work perfectly, which requires that the
text wrap if it's too long.

The problem is this: the popup's Layout method calls GetPrefSize, which
works its way down to the HTML frames. nsBoxToBlockAdaptor computes the
preferred size by flowing the text into an unconstrained canvas, which
puts it all on one line. So, the desired size is one very long line. I
have a CSS max-width property that forces the popup frame to be a
reasonable width. So the width is set, and we call Layout. This works its
way down, the HTML frames find out about the new width and wrap the text.
The increased height is propagated back up to the scroll port in the
popup, where it's dropped because the scroll port frame doesn't care how
big its child gets. So the popup never resizes vertically to fit the
wrapped text.
Created attachment 10478 [details]
Simple XUL demo of the problem
(Assignee)

Comment 2

18 years ago
Mine mine mine.
Assignee: trudelle → hyatt

Comment 3

18 years ago
->future
Target Milestone: --- → Future

Updated

16 years ago
Attachment #10478 - Attachment mime type: text/xul → application/vnd.mozilla.xul+xml

Comment 4

14 years ago
what should the attachemnt do exactly?
I get a grey windows...
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.1) Gecko/20040707

Comment 5

12 years ago
Created attachment 227710 [details]
slightly different test case using <description> elements

I see this same bug when using <description> element or <label> elements as well (long text that wraps across multiple lines in a width-constrained <popup> causes the height to be miscalculated).

Comment 6

12 years ago
Does anyone have a workaround for this?

Comment 7

12 years ago
The workaround we used was to write an "onpopupshown" function that looked at the children's box objects to determine and set an ideal height.

Updated

10 years ago
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: jrgmorrison → xptoolkit.widgets

Comment 8

10 years ago
This was fixed a while ago.
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.