From e7ff1ca15af351fb244a5aaba894f20ba877a819 Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Fri, 14 May 1999 23:11:49 +0000 Subject: [PATCH] Ready to rumble. git-svn-id: svn://10.0.0.236/trunk@31688 18797224-902f-48f8-a5cc-f745e15eee43 --- .../xpfe/appshell/src/nsWebShellWindow.cpp | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp index 9aecc5f18ce..5f9ca6619f5 100644 --- a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp +++ b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp @@ -934,7 +934,32 @@ nsWebShellWindow::CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupCont PRInt32 aXPos, PRInt32 aYPos, const nsString& aPopupType, const nsString& aPopupAlignment) { - return NS_OK; + nsresult rv = NS_OK; + + // Find out if we're a menu. + nsCOMPtr menuNodes; + if (NS_FAILED(rv = aElement->GetElementsByTagName("menu", getter_AddRefs(menuNodes)))) { + NS_ERROR("Error occurred looking for nodes."); + return rv; + } + + // We got something. + PRUint32 length; + menuNodes->GetLength(&length); + if (length > 0) { + nsCOMPtr menuItem; + menuNodes->Item(0, getter_AddRefs(menuItem)); + if (menuItem) { + nsCOMPtr menuElement = do_QueryInterface(menuItem); + + // XXX Call the context menu creation method + + } + return NS_OK; + } + + // XXX Handle the arbitrary popup XUL case. + return rv; } NS_IMETHODIMP