diff --git a/dom/src/base/nsJSDOMException.cpp b/dom/src/base/nsJSDOMException.cpp index 8dde55f26910..975f68f56820 100644 --- a/dom/src/base/nsJSDOMException.cpp +++ b/dom/src/base/nsJSDOMException.cpp @@ -241,7 +241,7 @@ DOMExceptionToString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_DOMEXCEPTION_TOSTRING,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_DOMEXCEPTION_TOSTRING, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/base/nsJSHistory.cpp b/dom/src/base/nsJSHistory.cpp index 1c028694b67a..023800859c81 100644 --- a/dom/src/base/nsJSHistory.cpp +++ b/dom/src/base/nsJSHistory.cpp @@ -240,7 +240,7 @@ HistoryBack(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HISTORY_BACK,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HISTORY_BACK, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -283,7 +283,7 @@ HistoryForward(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HISTORY_FORWARD,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HISTORY_FORWARD, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -326,7 +326,7 @@ HistoryGo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HISTORY_GO,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HISTORY_GO, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/base/nsJSLocation.cpp b/dom/src/base/nsJSLocation.cpp index a856d67aebde..5ea06efd4300 100644 --- a/dom/src/base/nsJSLocation.cpp +++ b/dom/src/base/nsJSLocation.cpp @@ -398,7 +398,7 @@ LocationToString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_LOCATION_TOSTRING,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_LOCATION_TOSTRING, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -429,8 +429,9 @@ LocationToString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r PR_STATIC_CALLBACK(JSBool) NSLocationReload(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMLocation *privateThis = (nsIDOMLocation*)nsJSUtils::nsGetNativeThis(cx, obj); - nsIDOMNSLocation *nativeThis = nsnull; + nsIDOMLocationPtr nativeThis = nsnull; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kILocationIID, (void **)&nativeThis)) { nsresult result = NS_OK; if (NS_OK != privateThis->QueryInterface(kINSLocationIID, (void **)&nativeThis)) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR); @@ -446,7 +447,7 @@ NSLocationReload(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NSLOCATION_RELOAD,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NSLOCATION_RELOAD, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -477,8 +478,9 @@ NSLocationReload(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r PR_STATIC_CALLBACK(JSBool) NSLocationReplace(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMLocation *privateThis = (nsIDOMLocation*)nsJSUtils::nsGetNativeThis(cx, obj); - nsIDOMNSLocation *nativeThis = nsnull; + nsIDOMLocationPtr nativeThis = nsnull; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kILocationIID, (void **)&nativeThis)) { nsresult result = NS_OK; if (NS_OK != privateThis->QueryInterface(kINSLocationIID, (void **)&nativeThis)) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR); @@ -494,7 +496,7 @@ NSLocationReplace(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval * } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NSLOCATION_REPLACE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NSLOCATION_REPLACE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/base/nsJSMimeTypeArray.cpp b/dom/src/base/nsJSMimeTypeArray.cpp index 280b968f0c20..880d2e08a017 100644 --- a/dom/src/base/nsJSMimeTypeArray.cpp +++ b/dom/src/base/nsJSMimeTypeArray.cpp @@ -231,7 +231,7 @@ MimeTypeArrayItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval * } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_MIMETYPEARRAY_ITEM,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_MIMETYPEARRAY_ITEM, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -283,7 +283,7 @@ MimeTypeArrayNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_MIMETYPEARRAY_NAMEDITEM,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_MIMETYPEARRAY_NAMEDITEM, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/base/nsJSNavigator.cpp b/dom/src/base/nsJSNavigator.cpp index 8025354ee603..6069c8624a22 100644 --- a/dom/src/base/nsJSNavigator.cpp +++ b/dom/src/base/nsJSNavigator.cpp @@ -344,7 +344,7 @@ NavigatorJavaEnabled(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NAVIGATOR_JAVAENABLED,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NAVIGATOR_JAVAENABLED, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -388,7 +388,7 @@ NavigatorTaintEnabled(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NAVIGATOR_TAINTENABLED,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NAVIGATOR_TAINTENABLED, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -432,7 +432,7 @@ NavigatorPreference(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NAVIGATOR_PREFERENCE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NAVIGATOR_PREFERENCE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/base/nsJSPlugin.cpp b/dom/src/base/nsJSPlugin.cpp index 2b43e46f714f..ac19ecacea1a 100644 --- a/dom/src/base/nsJSPlugin.cpp +++ b/dom/src/base/nsJSPlugin.cpp @@ -288,7 +288,7 @@ PluginItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_PLUGIN_ITEM,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_PLUGIN_ITEM, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -340,7 +340,7 @@ PluginNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_PLUGIN_NAMEDITEM,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_PLUGIN_NAMEDITEM, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/base/nsJSPluginArray.cpp b/dom/src/base/nsJSPluginArray.cpp index a78e6297a847..d6d4267f48ec 100644 --- a/dom/src/base/nsJSPluginArray.cpp +++ b/dom/src/base/nsJSPluginArray.cpp @@ -231,7 +231,7 @@ PluginArrayItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_PLUGINARRAY_ITEM,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_PLUGINARRAY_ITEM, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -283,7 +283,7 @@ PluginArrayNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_PLUGINARRAY_NAMEDITEM,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_PLUGINARRAY_NAMEDITEM, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -332,7 +332,7 @@ PluginArrayRefresh(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_PLUGINARRAY_REFRESH,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_PLUGINARRAY_REFRESH, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/base/nsJSWindow.cpp b/dom/src/base/nsJSWindow.cpp index 33391dd7d4a5..0598dc99438e 100644 --- a/dom/src/base/nsJSWindow.cpp +++ b/dom/src/base/nsJSWindow.cpp @@ -1066,7 +1066,7 @@ WindowDump(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_DUMP,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_DUMP, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -1114,7 +1114,7 @@ WindowAlert(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_ALERT,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_ALERT, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -1158,7 +1158,7 @@ WindowConfirm(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_CONFIRM,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_CONFIRM, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -1202,7 +1202,7 @@ WindowPrompt(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_PROMPT,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_PROMPT, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -1245,7 +1245,7 @@ WindowFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_FOCUS,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_FOCUS, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -1288,7 +1288,7 @@ WindowBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_BLUR,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_BLUR, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -1331,7 +1331,7 @@ WindowBack(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_BACK,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_BACK, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -1374,7 +1374,7 @@ WindowForward(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_FORWARD,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_FORWARD, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -1417,7 +1417,7 @@ WindowHome(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_HOME,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_HOME, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -1460,7 +1460,7 @@ WindowStop(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_STOP,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_STOP, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -1503,7 +1503,7 @@ WindowPrint(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_PRINT,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_PRINT, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -1548,7 +1548,7 @@ WindowMoveTo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_MOVETO,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_MOVETO, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -1603,7 +1603,7 @@ WindowMoveBy(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_MOVEBY,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_MOVEBY, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -1658,7 +1658,7 @@ WindowResizeTo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_RESIZETO,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_RESIZETO, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -1713,7 +1713,7 @@ WindowResizeBy(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_RESIZEBY,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_RESIZEBY, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -1766,7 +1766,7 @@ WindowSizeToContent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_SIZETOCONTENT,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_SIZETOCONTENT, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -1811,7 +1811,7 @@ WindowScroll(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_SCROLL,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_SCROLL, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -1866,7 +1866,7 @@ WindowScrollTo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_SCROLLTO,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_SCROLLTO, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -1921,7 +1921,7 @@ WindowScrollBy(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_SCROLLBY,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_SCROLLBY, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -1975,7 +1975,7 @@ WindowClearTimeout(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_CLEARTIMEOUT,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_CLEARTIMEOUT, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -2026,7 +2026,7 @@ WindowClearInterval(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_CLEARINTERVAL,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_CLEARINTERVAL, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -2077,7 +2077,7 @@ WindowSetTimeout(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_SETTIMEOUT,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_SETTIMEOUT, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -2121,7 +2121,7 @@ WindowSetInterval(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval * } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_SETINTERVAL,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_SETINTERVAL, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -2165,7 +2165,7 @@ WindowCaptureEvents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_CAPTUREEVENTS,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_CAPTUREEVENTS, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -2216,7 +2216,7 @@ WindowReleaseEvents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_RELEASEEVENTS,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_RELEASEEVENTS, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -2267,7 +2267,7 @@ WindowRouteEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_ROUTEEVENT,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_ROUTEEVENT, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -2321,7 +2321,7 @@ WindowEnableExternalCapture(JSContext *cx, JSObject *obj, uintN argc, jsval *arg } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_ENABLEEXTERNALCAPTURE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_ENABLEEXTERNALCAPTURE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -2364,7 +2364,7 @@ WindowDisableExternalCapture(JSContext *cx, JSObject *obj, uintN argc, jsval *ar } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_DISABLEEXTERNALCAPTURE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_DISABLEEXTERNALCAPTURE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -2415,7 +2415,7 @@ WindowCreatePopup(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval * } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_CREATEPOPUP,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_CREATEPOPUP, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -2486,7 +2486,7 @@ WindowOpen(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_OPEN,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_OPEN, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -2530,7 +2530,7 @@ WindowOpenDialog(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_OPENDIALOG,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_OPENDIALOG, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -2573,7 +2573,7 @@ WindowClose(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_CLOSE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOW_CLOSE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -2604,8 +2604,9 @@ WindowClose(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) PR_STATIC_CALLBACK(JSBool) EventTargetAddEventListener(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); - nsIDOMEventTarget *nativeThis = nsnull; + nsIDOMWindowPtr nativeThis = nsnull; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowIID, (void **)&nativeThis)) { nsresult result = NS_OK; if (NS_OK != privateThis->QueryInterface(kIEventTargetIID, (void **)&nativeThis)) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR); @@ -2624,7 +2625,7 @@ EventTargetAddEventListener(JSContext *cx, JSObject *obj, uintN argc, jsval *arg } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_EVENTTARGET_ADDEVENTLISTENER,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_EVENTTARGET_ADDEVENTLISTENER, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -2669,8 +2670,9 @@ EventTargetAddEventListener(JSContext *cx, JSObject *obj, uintN argc, jsval *arg PR_STATIC_CALLBACK(JSBool) EventTargetRemoveEventListener(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); - nsIDOMEventTarget *nativeThis = nsnull; + nsIDOMWindowPtr nativeThis = nsnull; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowIID, (void **)&nativeThis)) { nsresult result = NS_OK; if (NS_OK != privateThis->QueryInterface(kIEventTargetIID, (void **)&nativeThis)) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR); @@ -2689,7 +2691,7 @@ EventTargetRemoveEventListener(JSContext *cx, JSObject *obj, uintN argc, jsval * } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_EVENTTARGET_REMOVEEVENTLISTENER,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_EVENTTARGET_REMOVEEVENTLISTENER, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/base/nsJSWindowCollection.cpp b/dom/src/base/nsJSWindowCollection.cpp index 08ee70aea4fd..42708299c530 100644 --- a/dom/src/base/nsJSWindowCollection.cpp +++ b/dom/src/base/nsJSWindowCollection.cpp @@ -231,7 +231,7 @@ WindowCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOWCOLLECTION_ITEM,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOWCOLLECTION_ITEM, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -283,7 +283,7 @@ WindowCollectionNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOWCOLLECTION_NAMEDITEM,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_WINDOWCOLLECTION_NAMEDITEM, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/coreDOM/nsJSCharacterData.cpp b/dom/src/coreDOM/nsJSCharacterData.cpp index 5513369c7151..15ca20d14204 100644 --- a/dom/src/coreDOM/nsJSCharacterData.cpp +++ b/dom/src/coreDOM/nsJSCharacterData.cpp @@ -218,7 +218,7 @@ CharacterDataSubstringData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CHARACTERDATA_SUBSTRINGDATA,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CHARACTERDATA_SUBSTRINGDATA, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -272,7 +272,7 @@ CharacterDataAppendData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CHARACTERDATA_APPENDDATA,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CHARACTERDATA_APPENDDATA, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -322,7 +322,7 @@ CharacterDataInsertData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CHARACTERDATA_INSERTDATA,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CHARACTERDATA_INSERTDATA, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -375,7 +375,7 @@ CharacterDataDeleteData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CHARACTERDATA_DELETEDATA,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CHARACTERDATA_DELETEDATA, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -431,7 +431,7 @@ CharacterDataReplaceData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CHARACTERDATA_REPLACEDATA,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CHARACTERDATA_REPLACEDATA, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/coreDOM/nsJSDOMImplementation.cpp b/dom/src/coreDOM/nsJSDOMImplementation.cpp index 78d41075c79a..e1d352aae0de 100644 --- a/dom/src/coreDOM/nsJSDOMImplementation.cpp +++ b/dom/src/coreDOM/nsJSDOMImplementation.cpp @@ -163,7 +163,7 @@ DOMImplementationHasFeature(JSContext *cx, JSObject *obj, uintN argc, jsval *arg } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_DOMIMPLEMENTATION_HASFEATURE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_DOMIMPLEMENTATION_HASFEATURE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/coreDOM/nsJSDocument.cpp b/dom/src/coreDOM/nsJSDocument.cpp index 5672ffb7fb81..2c899c07d377 100644 --- a/dom/src/coreDOM/nsJSDocument.cpp +++ b/dom/src/coreDOM/nsJSDocument.cpp @@ -350,7 +350,7 @@ DocumentCreateElement(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_DOCUMENT_CREATEELEMENT,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_DOCUMENT_CREATEELEMENT, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -399,7 +399,7 @@ DocumentCreateDocumentFragment(JSContext *cx, JSObject *obj, uintN argc, jsval * } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_DOCUMENT_CREATEDOCUMENTFRAGMENT,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_DOCUMENT_CREATEDOCUMENTFRAGMENT, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -444,7 +444,7 @@ DocumentCreateTextNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_DOCUMENT_CREATETEXTNODE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_DOCUMENT_CREATETEXTNODE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -494,7 +494,7 @@ DocumentCreateComment(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_DOCUMENT_CREATECOMMENT,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_DOCUMENT_CREATECOMMENT, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -544,7 +544,7 @@ DocumentCreateCDATASection(JSContext *cx, JSObject *obj, uintN argc, jsval *argv } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_DOCUMENT_CREATECDATASECTION,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_DOCUMENT_CREATECDATASECTION, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -595,7 +595,7 @@ DocumentCreateProcessingInstruction(JSContext *cx, JSObject *obj, uintN argc, js } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_DOCUMENT_CREATEPROCESSINGINSTRUCTION,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_DOCUMENT_CREATEPROCESSINGINSTRUCTION, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -646,7 +646,7 @@ DocumentCreateAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_DOCUMENT_CREATEATTRIBUTE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_DOCUMENT_CREATEATTRIBUTE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -696,7 +696,7 @@ DocumentCreateEntityReference(JSContext *cx, JSObject *obj, uintN argc, jsval *a } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_DOCUMENT_CREATEENTITYREFERENCE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_DOCUMENT_CREATEENTITYREFERENCE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -746,7 +746,7 @@ DocumentGetElementsByTagName(JSContext *cx, JSObject *obj, uintN argc, jsval *ar } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_DOCUMENT_GETELEMENTSBYTAGNAME,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_DOCUMENT_GETELEMENTSBYTAGNAME, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -782,8 +782,9 @@ DocumentGetElementsByTagName(JSContext *cx, JSObject *obj, uintN argc, jsval *ar PR_STATIC_CALLBACK(JSBool) NSDocumentCreateElementWithNameSpace(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMDocument *privateThis = (nsIDOMDocument*)nsJSUtils::nsGetNativeThis(cx, obj); - nsIDOMNSDocument *nativeThis = nsnull; + nsIDOMDocumentPtr nativeThis = nsnull; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIDocumentIID, (void **)&nativeThis)) { nsresult result = NS_OK; if (NS_OK != privateThis->QueryInterface(kINSDocumentIID, (void **)&nativeThis)) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR); @@ -802,7 +803,7 @@ NSDocumentCreateElementWithNameSpace(JSContext *cx, JSObject *obj, uintN argc, j } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NSDOCUMENT_CREATEELEMENTWITHNAMESPACE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NSDOCUMENT_CREATEELEMENTWITHNAMESPACE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -839,8 +840,9 @@ NSDocumentCreateElementWithNameSpace(JSContext *cx, JSObject *obj, uintN argc, j PR_STATIC_CALLBACK(JSBool) NSDocumentCreateRange(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMDocument *privateThis = (nsIDOMDocument*)nsJSUtils::nsGetNativeThis(cx, obj); - nsIDOMNSDocument *nativeThis = nsnull; + nsIDOMDocumentPtr nativeThis = nsnull; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIDocumentIID, (void **)&nativeThis)) { nsresult result = NS_OK; if (NS_OK != privateThis->QueryInterface(kINSDocumentIID, (void **)&nativeThis)) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR); @@ -857,7 +859,7 @@ NSDocumentCreateRange(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NSDOCUMENT_CREATERANGE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NSDOCUMENT_CREATERANGE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/coreDOM/nsJSElement.cpp b/dom/src/coreDOM/nsJSElement.cpp index 34993f673238..d12e594de971 100644 --- a/dom/src/coreDOM/nsJSElement.cpp +++ b/dom/src/coreDOM/nsJSElement.cpp @@ -191,7 +191,7 @@ ElementGetAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_ELEMENT_GETATTRIBUTE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_ELEMENT_GETATTRIBUTE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -241,7 +241,7 @@ ElementSetAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_ELEMENT_SETATTRIBUTE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_ELEMENT_SETATTRIBUTE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -291,7 +291,7 @@ ElementRemoveAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_ELEMENT_REMOVEATTRIBUTE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_ELEMENT_REMOVEATTRIBUTE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -341,7 +341,7 @@ ElementGetAttributeNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_ELEMENT_GETATTRIBUTENODE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_ELEMENT_GETATTRIBUTENODE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -391,7 +391,7 @@ ElementSetAttributeNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_ELEMENT_SETATTRIBUTENODE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_ELEMENT_SETATTRIBUTENODE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -447,7 +447,7 @@ ElementRemoveAttributeNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_ELEMENT_REMOVEATTRIBUTENODE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_ELEMENT_REMOVEATTRIBUTENODE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -503,7 +503,7 @@ ElementGetElementsByTagName(JSContext *cx, JSObject *obj, uintN argc, jsval *arg } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_ELEMENT_GETELEMENTSBYTAGNAME,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_ELEMENT_GETELEMENTSBYTAGNAME, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -551,7 +551,7 @@ ElementNormalize(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_ELEMENT_NORMALIZE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_ELEMENT_NORMALIZE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/coreDOM/nsJSNamedNodeMap.cpp b/dom/src/coreDOM/nsJSNamedNodeMap.cpp index 6ffa7f0c0873..004be50bc54b 100644 --- a/dom/src/coreDOM/nsJSNamedNodeMap.cpp +++ b/dom/src/coreDOM/nsJSNamedNodeMap.cpp @@ -199,7 +199,7 @@ NamedNodeMapGetNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NAMEDNODEMAP_GETNAMEDITEM,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NAMEDNODEMAP_GETNAMEDITEM, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -249,7 +249,7 @@ NamedNodeMapSetNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NAMEDNODEMAP_SETNAMEDITEM,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NAMEDNODEMAP_SETNAMEDITEM, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -305,7 +305,7 @@ NamedNodeMapRemoveNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *arg } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NAMEDNODEMAP_REMOVENAMEDITEM,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NAMEDNODEMAP_REMOVENAMEDITEM, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -355,7 +355,7 @@ NamedNodeMapItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NAMEDNODEMAP_ITEM,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NAMEDNODEMAP_ITEM, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/coreDOM/nsJSNode.cpp b/dom/src/coreDOM/nsJSNode.cpp index e54df611464b..40494bd2412b 100644 --- a/dom/src/coreDOM/nsJSNode.cpp +++ b/dom/src/coreDOM/nsJSNode.cpp @@ -412,7 +412,7 @@ NodeInsertBefore(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NODE_INSERTBEFORE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NODE_INSERTBEFORE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -476,7 +476,7 @@ NodeReplaceChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NODE_REPLACECHILD,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NODE_REPLACECHILD, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -539,7 +539,7 @@ NodeRemoveChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NODE_REMOVECHILD,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NODE_REMOVECHILD, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -595,7 +595,7 @@ NodeAppendChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NODE_APPENDCHILD,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NODE_APPENDCHILD, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -650,7 +650,7 @@ NodeHasChildNodes(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval * } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NODE_HASCHILDNODES,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NODE_HASCHILDNODES, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -695,7 +695,7 @@ NodeCloneNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NODE_CLONENODE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NODE_CLONENODE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -733,8 +733,9 @@ NodeCloneNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval PR_STATIC_CALLBACK(JSBool) EventTargetAddEventListener(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMNode *privateThis = (nsIDOMNode*)nsJSUtils::nsGetNativeThis(cx, obj); - nsIDOMEventTarget *nativeThis = nsnull; + nsIDOMNodePtr nativeThis = nsnull; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kINodeIID, (void **)&nativeThis)) { nsresult result = NS_OK; if (NS_OK != privateThis->QueryInterface(kIEventTargetIID, (void **)&nativeThis)) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR); @@ -753,7 +754,7 @@ EventTargetAddEventListener(JSContext *cx, JSObject *obj, uintN argc, jsval *arg } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_EVENTTARGET_ADDEVENTLISTENER,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_EVENTTARGET_ADDEVENTLISTENER, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -798,8 +799,9 @@ EventTargetAddEventListener(JSContext *cx, JSObject *obj, uintN argc, jsval *arg PR_STATIC_CALLBACK(JSBool) EventTargetRemoveEventListener(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMNode *privateThis = (nsIDOMNode*)nsJSUtils::nsGetNativeThis(cx, obj); - nsIDOMEventTarget *nativeThis = nsnull; + nsIDOMNodePtr nativeThis = nsnull; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kINodeIID, (void **)&nativeThis)) { nsresult result = NS_OK; if (NS_OK != privateThis->QueryInterface(kIEventTargetIID, (void **)&nativeThis)) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR); @@ -818,7 +820,7 @@ EventTargetRemoveEventListener(JSContext *cx, JSObject *obj, uintN argc, jsval * } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_EVENTTARGET_REMOVEEVENTLISTENER,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_EVENTTARGET_REMOVEEVENTLISTENER, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/coreDOM/nsJSNodeList.cpp b/dom/src/coreDOM/nsJSNodeList.cpp index 11a02f71836a..71edabe6c929 100644 --- a/dom/src/coreDOM/nsJSNodeList.cpp +++ b/dom/src/coreDOM/nsJSNodeList.cpp @@ -199,7 +199,7 @@ NodeListItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NODELIST_ITEM,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NODELIST_ITEM, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/coreDOM/nsJSStyleSheetCollection.cpp b/dom/src/coreDOM/nsJSStyleSheetCollection.cpp index 6960f2ca1baf..def477220d5e 100644 --- a/dom/src/coreDOM/nsJSStyleSheetCollection.cpp +++ b/dom/src/coreDOM/nsJSStyleSheetCollection.cpp @@ -199,7 +199,7 @@ StyleSheetCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_STYLESHEETCOLLECTION_ITEM,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_STYLESHEETCOLLECTION_ITEM, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/coreDOM/nsJSText.cpp b/dom/src/coreDOM/nsJSText.cpp index 029636b2fafe..64f643de2062 100644 --- a/dom/src/coreDOM/nsJSText.cpp +++ b/dom/src/coreDOM/nsJSText.cpp @@ -162,7 +162,7 @@ TextSplitText(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_TEXT_SPLITTEXT,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_TEXT_SPLITTEXT, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/css/nsJSCSSMediaRule.cpp b/dom/src/css/nsJSCSSMediaRule.cpp index 0b8f63405bb5..5bef1ba73eaf 100644 --- a/dom/src/css/nsJSCSSMediaRule.cpp +++ b/dom/src/css/nsJSCSSMediaRule.cpp @@ -222,7 +222,7 @@ CSSMediaRuleInsertRule(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CSSMEDIARULE_INSERTRULE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CSSMEDIARULE_INSERTRULE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -274,7 +274,7 @@ CSSMediaRuleDeleteRule(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CSSMEDIARULE_DELETERULE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CSSMEDIARULE_DELETERULE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/css/nsJSCSSStyleDeclaration.cpp b/dom/src/css/nsJSCSSStyleDeclaration.cpp index 706f2248f9c7..1a9a73879478 100644 --- a/dom/src/css/nsJSCSSStyleDeclaration.cpp +++ b/dom/src/css/nsJSCSSStyleDeclaration.cpp @@ -227,7 +227,7 @@ CSSStyleDeclarationGetPropertyValue(JSContext *cx, JSObject *obj, uintN argc, js } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CSSSTYLEDECLARATION_GETPROPERTYVALUE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CSSSTYLEDECLARATION_GETPROPERTYVALUE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -277,7 +277,7 @@ CSSStyleDeclarationGetPropertyPriority(JSContext *cx, JSObject *obj, uintN argc, } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CSSSTYLEDECLARATION_GETPROPERTYPRIORITY,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CSSSTYLEDECLARATION_GETPROPERTYPRIORITY, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -328,7 +328,7 @@ CSSStyleDeclarationSetProperty(JSContext *cx, JSObject *obj, uintN argc, jsval * } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CSSSTYLEDECLARATION_SETPROPERTY,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CSSSTYLEDECLARATION_SETPROPERTY, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -380,7 +380,7 @@ CSSStyleDeclarationItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CSSSTYLEDECLARATION_ITEM,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CSSSTYLEDECLARATION_ITEM, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/css/nsJSCSSStyleRuleCollection.cpp b/dom/src/css/nsJSCSSStyleRuleCollection.cpp index c19f91392c8d..79675f469cfe 100644 --- a/dom/src/css/nsJSCSSStyleRuleCollection.cpp +++ b/dom/src/css/nsJSCSSStyleRuleCollection.cpp @@ -199,7 +199,7 @@ CSSStyleRuleCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CSSSTYLERULECOLLECTION_ITEM,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CSSSTYLERULECOLLECTION_ITEM, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/css/nsJSCSSStyleSheet.cpp b/dom/src/css/nsJSCSSStyleSheet.cpp index 76665a7f4c6d..30f942e6e889 100644 --- a/dom/src/css/nsJSCSSStyleSheet.cpp +++ b/dom/src/css/nsJSCSSStyleSheet.cpp @@ -293,7 +293,7 @@ CSSStyleSheetInsertRule(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CSSSTYLESHEET_INSERTRULE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CSSSTYLESHEET_INSERTRULE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -345,7 +345,7 @@ CSSStyleSheetDeleteRule(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CSSSTYLESHEET_DELETERULE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_CSSSTYLESHEET_DELETERULE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/events/nsJSEvent.cpp b/dom/src/events/nsJSEvent.cpp index 2701b1b4091b..2e55ebe67fd5 100644 --- a/dom/src/events/nsJSEvent.cpp +++ b/dom/src/events/nsJSEvent.cpp @@ -283,7 +283,7 @@ EventPreventBubble(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_EVENT_PREVENTBUBBLE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_EVENT_PREVENTBUBBLE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -326,7 +326,7 @@ EventPreventCapture(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_EVENT_PREVENTCAPTURE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_EVENT_PREVENTCAPTURE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -369,7 +369,7 @@ EventPreventDefault(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_EVENT_PREVENTDEFAULT,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_EVENT_PREVENTDEFAULT, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -415,7 +415,7 @@ EventInitEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_EVENT_INITEVENT,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_EVENT_INITEVENT, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/events/nsJSKeyEvent.cpp b/dom/src/events/nsJSKeyEvent.cpp index 442b5f713509..51a3cac0374f 100644 --- a/dom/src/events/nsJSKeyEvent.cpp +++ b/dom/src/events/nsJSKeyEvent.cpp @@ -487,7 +487,7 @@ KeyEventInitKeyEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_KEYEVENT_INITKEYEVENT,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_KEYEVENT_INITKEYEVENT, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -554,8 +554,9 @@ KeyEventInitKeyEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva PR_STATIC_CALLBACK(JSBool) MouseEventInitMouseEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMKeyEvent *privateThis = (nsIDOMKeyEvent*)nsJSUtils::nsGetNativeThis(cx, obj); - nsIDOMMouseEvent *nativeThis = nsnull; + nsIDOMKeyEventPtr nativeThis = nsnull; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIKeyEventIID, (void **)&nativeThis)) { nsresult result = NS_OK; if (NS_OK != privateThis->QueryInterface(kIMouseEventIID, (void **)&nativeThis)) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR); @@ -582,7 +583,7 @@ MouseEventInitMouseEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_MOUSEEVENT_INITMOUSEEVENT,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_MOUSEEVENT_INITMOUSEEVENT, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/events/nsJSUIEvent.cpp b/dom/src/events/nsJSUIEvent.cpp index a145a59aa37e..6a90070fc2bd 100644 --- a/dom/src/events/nsJSUIEvent.cpp +++ b/dom/src/events/nsJSUIEvent.cpp @@ -484,7 +484,7 @@ UIEventInitUIEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_UIEVENT_INITUIEVENT,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_UIEVENT_INITUIEVENT, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/html/nsJSHTMLAnchorElement.cpp b/dom/src/html/nsJSHTMLAnchorElement.cpp index bb44f436da56..de3faa0f3233 100644 --- a/dom/src/html/nsJSHTMLAnchorElement.cpp +++ b/dom/src/html/nsJSHTMLAnchorElement.cpp @@ -565,7 +565,7 @@ HTMLAnchorElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLANCHORELEMENT_BLUR,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLANCHORELEMENT_BLUR, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -608,7 +608,7 @@ HTMLAnchorElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLANCHORELEMENT_FOCUS,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLANCHORELEMENT_FOCUS, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/html/nsJSHTMLButtonElement.cpp b/dom/src/html/nsJSHTMLButtonElement.cpp index f09b72a181c4..43000f63a059 100644 --- a/dom/src/html/nsJSHTMLButtonElement.cpp +++ b/dom/src/html/nsJSHTMLButtonElement.cpp @@ -369,8 +369,9 @@ ResolveHTMLButtonElement(JSContext *cx, JSObject *obj, jsval id) PR_STATIC_CALLBACK(JSBool) NSHTMLButtonElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMHTMLButtonElement *privateThis = (nsIDOMHTMLButtonElement*)nsJSUtils::nsGetNativeThis(cx, obj); - nsIDOMNSHTMLButtonElement *nativeThis = nsnull; + nsIDOMHTMLButtonElementPtr nativeThis = nsnull; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIHTMLButtonElementIID, (void **)&nativeThis)) { nsresult result = NS_OK; if (NS_OK != privateThis->QueryInterface(kINSHTMLButtonElementIID, (void **)&nativeThis)) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR); @@ -386,7 +387,7 @@ NSHTMLButtonElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NSHTMLBUTTONELEMENT_BLUR,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NSHTMLBUTTONELEMENT_BLUR, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -417,8 +418,9 @@ NSHTMLButtonElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j PR_STATIC_CALLBACK(JSBool) NSHTMLButtonElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMHTMLButtonElement *privateThis = (nsIDOMHTMLButtonElement*)nsJSUtils::nsGetNativeThis(cx, obj); - nsIDOMNSHTMLButtonElement *nativeThis = nsnull; + nsIDOMHTMLButtonElementPtr nativeThis = nsnull; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIHTMLButtonElementIID, (void **)&nativeThis)) { nsresult result = NS_OK; if (NS_OK != privateThis->QueryInterface(kINSHTMLButtonElementIID, (void **)&nativeThis)) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR); @@ -434,7 +436,7 @@ NSHTMLButtonElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NSHTMLBUTTONELEMENT_FOCUS,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NSHTMLBUTTONELEMENT_FOCUS, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/html/nsJSHTMLCollection.cpp b/dom/src/html/nsJSHTMLCollection.cpp index f853b10f7373..d33142172b0d 100644 --- a/dom/src/html/nsJSHTMLCollection.cpp +++ b/dom/src/html/nsJSHTMLCollection.cpp @@ -231,7 +231,7 @@ HTMLCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLCOLLECTION_ITEM,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLCOLLECTION_ITEM, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -283,7 +283,7 @@ HTMLCollectionNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLCOLLECTION_NAMEDITEM,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLCOLLECTION_NAMEDITEM, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/html/nsJSHTMLDocument.cpp b/dom/src/html/nsJSHTMLDocument.cpp index a688cca8aff7..5f4fda45312b 100644 --- a/dom/src/html/nsJSHTMLDocument.cpp +++ b/dom/src/html/nsJSHTMLDocument.cpp @@ -983,8 +983,9 @@ HTMLDocumentGetElementsByName(JSContext *cx, JSObject *obj, uintN argc, jsval *a PR_STATIC_CALLBACK(JSBool) NSHTMLDocumentGetSelection(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMHTMLDocument *privateThis = (nsIDOMHTMLDocument*)nsJSUtils::nsGetNativeThis(cx, obj); - nsIDOMNSHTMLDocument *nativeThis = nsnull; + nsIDOMHTMLDocumentPtr nativeThis = nsnull; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIHTMLDocumentIID, (void **)&nativeThis)) { nsresult result = NS_OK; if (NS_OK != privateThis->QueryInterface(kINSHTMLDocumentIID, (void **)&nativeThis)) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR); @@ -1032,8 +1033,9 @@ NSHTMLDocumentGetSelection(JSContext *cx, JSObject *obj, uintN argc, jsval *argv PR_STATIC_CALLBACK(JSBool) NSHTMLDocumentNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMHTMLDocument *privateThis = (nsIDOMHTMLDocument*)nsJSUtils::nsGetNativeThis(cx, obj); - nsIDOMNSHTMLDocument *nativeThis = nsnull; + nsIDOMHTMLDocumentPtr nativeThis = nsnull; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIHTMLDocumentIID, (void **)&nativeThis)) { nsresult result = NS_OK; if (NS_OK != privateThis->QueryInterface(kINSHTMLDocumentIID, (void **)&nativeThis)) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR); @@ -1087,8 +1089,9 @@ NSHTMLDocumentNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j PR_STATIC_CALLBACK(JSBool) NSHTMLDocumentOpen(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMHTMLDocument *privateThis = (nsIDOMHTMLDocument*)nsJSUtils::nsGetNativeThis(cx, obj); - nsIDOMNSHTMLDocument *nativeThis = nsnull; + nsIDOMHTMLDocumentPtr nativeThis = nsnull; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIHTMLDocumentIID, (void **)&nativeThis)) { nsresult result = NS_OK; if (NS_OK != privateThis->QueryInterface(kINSHTMLDocumentIID, (void **)&nativeThis)) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR); @@ -1135,8 +1138,9 @@ NSHTMLDocumentOpen(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval PR_STATIC_CALLBACK(JSBool) NSHTMLDocumentWrite(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMHTMLDocument *privateThis = (nsIDOMHTMLDocument*)nsJSUtils::nsGetNativeThis(cx, obj); - nsIDOMNSHTMLDocument *nativeThis = nsnull; + nsIDOMHTMLDocumentPtr nativeThis = nsnull; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIHTMLDocumentIID, (void **)&nativeThis)) { nsresult result = NS_OK; if (NS_OK != privateThis->QueryInterface(kINSHTMLDocumentIID, (void **)&nativeThis)) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR); @@ -1183,8 +1187,9 @@ NSHTMLDocumentWrite(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval PR_STATIC_CALLBACK(JSBool) NSHTMLDocumentWriteln(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMHTMLDocument *privateThis = (nsIDOMHTMLDocument*)nsJSUtils::nsGetNativeThis(cx, obj); - nsIDOMNSHTMLDocument *nativeThis = nsnull; + nsIDOMHTMLDocumentPtr nativeThis = nsnull; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIHTMLDocumentIID, (void **)&nativeThis)) { nsresult result = NS_OK; if (NS_OK != privateThis->QueryInterface(kINSHTMLDocumentIID, (void **)&nativeThis)) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR); @@ -1231,8 +1236,9 @@ NSHTMLDocumentWriteln(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv PR_STATIC_CALLBACK(JSBool) NSHTMLDocumentClear(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMHTMLDocument *privateThis = (nsIDOMHTMLDocument*)nsJSUtils::nsGetNativeThis(cx, obj); - nsIDOMNSHTMLDocument *nativeThis = nsnull; + nsIDOMHTMLDocumentPtr nativeThis = nsnull; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIHTMLDocumentIID, (void **)&nativeThis)) { nsresult result = NS_OK; if (NS_OK != privateThis->QueryInterface(kINSHTMLDocumentIID, (void **)&nativeThis)) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR); @@ -1279,8 +1285,9 @@ NSHTMLDocumentClear(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval PR_STATIC_CALLBACK(JSBool) NSHTMLDocumentCaptureEvents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMHTMLDocument *privateThis = (nsIDOMHTMLDocument*)nsJSUtils::nsGetNativeThis(cx, obj); - nsIDOMNSHTMLDocument *nativeThis = nsnull; + nsIDOMHTMLDocumentPtr nativeThis = nsnull; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIHTMLDocumentIID, (void **)&nativeThis)) { nsresult result = NS_OK; if (NS_OK != privateThis->QueryInterface(kINSHTMLDocumentIID, (void **)&nativeThis)) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR); @@ -1335,8 +1342,9 @@ NSHTMLDocumentCaptureEvents(JSContext *cx, JSObject *obj, uintN argc, jsval *arg PR_STATIC_CALLBACK(JSBool) NSHTMLDocumentReleaseEvents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMHTMLDocument *privateThis = (nsIDOMHTMLDocument*)nsJSUtils::nsGetNativeThis(cx, obj); - nsIDOMNSHTMLDocument *nativeThis = nsnull; + nsIDOMHTMLDocumentPtr nativeThis = nsnull; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIHTMLDocumentIID, (void **)&nativeThis)) { nsresult result = NS_OK; if (NS_OK != privateThis->QueryInterface(kINSHTMLDocumentIID, (void **)&nativeThis)) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR); @@ -1391,8 +1399,9 @@ NSHTMLDocumentReleaseEvents(JSContext *cx, JSObject *obj, uintN argc, jsval *arg PR_STATIC_CALLBACK(JSBool) NSHTMLDocumentRouteEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMHTMLDocument *privateThis = (nsIDOMHTMLDocument*)nsJSUtils::nsGetNativeThis(cx, obj); - nsIDOMNSHTMLDocument *nativeThis = nsnull; + nsIDOMHTMLDocumentPtr nativeThis = nsnull; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIHTMLDocumentIID, (void **)&nativeThis)) { nsresult result = NS_OK; if (NS_OK != privateThis->QueryInterface(kINSHTMLDocumentIID, (void **)&nativeThis)) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR); diff --git a/dom/src/html/nsJSHTMLFormElement.cpp b/dom/src/html/nsJSHTMLFormElement.cpp index d4e21558757d..f52a328d5a92 100644 --- a/dom/src/html/nsJSHTMLFormElement.cpp +++ b/dom/src/html/nsJSHTMLFormElement.cpp @@ -495,7 +495,7 @@ HTMLFormElementSubmit(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLFORMELEMENT_SUBMIT,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLFORMELEMENT_SUBMIT, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -538,7 +538,7 @@ HTMLFormElementReset(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLFORMELEMENT_RESET,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLFORMELEMENT_RESET, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -569,8 +569,9 @@ HTMLFormElementReset(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva PR_STATIC_CALLBACK(JSBool) NSHTMLFormElementNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMHTMLFormElement *privateThis = (nsIDOMHTMLFormElement*)nsJSUtils::nsGetNativeThis(cx, obj); - nsIDOMNSHTMLFormElement *nativeThis = nsnull; + nsIDOMHTMLFormElementPtr nativeThis = nsnull; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIHTMLFormElementIID, (void **)&nativeThis)) { nsresult result = NS_OK; if (NS_OK != privateThis->QueryInterface(kINSHTMLFormElementIID, (void **)&nativeThis)) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR); @@ -588,7 +589,7 @@ NSHTMLFormElementNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NSHTMLFORMELEMENT_NAMEDITEM,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NSHTMLFORMELEMENT_NAMEDITEM, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -624,8 +625,9 @@ NSHTMLFormElementNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv PR_STATIC_CALLBACK(JSBool) NSHTMLFormElementItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMHTMLFormElement *privateThis = (nsIDOMHTMLFormElement*)nsJSUtils::nsGetNativeThis(cx, obj); - nsIDOMNSHTMLFormElement *nativeThis = nsnull; + nsIDOMHTMLFormElementPtr nativeThis = nsnull; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIHTMLFormElementIID, (void **)&nativeThis)) { nsresult result = NS_OK; if (NS_OK != privateThis->QueryInterface(kINSHTMLFormElementIID, (void **)&nativeThis)) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR); @@ -643,7 +645,7 @@ NSHTMLFormElementItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NSHTMLFORMELEMENT_ITEM,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NSHTMLFORMELEMENT_ITEM, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/html/nsJSHTMLSelectElement.cpp b/dom/src/html/nsJSHTMLSelectElement.cpp index 2b7c509661ab..933aebd61bba 100644 --- a/dom/src/html/nsJSHTMLSelectElement.cpp +++ b/dom/src/html/nsJSHTMLSelectElement.cpp @@ -530,7 +530,7 @@ HTMLSelectElementAdd(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLSELECTELEMENT_ADD,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLSELECTELEMENT_ADD, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -592,7 +592,7 @@ HTMLSelectElementRemove(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLSELECTELEMENT_REMOVE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLSELECTELEMENT_REMOVE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -642,7 +642,7 @@ HTMLSelectElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLSELECTELEMENT_BLUR,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLSELECTELEMENT_BLUR, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -685,7 +685,7 @@ HTMLSelectElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLSELECTELEMENT_FOCUS,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLSELECTELEMENT_FOCUS, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -716,8 +716,9 @@ HTMLSelectElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js PR_STATIC_CALLBACK(JSBool) NSHTMLSelectElementItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMHTMLSelectElement *privateThis = (nsIDOMHTMLSelectElement*)nsJSUtils::nsGetNativeThis(cx, obj); - nsIDOMNSHTMLSelectElement *nativeThis = nsnull; + nsIDOMHTMLSelectElementPtr nativeThis = nsnull; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIHTMLSelectElementIID, (void **)&nativeThis)) { nsresult result = NS_OK; if (NS_OK != privateThis->QueryInterface(kINSHTMLSelectElementIID, (void **)&nativeThis)) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR); @@ -735,7 +736,7 @@ NSHTMLSelectElementItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NSHTMLSELECTELEMENT_ITEM,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NSHTMLSELECTELEMENT_ITEM, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/html/nsJSHTMLTableElement.cpp b/dom/src/html/nsJSHTMLTableElement.cpp index b197fa283d62..8a215a305f6a 100644 --- a/dom/src/html/nsJSHTMLTableElement.cpp +++ b/dom/src/html/nsJSHTMLTableElement.cpp @@ -627,7 +627,7 @@ HTMLTableElementCreateTHead(JSContext *cx, JSObject *obj, uintN argc, jsval *arg } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTABLEELEMENT_CREATETHEAD,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTABLEELEMENT_CREATETHEAD, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -670,7 +670,7 @@ HTMLTableElementDeleteTHead(JSContext *cx, JSObject *obj, uintN argc, jsval *arg } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTABLEELEMENT_DELETETHEAD,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTABLEELEMENT_DELETETHEAD, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -714,7 +714,7 @@ HTMLTableElementCreateTFoot(JSContext *cx, JSObject *obj, uintN argc, jsval *arg } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTABLEELEMENT_CREATETFOOT,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTABLEELEMENT_CREATETFOOT, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -757,7 +757,7 @@ HTMLTableElementDeleteTFoot(JSContext *cx, JSObject *obj, uintN argc, jsval *arg } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTABLEELEMENT_DELETETFOOT,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTABLEELEMENT_DELETETFOOT, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -801,7 +801,7 @@ HTMLTableElementCreateCaption(JSContext *cx, JSObject *obj, uintN argc, jsval *a } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTABLEELEMENT_CREATECAPTION,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTABLEELEMENT_CREATECAPTION, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -844,7 +844,7 @@ HTMLTableElementDeleteCaption(JSContext *cx, JSObject *obj, uintN argc, jsval *a } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTABLEELEMENT_DELETECAPTION,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTABLEELEMENT_DELETECAPTION, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -889,7 +889,7 @@ HTMLTableElementInsertRow(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTABLEELEMENT_INSERTROW,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTABLEELEMENT_INSERTROW, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -940,7 +940,7 @@ HTMLTableElementDeleteRow(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTABLEELEMENT_DELETEROW,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTABLEELEMENT_DELETEROW, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/html/nsJSHTMLTableRowElement.cpp b/dom/src/html/nsJSHTMLTableRowElement.cpp index 43461e36a183..5398a9261f23 100644 --- a/dom/src/html/nsJSHTMLTableRowElement.cpp +++ b/dom/src/html/nsJSHTMLTableRowElement.cpp @@ -452,7 +452,7 @@ HTMLTableRowElementInsertCell(JSContext *cx, JSObject *obj, uintN argc, jsval *a } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTABLEROWELEMENT_INSERTCELL,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTABLEROWELEMENT_INSERTCELL, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -503,7 +503,7 @@ HTMLTableRowElementDeleteCell(JSContext *cx, JSObject *obj, uintN argc, jsval *a } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTABLEROWELEMENT_DELETECELL,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTABLEROWELEMENT_DELETECELL, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/html/nsJSHTMLTableSectionElement.cpp b/dom/src/html/nsJSHTMLTableSectionElement.cpp index 2b0fb5dc2b17..a44ece877774 100644 --- a/dom/src/html/nsJSHTMLTableSectionElement.cpp +++ b/dom/src/html/nsJSHTMLTableSectionElement.cpp @@ -323,7 +323,7 @@ HTMLTableSectionElementInsertRow(JSContext *cx, JSObject *obj, uintN argc, jsval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTABLESECTIONELEMENT_INSERTROW,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTABLESECTIONELEMENT_INSERTROW, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -374,7 +374,7 @@ HTMLTableSectionElementDeleteRow(JSContext *cx, JSObject *obj, uintN argc, jsval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTABLESECTIONELEMENT_DELETEROW,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTABLESECTIONELEMENT_DELETEROW, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/html/nsJSHTMLTextAreaElement.cpp b/dom/src/html/nsJSHTMLTextAreaElement.cpp index 47c5eac94be4..d8ba4096f670 100644 --- a/dom/src/html/nsJSHTMLTextAreaElement.cpp +++ b/dom/src/html/nsJSHTMLTextAreaElement.cpp @@ -558,7 +558,7 @@ HTMLTextAreaElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTEXTAREAELEMENT_BLUR,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTEXTAREAELEMENT_BLUR, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -601,7 +601,7 @@ HTMLTextAreaElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTEXTAREAELEMENT_FOCUS,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTEXTAREAELEMENT_FOCUS, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -644,7 +644,7 @@ HTMLTextAreaElementSelect(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTEXTAREAELEMENT_SELECT,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_HTMLTEXTAREAELEMENT_SELECT, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/range/nsJSRange.cpp b/dom/src/range/nsJSRange.cpp index be92cafa9636..319c112d146b 100644 --- a/dom/src/range/nsJSRange.cpp +++ b/dom/src/range/nsJSRange.cpp @@ -292,7 +292,7 @@ RangeSetStart(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_SETSTART,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_SETSTART, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -350,7 +350,7 @@ RangeSetStartBefore(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_SETSTARTBEFORE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_SETSTARTBEFORE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -405,7 +405,7 @@ RangeSetStartAfter(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_SETSTARTAFTER,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_SETSTARTAFTER, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -461,7 +461,7 @@ RangeSetEnd(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_SETEND,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_SETEND, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -519,7 +519,7 @@ RangeSetEndBefore(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval * } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_SETENDBEFORE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_SETENDBEFORE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -574,7 +574,7 @@ RangeSetEndAfter(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_SETENDAFTER,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_SETENDAFTER, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -629,7 +629,7 @@ RangeCollapse(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_COLLAPSE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_COLLAPSE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -680,7 +680,7 @@ RangeSelectNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_SELECTNODE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_SELECTNODE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -735,7 +735,7 @@ RangeSelectNodeContents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_SELECTNODECONTENTS,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_SELECTNODECONTENTS, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -792,7 +792,7 @@ RangeCompareEndPoints(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_COMPAREENDPOINTS,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_COMPAREENDPOINTS, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -849,7 +849,7 @@ RangeDeleteContents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_DELETECONTENTS,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_DELETECONTENTS, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -893,7 +893,7 @@ RangeExtractContents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_EXTRACTCONTENTS,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_EXTRACTCONTENTS, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -937,7 +937,7 @@ RangeCloneContents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_CLONECONTENTS,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_CLONECONTENTS, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -981,7 +981,7 @@ RangeInsertNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_INSERTNODE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_INSERTNODE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -1036,7 +1036,7 @@ RangeSurroundContents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_SURROUNDCONTENTS,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_SURROUNDCONTENTS, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -1091,7 +1091,7 @@ RangeClone(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_CLONE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_CLONE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -1135,7 +1135,7 @@ RangeToString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_TOSTRING,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_RANGE_TOSTRING, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -1166,8 +1166,9 @@ RangeToString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval PR_STATIC_CALLBACK(JSBool) NSRangeCreateContextualFragment(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMRange *privateThis = (nsIDOMRange*)nsJSUtils::nsGetNativeThis(cx, obj); - nsIDOMNSRange *nativeThis = nsnull; + nsIDOMRangePtr nativeThis = nsnull; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIRangeIID, (void **)&nativeThis)) { nsresult result = NS_OK; if (NS_OK != privateThis->QueryInterface(kINSRangeIID, (void **)&nativeThis)) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR); @@ -1185,7 +1186,7 @@ NSRangeCreateContextualFragment(JSContext *cx, JSObject *obj, uintN argc, jsval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NSRANGE_CREATECONTEXTUALFRAGMENT,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NSRANGE_CREATECONTEXTUALFRAGMENT, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -1221,8 +1222,9 @@ NSRangeCreateContextualFragment(JSContext *cx, JSObject *obj, uintN argc, jsval PR_STATIC_CALLBACK(JSBool) NSRangeIsValidFragment(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMRange *privateThis = (nsIDOMRange*)nsJSUtils::nsGetNativeThis(cx, obj); - nsIDOMNSRange *nativeThis = nsnull; + nsIDOMRangePtr nativeThis = nsnull; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIRangeIID, (void **)&nativeThis)) { nsresult result = NS_OK; if (NS_OK != privateThis->QueryInterface(kINSRangeIID, (void **)&nativeThis)) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR); @@ -1240,7 +1242,7 @@ NSRangeIsValidFragment(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NSRANGE_ISVALIDFRAGMENT,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_NSRANGE_ISVALIDFRAGMENT, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/range/nsJSSelection.cpp b/dom/src/range/nsJSSelection.cpp index ae7a946303f2..ed9bfe957e99 100644 --- a/dom/src/range/nsJSSelection.cpp +++ b/dom/src/range/nsJSSelection.cpp @@ -294,7 +294,7 @@ SelectionGetRangeAt(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_GETRANGEAT,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_GETRANGEAT, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -344,7 +344,7 @@ SelectionClearSelection(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_CLEARSELECTION,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_CLEARSELECTION, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -389,7 +389,7 @@ SelectionCollapse(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval * } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_COLLAPSE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_COLLAPSE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -448,7 +448,7 @@ SelectionExtend(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_EXTEND,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_EXTEND, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -505,7 +505,7 @@ SelectionCollapseToStart(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_COLLAPSETOSTART,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_COLLAPSETOSTART, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -548,7 +548,7 @@ SelectionCollapseToEnd(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_COLLAPSETOEND,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_COLLAPSETOEND, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -594,7 +594,7 @@ SelectionContainsNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_CONTAINSNODE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_CONTAINSNODE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -651,7 +651,7 @@ SelectionDeleteFromDocument(JSContext *cx, JSObject *obj, uintN argc, jsval *arg } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_DELETEFROMDOCUMENT,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_DELETEFROMDOCUMENT, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -695,7 +695,7 @@ SelectionAddRange(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval * } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_ADDRANGE,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_ADDRANGE, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -749,7 +749,7 @@ SelectionStartBatchChanges(JSContext *cx, JSObject *obj, uintN argc, jsval *argv } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_STARTBATCHCHANGES,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_STARTBATCHCHANGES, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -792,7 +792,7 @@ SelectionEndBatchChanges(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_ENDBATCHCHANGES,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_ENDBATCHCHANGES, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -836,7 +836,7 @@ SelectionAddSelectionListener(JSContext *cx, JSObject *obj, uintN argc, jsval *a } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_ADDSELECTIONLISTENER,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_ADDSELECTIONLISTENER, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -891,7 +891,7 @@ SelectionRemoveSelectionListener(JSContext *cx, JSObject *obj, uintN argc, jsval } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_REMOVESELECTIONLISTENER,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_REMOVESELECTIONLISTENER, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } @@ -946,7 +946,7 @@ SelectionToString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval * } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_TOSTRING,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTION_TOSTRING, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); } diff --git a/dom/src/range/nsJSSelectionListener.cpp b/dom/src/range/nsJSSelectionListener.cpp index 3c94796f2fa1..ba4775b19d01 100644 --- a/dom/src/range/nsJSSelectionListener.cpp +++ b/dom/src/range/nsJSSelectionListener.cpp @@ -160,7 +160,7 @@ SelectionListenerNotifySelectionChanged(JSContext *cx, JSObject *obj, uintN argc } { PRBool ok; - secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTIONLISTENER_NOTIFYSELECTIONCHANGED,PR_FALSE , &ok); + secMan->CheckScriptAccess(scriptCX, obj, NS_DOM_PROP_SELECTIONLISTENER_NOTIFYSELECTIONCHANGED, PR_FALSE, &ok); if (!ok) { return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_SECURITY_ERR); }