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