From 9419feb114d59ca4029624382f2466758af78689 Mon Sep 17 00:00:00 2001 From: "enndeakin%sympatico.ca" Date: Tue, 21 Aug 2007 19:28:58 +0000 Subject: [PATCH] Bug 387131, tooltip extends offscreen, r+sr+a=bz --- layout/xul/base/src/nsPopupSetFrame.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/layout/xul/base/src/nsPopupSetFrame.cpp b/layout/xul/base/src/nsPopupSetFrame.cpp index d38c4550258..f32bcaf3086 100644 --- a/layout/xul/base/src/nsPopupSetFrame.cpp +++ b/layout/xul/base/src/nsPopupSetFrame.cpp @@ -213,6 +213,13 @@ nsPopupSetFrame::DoLayout(nsBoxLayoutState& aState) // layout the child popupChild->Layout(aState); + // if the width or height changed, readjust the popup position. This is a + // special case for tooltips where the preferred height doesn't include the + // real height for its inline element, but does once it is laid out. + // This is bug 228673 which doesn't have a simple fix. + if (popupChild->GetRect().width > bounds.width || + popupChild->GetRect().height > bounds.height) + popupChild->SetPopupPosition(nsnull); popupChild->AdjustView(); }