diff --git a/layout/xul/base/public/nsXULPopupManager.h b/layout/xul/base/public/nsXULPopupManager.h index 748c5502b39..e454e3a8755 100644 --- a/layout/xul/base/public/nsXULPopupManager.h +++ b/layout/xul/base/public/nsXULPopupManager.h @@ -210,10 +210,12 @@ class nsXULPopupShowingEvent : public nsRunnable public: nsXULPopupShowingEvent(nsIContent *aPopup, nsIContent *aMenu, + nsPopupType aPopupType, PRBool aIsContextMenu, PRBool aSelectFirstItem) : mPopup(aPopup), mMenu(aMenu), + mPopupType(aPopupType), mIsContextMenu(aIsContextMenu), mSelectFirstItem(aSelectFirstItem) { @@ -226,6 +228,7 @@ public: private: nsCOMPtr mPopup; nsCOMPtr mMenu; + nsPopupType mPopupType; PRBool mIsContextMenu; PRBool mSelectFirstItem; }; diff --git a/layout/xul/base/src/nsXULPopupManager.cpp b/layout/xul/base/src/nsXULPopupManager.cpp index 397f27e347a..f710b21b905 100644 --- a/layout/xul/base/src/nsXULPopupManager.cpp +++ b/layout/xul/base/src/nsXULPopupManager.cpp @@ -421,7 +421,7 @@ nsXULPopupManager::ShowMenu(nsIContent *aMenu, if (aAsynchronous) { SetTriggerEvent(nsnull, nsnull); nsCOMPtr event = - new nsXULPopupShowingEvent(popupFrame->GetContent(), aMenu, + new nsXULPopupShowingEvent(popupFrame->GetContent(), aMenu, popupFrame->PopupType(), parentIsContextMenu, aSelectFirstItem); NS_DispatchToCurrentThread(event); } @@ -2010,9 +2010,7 @@ nsXULPopupShowingEvent::Run() nsXULPopupManager* pm = nsXULPopupManager::GetInstance(); nsPresContext* context = GetPresContextFor(mPopup); if (pm && context) { - // the popupshowing event should only be fired asynchronously - // for menus, so just use ePopupTypeMenu as the type - pm->FirePopupShowingEvent(mPopup, mMenu, context, ePopupTypeMenu, + pm->FirePopupShowingEvent(mPopup, mMenu, context, mPopupType, mIsContextMenu, mSelectFirstItem); } diff --git a/toolkit/content/tests/widgets/Makefile.in b/toolkit/content/tests/widgets/Makefile.in index 2001510e409..b7919f64833 100644 --- a/toolkit/content/tests/widgets/Makefile.in +++ b/toolkit/content/tests/widgets/Makefile.in @@ -49,6 +49,7 @@ _TEST_FILES = test_bug360220.xul \ test_bug365773.xul \ test_bug382990.xul \ test_bug457632.xul \ + test_button.xul \ test_closemenu_attribute.xul \ test_colorpicker_popup.xul \ test_deck.xul \ diff --git a/toolkit/content/tests/widgets/test_button.xul b/toolkit/content/tests/widgets/test_button.xul new file mode 100644 index 00000000000..033abb1d727 --- /dev/null +++ b/toolkit/content/tests/widgets/test_button.xul @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + diff --git a/toolkit/content/widgets/button.xml b/toolkit/content/widgets/button.xml index cc2d0eb7699..b4608025609 100644 --- a/toolkit/content/widgets/button.xml +++ b/toolkit/content/widgets/button.xml @@ -142,28 +142,33 @@ - + @@ -251,7 +256,7 @@ - + @@ -362,7 +367,7 @@ - + + @@ -30,7 +30,7 @@ - + @@ -41,7 +41,7 @@ - + @@ -60,7 +60,7 @@ - +