diff --git a/mozilla/content/base/src/nsDocument.cpp b/mozilla/content/base/src/nsDocument.cpp index af57f14cbe8..8e2d2568a4b 100644 --- a/mozilla/content/base/src/nsDocument.cpp +++ b/mozilla/content/base/src/nsDocument.cpp @@ -2357,8 +2357,9 @@ nsDocument::GetBoxObjectFor(nsIDOMElement* aElement, nsIBoxObject** aResult) contractID += "-iframe"; else if (tag.get() == nsXULAtoms::menu) contractID += "-menu"; - else if (tag.get() == nsXULAtoms::popupset) - contractID += "-popupset"; + else if (tag.get() == nsXULAtoms::popup || tag.get() == nsXULAtoms::menupopup || + tag.get() == nsXULAtoms::tooltip) + contractID += "-popup"; else if (tag.get() == nsXULAtoms::tree) contractID += "-tree"; else if (tag.get() == nsXULAtoms::scrollbox) diff --git a/mozilla/content/shared/public/nsXULAtomList.h b/mozilla/content/shared/public/nsXULAtomList.h index e45ae6bc1f8..7b2345421fa 100644 --- a/mozilla/content/shared/public/nsXULAtomList.h +++ b/mozilla/content/shared/public/nsXULAtomList.h @@ -104,7 +104,7 @@ XUL_ATOM(menutobedisplayed, "menutobedisplayed") // The menu is about to be disp XUL_ATOM(menuactive, "menuactive") // Whether or not a menu is active (without necessarily being open) XUL_ATOM(accesskey, "accesskey") // The shortcut key for a menu or menu item XUL_ATOM(acceltext, "acceltext") // Text to use for the accelerator -XUL_ATOM(popupset, "popupset") // Contains popup menus, context menus, and tooltips +XUL_ATOM(popupgroup, "popupgroup") // Contains popup menus, context menus, and tooltips XUL_ATOM(popup, "popup") // The popup for a context menu, popup menu, or tooltip XUL_ATOM(menugenerated, "menugenerated") // Internal XUL_ATOM(popupanchor, "popupanchor") // Anchor for popups diff --git a/mozilla/content/xul/content/src/nsXULElement.cpp b/mozilla/content/xul/content/src/nsXULElement.cpp index d085044fe31..d06b0298d7a 100644 --- a/mozilla/content/xul/content/src/nsXULElement.cpp +++ b/mozilla/content/xul/content/src/nsXULElement.cpp @@ -2065,7 +2065,7 @@ static PRBool CanHaveBinding(nsIAtom* aTag) { // for display: none elts anyway, so we're getting into a real edge // case. return (aTag != nsXULAtoms::broadcaster) && (aTag != nsXULAtoms::commandset) && - (aTag != nsXULAtoms::commands) && (aTag != nsXULAtoms::command) && (aTag != nsXULAtoms::popupset) && + (aTag != nsXULAtoms::commands) && (aTag != nsXULAtoms::command) && (aTag != nsXULAtoms::popupgroup) && (aTag != nsXULAtoms::broadcasterset) && (aTag != nsXULAtoms::templateAtom) && (aTag != nsXULAtoms::box) && (aTag != nsXULAtoms::hbox) && (aTag != nsXULAtoms::vbox) && (aTag != nsXULAtoms::stack) && (aTag != nsXULAtoms::spring); diff --git a/mozilla/content/xul/content/src/nsXULPopupListener.cpp b/mozilla/content/xul/content/src/nsXULPopupListener.cpp index 92ae99aa62e..f46c4d1784c 100644 --- a/mozilla/content/xul/content/src/nsXULPopupListener.cpp +++ b/mozilla/content/xul/content/src/nsXULPopupListener.cpp @@ -56,7 +56,7 @@ #include "nsIDOMEventTarget.h" #include "nsIBoxObject.h" -#include "nsIPopupSetBoxObject.h" +#include "nsIPopupBoxObject.h" #include "nsIMenuBoxObject.h" // for event firing in context menus @@ -613,15 +613,13 @@ XULPopupListenerImpl :: ClosePopup ( ) } if ( mPopupContent ) { - nsCOMPtr parent; - mPopupContent->GetParentNode(getter_AddRefs(parent)); - nsCOMPtr popupSetElement(do_QueryInterface(parent)); + nsCOMPtr popupElement(do_QueryInterface(mPopupContent)); nsCOMPtr boxObject; - if (popupSetElement) - popupSetElement->GetBoxObject(getter_AddRefs(boxObject)); - nsCOMPtr popupSetObject(do_QueryInterface(boxObject)); - if (popupSetObject) - popupSetObject->DestroyPopup(); + if (popupElement) + popupElement->GetBoxObject(getter_AddRefs(boxObject)); + nsCOMPtr popupObject(do_QueryInterface(boxObject)); + if (popupObject) + popupObject->HidePopup(); mPopupContent = nsnull; // release the popup @@ -791,8 +789,12 @@ XULPopupListenerImpl::LaunchPopup(PRInt32 aClientX, PRInt32 aClientY) nsAutoString identifier; mElement->GetAttribute(type, identifier); - if (identifier.IsEmpty()) - return rv; + if (identifier.IsEmpty()) { + if (type.EqualsIgnoreCase("popup")) + mElement->GetAttribute(NS_LITERAL_STRING("menu"), identifier); + if (identifier.IsEmpty()) + return rv; + } // Try to find the popup content and the document. We don't use FindDocumentForNode() // in this case because we need the nsIDocument interface anyway for the script @@ -815,18 +817,17 @@ XULPopupListenerImpl::LaunchPopup(PRInt32 aClientX, PRInt32 aClientY) nsCOMPtr popupContent; if (identifier == NS_LITERAL_STRING("_child")) { - nsCOMPtr popupset; nsCOMPtr popup; - GetImmediateChild(content, nsXULAtoms::popupset, getter_AddRefs(popupset)); - if (popupset) { - GetImmediateChild(popupset, nsXULAtoms::popup, getter_AddRefs(popup)); - if (popup) - popupContent = do_QueryInterface(popup); - } else { + + nsIAtom* tag = (popupType == eXULPopupType_tooltip) ? nsXULAtoms::tooltip : nsXULAtoms::menupopup; + + GetImmediateChild(content, tag, getter_AddRefs(popup)); + if (popup) + popupContent = do_QueryInterface(popup); + else { nsCOMPtr nsDoc(do_QueryInterface(xulDocument)); - nsCOMPtr xulElement(do_QueryInterface(content)); nsCOMPtr list; - nsDoc->GetAnonymousNodes(xulElement, getter_AddRefs(list)); + nsDoc->GetAnonymousNodes(mElement, getter_AddRefs(list)); if (list) { PRUint32 ctr,listLength; nsCOMPtr node; @@ -836,10 +837,8 @@ XULPopupListenerImpl::LaunchPopup(PRInt32 aClientX, PRInt32 aClientY) nsCOMPtr childContent(do_QueryInterface(node)); nsCOMPtr childTag; childContent->GetTag(*getter_AddRefs(childTag)); - if (childTag.get() == nsXULAtoms::popupset) { - GetImmediateChild(childContent, nsXULAtoms::popup, getter_AddRefs(popup)); - if (popup) - popupContent = do_QueryInterface(popup); + if (childTag.get() == tag) { + popupContent = do_QueryInterface(childContent); break; } } @@ -879,20 +878,14 @@ XULPopupListenerImpl::LaunchPopup(PRInt32 aClientX, PRInt32 aClientY) if (!anchorAlignment.IsEmpty() && !popupAlignment.IsEmpty()) xPos = yPos = -1; - nsCOMPtr parent; - mPopupContent->GetParentNode(getter_AddRefs(parent)); - nsCOMPtr popupSetElement(do_QueryInterface(parent)); - nsCOMPtr boxObject; - if (popupSetElement) - popupSetElement->GetBoxObject(getter_AddRefs(boxObject)); - nsCOMPtr popupSetObject(do_QueryInterface(boxObject)); - nsCOMPtr menuObject(do_QueryInterface(boxObject)); - if (popupSetObject) - popupSetObject->CreatePopup(mElement, mPopupContent, xPos, yPos, - type.get(), anchorAlignment.get(), - popupAlignment.get()); - else if (menuObject) - menuObject->OpenMenu(PR_TRUE); + nsCOMPtr popupBox; + nsCOMPtr xulPopupElt(do_QueryInterface(mPopupContent)); + xulPopupElt->GetBoxObject(getter_AddRefs(popupBox)); + nsCOMPtr popupBoxObject(do_QueryInterface(popupBox)); + if (popupBoxObject) + popupBoxObject->ShowPopup(mElement, mPopupContent, xPos, yPos, + type.get(), anchorAlignment.get(), + popupAlignment.get()); } } } diff --git a/mozilla/content/xul/document/src/nsXULDocument.cpp b/mozilla/content/xul/document/src/nsXULDocument.cpp index c2080ef7c5b..4d4f506153d 100644 --- a/mozilla/content/xul/document/src/nsXULDocument.cpp +++ b/mozilla/content/xul/document/src/nsXULDocument.cpp @@ -6580,8 +6580,9 @@ nsXULDocument::GetBoxObjectFor(nsIDOMElement* aElement, nsIBoxObject** aResult) contractID += "-iframe"; else if (tag.get() == nsXULAtoms::menu) contractID += "-menu"; - else if (tag.get() == nsXULAtoms::popupset) - contractID += "-popupset"; + else if (tag.get() == nsXULAtoms::popup || tag.get() == nsXULAtoms::menupopup || + tag.get() == nsXULAtoms::tooltip) + contractID += "-popup"; else if (tag.get() == nsXULAtoms::tree) contractID += "-tree"; else if (tag.get() == nsXULAtoms::scrollbox) diff --git a/mozilla/extensions/wallet/editor/WalletViewer.xul b/mozilla/extensions/wallet/editor/WalletViewer.xul index 7d3753f04a5..da509e0d25d 100644 --- a/mozilla/extensions/wallet/editor/WalletViewer.xul +++ b/mozilla/extensions/wallet/editor/WalletViewer.xul @@ -55,16 +55,16 @@