From 04a22e28432aecce6408e07c8a08e402960f0f84 Mon Sep 17 00:00:00 2001 From: "enndeakin%sympatico.ca" Date: Thu, 19 Jul 2007 02:02:04 +0000 Subject: [PATCH] Bug 388361, dropdowns in font dialog not always working, make sure to reset cached size when a frame is added or removed, r+sr=bz git-svn-id: svn://10.0.0.236/trunk@230255 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/xul/base/src/nsMenuFrame.cpp | 3 + .../toolkit/content/tests/widgets/Makefile.in | 1 + .../tests/widgets/test_popup_recreate.xul | 81 +++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 mozilla/toolkit/content/tests/widgets/test_popup_recreate.xul diff --git a/mozilla/layout/xul/base/src/nsMenuFrame.cpp b/mozilla/layout/xul/base/src/nsMenuFrame.cpp index 41feefd9905..0dc1d833c19 100644 --- a/mozilla/layout/xul/base/src/nsMenuFrame.cpp +++ b/mozilla/layout/xul/base/src/nsMenuFrame.cpp @@ -1154,6 +1154,7 @@ nsMenuFrame::RemoveFrame(nsIAtom* aListName, // Go ahead and remove this frame. mPopupFrame->Destroy(); mPopupFrame = nsnull; + mLastPref.SizeTo(-1, -1); PresContext()->PresShell()-> FrameNeedsReflow(this, nsIPresShell::eTreeChange, NS_FRAME_HAS_DIRTY_CHILDREN); @@ -1174,6 +1175,7 @@ nsMenuFrame::InsertFrames(nsIAtom* aListName, if (!mPopupFrame && aFrameList->GetType() == nsGkAtoms::menuPopupFrame) { mPopupFrame = static_cast(aFrameList); + mLastPref.SizeTo(-1, -1); #ifdef DEBUG_LAYOUT nsBoxLayoutState state(PresContext()); @@ -1201,6 +1203,7 @@ nsMenuFrame::AppendFrames(nsIAtom* aListName, if (!mPopupFrame && aFrameList->GetType() == nsGkAtoms::menuPopupFrame) { mPopupFrame = static_cast(aFrameList); + mLastPref.SizeTo(-1, -1); #ifdef DEBUG_LAYOUT nsBoxLayoutState state(PresContext()); diff --git a/mozilla/toolkit/content/tests/widgets/Makefile.in b/mozilla/toolkit/content/tests/widgets/Makefile.in index 309052fc0a3..935552ed0b1 100644 --- a/mozilla/toolkit/content/tests/widgets/Makefile.in +++ b/mozilla/toolkit/content/tests/widgets/Makefile.in @@ -49,6 +49,7 @@ _TEST_FILES = test_bug360220.xul \ test_bug365773.xul \ test_colorpicker_popup.xul \ test_popup_coords.xul \ + test_popup_recreate.xul \ $(NULL) libs:: $(_TEST_FILES) diff --git a/mozilla/toolkit/content/tests/widgets/test_popup_recreate.xul b/mozilla/toolkit/content/tests/widgets/test_popup_recreate.xul new file mode 100644 index 00000000000..0078d81c082 --- /dev/null +++ b/mozilla/toolkit/content/tests/widgets/test_popup_recreate.xul @@ -0,0 +1,81 @@ + + + + + + + Popup Recreate Test + + + + + + + + + + + + + + + + + +

+

+ +
+
+ + +