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
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
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).
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
Last Resolved: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.