зеркало из https://github.com/mozilla/pjs.git
Added an arg to createPopup.
This commit is contained in:
Родитель
c562d45ee1
Коммит
c575f00e29
|
@ -243,7 +243,8 @@ public:
|
|||
NS_IMETHOD ContentShellAdded(nsIWebShell* aChildShell, nsIContent* frameNode);
|
||||
NS_IMETHOD CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent,
|
||||
PRInt32 aXPos, PRInt32 aYPos,
|
||||
const nsString& aPopupType, const nsString& aPopupAlignment);
|
||||
const nsString& aPopupType, const nsString& aPopupAlignment,
|
||||
nsIDOMWindow* aWindow);
|
||||
NS_IMETHOD FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aResult);
|
||||
NS_IMETHOD FocusAvailable(nsIWebShell* aFocusedWebShell, PRBool& aFocusTaken);
|
||||
|
||||
|
@ -1921,10 +1922,12 @@ nsWebShell::ContentShellAdded(nsIWebShell* aChildShell, nsIContent* frameNode)
|
|||
NS_IMETHODIMP
|
||||
nsWebShell::CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent,
|
||||
PRInt32 aXPos, PRInt32 aYPos,
|
||||
const nsString& aPopupType, const nsString& aPopupAlignment)
|
||||
const nsString& aPopupType, const nsString& aPopupAlignment,
|
||||
nsIDOMWindow* aWindow)
|
||||
{
|
||||
if (nsnull != mContainer) {
|
||||
return mContainer->CreatePopup(aElement, aPopupContent, aXPos, aYPos, aPopupType, aPopupAlignment);
|
||||
return mContainer->CreatePopup(aElement, aPopupContent, aXPos, aYPos, aPopupType, aPopupAlignment,
|
||||
aWindow);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -266,7 +266,8 @@ CWebShellContainer::ContentShellAdded(nsIWebShell* aWebShell, nsIContent* frameN
|
|||
NS_IMETHODIMP
|
||||
CWebShellContainer::CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent,
|
||||
PRInt32 aXPos, PRInt32 aYPos,
|
||||
const nsString& aPopupType, const nsString& aPopupAlignment)
|
||||
const nsString& aPopupType, const nsString& aPopupAlignment,
|
||||
nsIDOMWindow* aWindow)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -57,7 +57,8 @@ public:
|
|||
NS_IMETHOD ContentShellAdded(nsIWebShell* aWebShell, nsIContent* frameNode);
|
||||
NS_IMETHOD CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent,
|
||||
PRInt32 aXPos, PRInt32 aYPos,
|
||||
const nsString& aPopupType, const nsString& aPopupAlignment);
|
||||
const nsString& aPopupType, const nsString& aPopupAlignment,
|
||||
nsIDOMWindow* aWindow);
|
||||
|
||||
// nsIStreamObserver
|
||||
NS_IMETHOD OnStartBinding(nsIURL* aURL, const char *aContentType);
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "nsIScrollableView.h"
|
||||
|
||||
class nsIDOMElement;
|
||||
class nsIDOMWindow;
|
||||
class nsIFactory;
|
||||
class nsIPostData;
|
||||
class nsIStreamObserver;
|
||||
|
@ -101,7 +102,8 @@ public:
|
|||
|
||||
NS_IMETHOD CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent,
|
||||
PRInt32 aXPos, PRInt32 aYPos,
|
||||
const nsString& aPopupType, const nsString& aPopupAlignment) = 0;
|
||||
const nsString& aPopupType, const nsString& aPopupAlignment,
|
||||
nsIDOMWindow* aWindow) = 0;
|
||||
|
||||
/**
|
||||
* Notify the WebShellContainer that a contained webshell is
|
||||
|
|
|
@ -243,7 +243,8 @@ public:
|
|||
NS_IMETHOD ContentShellAdded(nsIWebShell* aChildShell, nsIContent* frameNode);
|
||||
NS_IMETHOD CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent,
|
||||
PRInt32 aXPos, PRInt32 aYPos,
|
||||
const nsString& aPopupType, const nsString& aPopupAlignment);
|
||||
const nsString& aPopupType, const nsString& aPopupAlignment,
|
||||
nsIDOMWindow* aWindow);
|
||||
NS_IMETHOD FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aResult);
|
||||
NS_IMETHOD FocusAvailable(nsIWebShell* aFocusedWebShell, PRBool& aFocusTaken);
|
||||
|
||||
|
@ -1921,10 +1922,12 @@ nsWebShell::ContentShellAdded(nsIWebShell* aChildShell, nsIContent* frameNode)
|
|||
NS_IMETHODIMP
|
||||
nsWebShell::CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent,
|
||||
PRInt32 aXPos, PRInt32 aYPos,
|
||||
const nsString& aPopupType, const nsString& aPopupAlignment)
|
||||
const nsString& aPopupType, const nsString& aPopupAlignment,
|
||||
nsIDOMWindow* aWindow)
|
||||
{
|
||||
if (nsnull != mContainer) {
|
||||
return mContainer->CreatePopup(aElement, aPopupContent, aXPos, aYPos, aPopupType, aPopupAlignment);
|
||||
return mContainer->CreatePopup(aElement, aPopupContent, aXPos, aYPos, aPopupType, aPopupAlignment,
|
||||
aWindow);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -1790,7 +1790,8 @@ nsBrowserWindow::ContentShellAdded(nsIWebShell* aChildShell, nsIContent* frameNo
|
|||
NS_IMETHODIMP
|
||||
nsBrowserWindow::CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent,
|
||||
PRInt32 aXPos, PRInt32 aYPos,
|
||||
const nsString& aPopupType, const nsString& aPopupAlignment)
|
||||
const nsString& aPopupType, const nsString& aPopupAlignment,
|
||||
nsIDOMWindow* aWindow)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -112,7 +112,8 @@ public:
|
|||
NS_IMETHOD ContentShellAdded(nsIWebShell* aChildShell, nsIContent* frameNode);
|
||||
NS_IMETHOD CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent,
|
||||
PRInt32 aXPos, PRInt32 aYPos,
|
||||
const nsString& aPopupType, const nsString& aPopupAlignment);
|
||||
const nsString& aPopupType, const nsString& aPopupAlignment,
|
||||
nsIDOMWindow* aWindow);
|
||||
NS_IMETHOD FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aResult);
|
||||
NS_IMETHOD FocusAvailable(nsIWebShell* aFocusedWebShell, PRBool& aFocusTaken);
|
||||
|
||||
|
|
|
@ -570,7 +570,8 @@ nsXPBaseWindow::ContentShellAdded(nsIWebShell* aChildShell, nsIContent* frameNod
|
|||
NS_IMETHODIMP
|
||||
nsXPBaseWindow::CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent,
|
||||
PRInt32 aXPos, PRInt32 aYPos,
|
||||
const nsString& aPopupType, const nsString& aPopupAlignment)
|
||||
const nsString& aPopupType, const nsString& aPopupAlignment,
|
||||
nsIDOMWindow* aWindow)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -100,7 +100,8 @@ public:
|
|||
NS_IMETHOD ContentShellAdded(nsIWebShell* aChildShell, nsIContent* frameNode);
|
||||
NS_IMETHOD CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent,
|
||||
PRInt32 aXPos, PRInt32 aYPos,
|
||||
const nsString& aPopupType, const nsString& aPopupAlignment);
|
||||
const nsString& aPopupType, const nsString& aPopupAlignment,
|
||||
nsIDOMWindow* aWindow);
|
||||
NS_IMETHOD FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aResult);
|
||||
NS_IMETHOD FocusAvailable(nsIWebShell* aFocusedWebShell, PRBool& aFocusTaken);
|
||||
|
||||
|
|
|
@ -932,7 +932,8 @@ nsWebShellWindow::ConvertWebShellToDOMWindow(nsIWebShell* aShell, nsIDOMWindow**
|
|||
NS_IMETHODIMP
|
||||
nsWebShellWindow::CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent,
|
||||
PRInt32 aXPos, PRInt32 aYPos,
|
||||
const nsString& aPopupType, const nsString& aPopupAlignment)
|
||||
const nsString& aPopupType, const nsString& aPopupAlignment,
|
||||
nsIDOMWindow* aWindow)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
|
@ -950,9 +951,8 @@ nsWebShellWindow::CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupCont
|
|||
nsCOMPtr<nsIDOMNode> menuItem;
|
||||
menuNodes->Item(0, getter_AddRefs(menuItem));
|
||||
if (menuItem) {
|
||||
//nsCOMPtr<nsIDOMElement> menuElement = do_QueryInterface(menuItem);
|
||||
|
||||
// XXX Call the context menu creation method
|
||||
|
||||
// XXX Need to distinguish between popup menus and context menus?
|
||||
DoContextMenu(
|
||||
nsnull,
|
||||
menuItem,
|
||||
|
@ -968,9 +968,28 @@ nsWebShellWindow::CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupCont
|
|||
|
||||
// (1) Create a top-level chromeless window. The size of the window can be specified
|
||||
// on the window tag contained inside. Retrieve the webshell from the new nsWebShellWindow.
|
||||
NS_WITH_SERVICE(nsIAppShellService, appShell, kAppShellServiceCID, &rv);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
nsCOMPtr<nsIWebShellWindow> newWindow;
|
||||
appShell->CreateTopLevelWindow(nsnull, nsnull, PR_FALSE, *getter_AddRefs(newWindow),
|
||||
nsnull, nsnull, 200, 300);
|
||||
// Move the window to aXPos and aYPos
|
||||
nsCOMPtr<nsIBrowserWindow> browserWindow = do_QueryInterface(newWindow);
|
||||
browserWindow->MoveTo(aXPos, aYPos);
|
||||
|
||||
// Get the webshell
|
||||
nsCOMPtr<nsIWebShell> newShell;
|
||||
newWindow->GetWebShell(*getter_AddRefs(newShell));
|
||||
|
||||
// (2) Set the opener property to link the popup to the parent.
|
||||
|
||||
nsCOMPtr<nsIDOMWindow> domWindow;
|
||||
if (NS_FAILED(rv = ConvertWebShellToDOMWindow(newShell, getter_AddRefs(domWindow)))) {
|
||||
NS_ERROR("Unable to retrieve the DOM window from the new web shell.");
|
||||
return rv;
|
||||
}
|
||||
|
||||
// (3) We need to create a new document that clones the original document's popup
|
||||
// content. This new document must use the different root and a different global script
|
||||
// context (window object) but everything else about it is the same (namespaces, URLs,
|
||||
|
@ -996,7 +1015,7 @@ nsWebShellWindow::CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupCont
|
|||
// (10) Show the window, and give the window the focus.
|
||||
|
||||
// (11) Return the new popup object.
|
||||
|
||||
|
||||
// (12) Perform cleanup
|
||||
|
||||
return rv;
|
||||
|
|
|
@ -86,7 +86,8 @@ public:
|
|||
|
||||
NS_IMETHOD CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent,
|
||||
PRInt32 aXPos, PRInt32 aYPos,
|
||||
const nsString& aPopupType, const nsString& aPopupAlignment);
|
||||
const nsString& aPopupType, const nsString& aPopupAlignment,
|
||||
nsIDOMWindow* aWindow);
|
||||
|
||||
NS_IMETHOD ContentShellAdded(nsIWebShell* aChildShell, nsIContent* frameNode);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче