Closed Bug 369225 Opened 13 years ago Closed 11 years ago

tooltip.sizeTo: height crops bottom border, and later doesn't shrink (width ok)


(Core :: XUL, defect)

Windows 2000
Not set





(Reporter: gekacheka, Unassigned)




(1 file)

Build id: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a2pre) Gecko/20070113 Calendar/0.4a1

Setting tooltip.sizeTo(content.boxObject.width, content.boxObject.height):

1. If height was previously shorter, and content contains wrapped text, then it produces a tooltip window that whose width is sufficient but whose height is too short, cropping the the bottom border and the bottom of the last line of text.   (The shortfall is a number that is about the thickness of the top and bottom borders and padding).  

(Workaround: add a fixed amount such as 6 pixels, to height but not width.  But may not be correct if theme changes.)

2. If height was previously taller, the height is not changed.  

(Workaround: call tooltip.setSize(0,0) first.) 

Steps to reproduce:

Open attached xul in firefox, and mouse over region A, then region B, then region C, then region B again.

Observed behavior:
In region A: tooltip is too short --- bottom border and bottom of last line of text is cropped. 
In region B: tooltip is too tall --- as tall as it was in region A.
In region C: ok, tooltip is now short (sizeTo(0,0) workaround works)
In region B again:  ok, tooltip is now short as in region C.

Expected behavior:
In region A: all borders and text should be visible.
In region B: tooltip should shrink to height of text.
In region C: was ok, tooltip short as text.
In region B again: was ok, tooltip short as text.
Assignee: nobody → jag
Component: Layout: Fonts and Text → XP Toolkit/Widgets
QA Contact: layout.fonts-and-text → xptoolkit.widgets
Blocks: 389341
Workaround changed: workaround may now require removing children of tooltip before setting sizeTo(0,0).
testcase WFM Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008051206 Firefox/3.0 (rc1)

do you see the problem with FF3 or trunk?
Assignee: jag → nobody
I guess WFM on w2k using Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv: Gecko/2009032609 Firefox/3.0.8

(works on earliest 1.9 branch ff3 nightly, still fails on most recent 1.8 branch ff2.0.0.22pre nightly, so seems to be fixed by gecko 1.9).

(The tooltips resize to content.  They flow the paragraphs into multiple lines in a square tooltip with approximately equal height and width, where I expected one wider line for the short tooltips, respecting the max-width css.  But that is a separate issue; it is much better than it was.)
Closed: 11 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.