diff --git a/content/xul/content/public/nsIXULPopupListener.h b/content/xul/content/public/nsIXULPopupListener.h index c3030d68542..2cd0125a7ac 100644 --- a/content/xul/content/public/nsIXULPopupListener.h +++ b/content/xul/content/public/nsIXULPopupListener.h @@ -28,7 +28,8 @@ class nsIDOMElement; typedef enum { eXULPopupType_popup, eXULPopupType_context, - eXULPopupType_tooltip + eXULPopupType_tooltip, + eXULPopupType_blur } XULPopupType; class nsIXULPopupListener: public nsISupports { diff --git a/content/xul/content/src/nsXULPopupListener.cpp b/content/xul/content/src/nsXULPopupListener.cpp index 97095aa96ec..dff43fb8ca8 100644 --- a/content/xul/content/src/nsXULPopupListener.cpp +++ b/content/xul/content/src/nsXULPopupListener.cpp @@ -137,9 +137,9 @@ XULPopupListenerImpl::QueryInterface(REFNSIID iid, void** result) NS_IMETHODIMP XULPopupListenerImpl::Init(nsIDOMElement* aElement, const XULPopupType& popup) { - element = aElement; // Weak reference. Don't addref it. - popupType = popup; - return NS_OK; + element = aElement; // Weak reference. Don't addref it. + popupType = popup; + return NS_OK; } //////////////////////////////////////////////////////////////// @@ -252,7 +252,7 @@ XULPopupListenerImpl::LaunchPopup(nsIDOMEvent* anEvent) domWindow->CreateAnchoredPopup(element, popupContent, anchorAlignment, type, popupAlignment); } - xulDocument->SetPopup(nsnull); + xulDocument->SetPopup(nsnull); } NS_RELEASE(global); } diff --git a/content/xul/document/src/nsXULDocument.cpp b/content/xul/document/src/nsXULDocument.cpp index 74215bb0134..d1b9fa2399c 100644 --- a/content/xul/document/src/nsXULDocument.cpp +++ b/content/xul/document/src/nsXULDocument.cpp @@ -2995,22 +2995,11 @@ XULDocumentImpl::CreatePopupDocument(nsIContent* aPopupElement, nsIDocument** aR NS_IF_ADDREF(mPopup); popupDoc->mPopup = mPopup; - // Our root content is the first child of the popup - // node. - nsCOMPtr firstChild; - PRInt32 childCount; - aPopupElement->ChildCount(childCount); - if (childCount == 0) - return NS_OK; - - aPopupElement->ChildAt(0, *getter_AddRefs(firstChild)); - - // Our root is firstChild. Suck all of this - // content into our document. + // Suck all of the root's content into our document. // We need to make the XUL builder instantiate this node. // Retrieve the resource that corresponds to this node. nsAutoString idValue; - nsCOMPtr domRoot = do_QueryInterface(firstChild); + nsCOMPtr domRoot = do_QueryInterface(aPopupElement); domRoot->GetAttribute("id", idValue); const char* url; mDocumentURL->GetSpec(&url); diff --git a/rdf/content/public/nsIXULPopupListener.h b/rdf/content/public/nsIXULPopupListener.h index c3030d68542..2cd0125a7ac 100644 --- a/rdf/content/public/nsIXULPopupListener.h +++ b/rdf/content/public/nsIXULPopupListener.h @@ -28,7 +28,8 @@ class nsIDOMElement; typedef enum { eXULPopupType_popup, eXULPopupType_context, - eXULPopupType_tooltip + eXULPopupType_tooltip, + eXULPopupType_blur } XULPopupType; class nsIXULPopupListener: public nsISupports { diff --git a/rdf/content/src/nsXULDocument.cpp b/rdf/content/src/nsXULDocument.cpp index 74215bb0134..d1b9fa2399c 100644 --- a/rdf/content/src/nsXULDocument.cpp +++ b/rdf/content/src/nsXULDocument.cpp @@ -2995,22 +2995,11 @@ XULDocumentImpl::CreatePopupDocument(nsIContent* aPopupElement, nsIDocument** aR NS_IF_ADDREF(mPopup); popupDoc->mPopup = mPopup; - // Our root content is the first child of the popup - // node. - nsCOMPtr firstChild; - PRInt32 childCount; - aPopupElement->ChildCount(childCount); - if (childCount == 0) - return NS_OK; - - aPopupElement->ChildAt(0, *getter_AddRefs(firstChild)); - - // Our root is firstChild. Suck all of this - // content into our document. + // Suck all of the root's content into our document. // We need to make the XUL builder instantiate this node. // Retrieve the resource that corresponds to this node. nsAutoString idValue; - nsCOMPtr domRoot = do_QueryInterface(firstChild); + nsCOMPtr domRoot = do_QueryInterface(aPopupElement); domRoot->GetAttribute("id", idValue); const char* url; mDocumentURL->GetSpec(&url); diff --git a/rdf/content/src/nsXULPopupListener.cpp b/rdf/content/src/nsXULPopupListener.cpp index 97095aa96ec..dff43fb8ca8 100644 --- a/rdf/content/src/nsXULPopupListener.cpp +++ b/rdf/content/src/nsXULPopupListener.cpp @@ -137,9 +137,9 @@ XULPopupListenerImpl::QueryInterface(REFNSIID iid, void** result) NS_IMETHODIMP XULPopupListenerImpl::Init(nsIDOMElement* aElement, const XULPopupType& popup) { - element = aElement; // Weak reference. Don't addref it. - popupType = popup; - return NS_OK; + element = aElement; // Weak reference. Don't addref it. + popupType = popup; + return NS_OK; } //////////////////////////////////////////////////////////////// @@ -252,7 +252,7 @@ XULPopupListenerImpl::LaunchPopup(nsIDOMEvent* anEvent) domWindow->CreateAnchoredPopup(element, popupContent, anchorAlignment, type, popupAlignment); } - xulDocument->SetPopup(nsnull); + xulDocument->SetPopup(nsnull); } NS_RELEASE(global); }