Closed Bug 43360 Opened 24 years ago Closed 16 years ago

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

Categories

(Core :: XUL, defect, P3)

x86
Windows NT
defect

Tracking

()

RESOLVED FIXED
Future

People

(Reporter: roc, Assigned: hyatt)

Details

Attachments

(2 files)

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.
Mine mine mine.
Assignee: trudelle → hyatt
->future
Target Milestone: --- → Future
Attachment #10478 - Attachment mime type: text/xul → application/vnd.mozilla.xul+xml
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
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).
Does anyone have a workaround for this?

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.
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: jrgmorrison → xptoolkit.widgets
This was fixed a while ago.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: