зеркало из https://github.com/mozilla/pjs.git
Getting rid of createPopup on the DOM window.
This commit is contained in:
Родитель
c957dfa387
Коммит
519b52041d
|
@ -30,7 +30,6 @@
|
|||
#include "jsapi.h"
|
||||
|
||||
class nsIDOMNavigator;
|
||||
class nsIDOMElement;
|
||||
class nsIDOMDocument;
|
||||
class nsIDOMBarProp;
|
||||
class nsIDOMScreen;
|
||||
|
@ -184,8 +183,6 @@ public:
|
|||
|
||||
NS_IMETHOD DisableExternalCapture()=0;
|
||||
|
||||
NS_IMETHOD CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent, PRInt32 aXPos, PRInt32 aYPos, const nsString& aPopupType, const nsString& aAnchorAlignment, const nsString& aPopupAlignment, nsIDOMWindow** aReturn)=0;
|
||||
|
||||
NS_IMETHOD Open(JSContext* cx, jsval* argv, PRUint32 argc, nsIDOMWindow** aReturn)=0;
|
||||
|
||||
NS_IMETHOD OpenDialog(JSContext* cx, jsval* argv, PRUint32 argc, nsIDOMWindow** aReturn)=0;
|
||||
|
@ -275,7 +272,6 @@ public:
|
|||
NS_IMETHOD RouteEvent(nsIDOMEvent* aEvt); \
|
||||
NS_IMETHOD EnableExternalCapture(); \
|
||||
NS_IMETHOD DisableExternalCapture(); \
|
||||
NS_IMETHOD CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent, PRInt32 aXPos, PRInt32 aYPos, const nsString& aPopupType, const nsString& aAnchorAlignment, const nsString& aPopupAlignment, nsIDOMWindow** aReturn); \
|
||||
NS_IMETHOD Open(JSContext* cx, jsval* argv, PRUint32 argc, nsIDOMWindow** aReturn); \
|
||||
NS_IMETHOD OpenDialog(JSContext* cx, jsval* argv, PRUint32 argc, nsIDOMWindow** aReturn); \
|
||||
NS_IMETHOD Close(); \
|
||||
|
@ -360,7 +356,6 @@ public:
|
|||
NS_IMETHOD RouteEvent(nsIDOMEvent* aEvt) { return _to RouteEvent(aEvt); } \
|
||||
NS_IMETHOD EnableExternalCapture() { return _to EnableExternalCapture(); } \
|
||||
NS_IMETHOD DisableExternalCapture() { return _to DisableExternalCapture(); } \
|
||||
NS_IMETHOD CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent, PRInt32 aXPos, PRInt32 aYPos, const nsString& aPopupType, const nsString& aAnchorAlignment, const nsString& aPopupAlignment, nsIDOMWindow** aReturn) { return _to CreatePopup(aElement, aPopupContent, aXPos, aYPos, aPopupType, aAnchorAlignment, aPopupAlignment, aReturn); } \
|
||||
NS_IMETHOD Open(JSContext* cx, jsval* argv, PRUint32 argc, nsIDOMWindow** aReturn) { return _to Open(cx, argv, argc, aReturn); } \
|
||||
NS_IMETHOD OpenDialog(JSContext* cx, jsval* argv, PRUint32 argc, nsIDOMWindow** aReturn) { return _to OpenDialog(cx, argv, argc, aReturn); } \
|
||||
NS_IMETHOD Close() { return _to Close(); } \
|
||||
|
|
|
@ -68,11 +68,6 @@
|
|||
void enableExternalCapture();
|
||||
void disableExternalCapture();
|
||||
|
||||
Window createPopup(in Element element, in Element popupContent,
|
||||
in long xPos, in long yPos,
|
||||
in DOMString popupType, in DOMString anchorAlignment,
|
||||
in DOMString popupAlignment);
|
||||
|
||||
Window open(/* ... */);
|
||||
Window openDialog(/* ... */);
|
||||
noscript void close();
|
||||
|
|
|
@ -811,7 +811,6 @@ enum nsDOMProp {
|
|||
NS_DOM_PROP_WINDOW_CONFIRM,
|
||||
NS_DOM_PROP_WINDOW_CONTENT,
|
||||
NS_DOM_PROP_WINDOW_CONTROLLERS,
|
||||
NS_DOM_PROP_WINDOW_CREATEPOPUP,
|
||||
NS_DOM_PROP_WINDOW_DEFAULTSTATUS,
|
||||
NS_DOM_PROP_WINDOW_DIRECTORIES,
|
||||
NS_DOM_PROP_WINDOW_DISABLEEXTERNALCAPTURE,
|
||||
|
|
|
@ -810,7 +810,6 @@
|
|||
"window.confirm", \
|
||||
"window.content", \
|
||||
"window.controllers", \
|
||||
"window.createpopup", \
|
||||
"window.defaultstatus", \
|
||||
"window.directories", \
|
||||
"window.disableexternalcapture", \
|
||||
|
|
|
@ -2904,24 +2904,6 @@ GlobalWindowImpl::WebShellToDOMWindow(nsIWebShell *aWebShell, nsIDOMWindow **aDO
|
|||
return CallQueryInterface(globalObject.get(), aDOMWindow);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
GlobalWindowImpl::CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent,
|
||||
PRInt32 aXPos, PRInt32 aYPos,
|
||||
const nsString& aPopupType,
|
||||
const nsString& anAnchorAlignment, const nsString& aPopupAlignment,
|
||||
nsIDOMWindow** outPopup)
|
||||
{
|
||||
if (nsnull != mWebShell) {
|
||||
// Pass this off to the parent.
|
||||
nsCOMPtr<nsIWebShellContainer> webShellContainer = do_QueryInterface(mWebShell);
|
||||
if (webShellContainer) {
|
||||
webShellContainer->CreatePopup(aElement, aPopupContent, aXPos, aYPos, aPopupType,
|
||||
anAnchorAlignment, aPopupAlignment, this, outPopup);
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
GlobalWindowImpl::CheckWindowName(JSContext *cx, nsString& aName)
|
||||
{
|
||||
|
|
|
@ -194,10 +194,6 @@ public:
|
|||
NS_IMETHOD EnableExternalCapture();
|
||||
NS_IMETHOD DisableExternalCapture();
|
||||
|
||||
NS_IMETHOD CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent,
|
||||
PRInt32 aXPos, PRInt32 aYPos,
|
||||
const nsString& aPopupType, const nsString& anAnchorAlignment,
|
||||
const nsString& aPopupAlignment, nsIDOMWindow** outPopup);
|
||||
NS_IMETHOD GetControllers(nsIControllers** aResult);
|
||||
|
||||
// nsIDOMEventReceiver interface
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "nsDOMPropEnums.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIDOMNavigator.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMBarProp.h"
|
||||
#include "nsIDOMAbstractView.h"
|
||||
|
@ -53,7 +52,6 @@ static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID);
|
|||
static NS_DEFINE_IID(kIJSScriptObjectIID, NS_IJSSCRIPTOBJECT_IID);
|
||||
static NS_DEFINE_IID(kIScriptGlobalObjectIID, NS_ISCRIPTGLOBALOBJECT_IID);
|
||||
static NS_DEFINE_IID(kINavigatorIID, NS_IDOMNAVIGATOR_IID);
|
||||
static NS_DEFINE_IID(kIElementIID, NS_IDOMELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDocumentIID, NS_IDOMDOCUMENT_IID);
|
||||
static NS_DEFINE_IID(kIBarPropIID, NS_IDOMBARPROP_IID);
|
||||
static NS_DEFINE_IID(kIAbstractViewIID, NS_IDOMABSTRACTVIEW_IID);
|
||||
|
@ -2449,85 +2447,6 @@ WindowDisableExternalCapture(JSContext *cx, JSObject *obj, uintN argc, jsval *ar
|
|||
}
|
||||
|
||||
|
||||
//
|
||||
// Native method CreatePopup
|
||||
//
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
WindowCreatePopup(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
nsresult result = NS_OK;
|
||||
nsIDOMWindow* nativeRet;
|
||||
nsCOMPtr<nsIDOMElement> b0;
|
||||
nsCOMPtr<nsIDOMElement> b1;
|
||||
PRInt32 b2;
|
||||
PRInt32 b3;
|
||||
nsAutoString b4;
|
||||
nsAutoString b5;
|
||||
nsAutoString b6;
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
{
|
||||
PRBool ok;
|
||||
nsresult rv;
|
||||
NS_WITH_SERVICE(nsIScriptSecurityManager, secMan,
|
||||
NS_SCRIPTSECURITYMANAGER_PROGID, &rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_SECMAN_ERR);
|
||||
}
|
||||
secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_CREATEPOPUP, PR_FALSE, &ok);
|
||||
if (!ok) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_SECURITY_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
if (argc < 7) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_TOO_FEW_PARAMETERS_ERR);
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kIElementIID,
|
||||
"Element",
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
}
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b1),
|
||||
kIElementIID,
|
||||
"Element",
|
||||
cx,
|
||||
argv[1])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
}
|
||||
if (!JS_ValueToInt32(cx, argv[2], (int32 *)&b2)) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_NUMBER_ERR);
|
||||
}
|
||||
if (!JS_ValueToInt32(cx, argv[3], (int32 *)&b3)) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_NUMBER_ERR);
|
||||
}
|
||||
nsJSUtils::nsConvertJSValToString(b4, cx, argv[4]);
|
||||
nsJSUtils::nsConvertJSValToString(b5, cx, argv[5]);
|
||||
nsJSUtils::nsConvertJSValToString(b6, cx, argv[6]);
|
||||
|
||||
result = nativeThis->CreatePopup(b0, b1, b2, b3, b4, b5, b6, &nativeRet);
|
||||
if (NS_FAILED(result)) {
|
||||
return nsJSUtils::nsReportError(cx, obj, result);
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, obj, rval);
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Native method Open
|
||||
//
|
||||
|
@ -2990,7 +2909,6 @@ static JSFunctionSpec WindowMethods[] =
|
|||
{"routeEvent", WindowRouteEvent, 1},
|
||||
{"enableExternalCapture", WindowEnableExternalCapture, 0},
|
||||
{"disableExternalCapture", WindowDisableExternalCapture, 0},
|
||||
{"createPopup", WindowCreatePopup, 7},
|
||||
{"open", WindowOpen, 0},
|
||||
{"openDialog", WindowOpenDialog, 0},
|
||||
{"close", WindowClose, 0},
|
||||
|
|
Загрузка…
Ссылка в новой задаче