Regenerate to eliminate degenerate unsigned comparisons and dead code.
This commit is contained in:
Родитель
b9ed205ebf
Коммит
17411df5fe
|
@ -22,7 +22,7 @@
|
|||
void collapse(in Node parentNode, in long offset);
|
||||
void extend(in Node parentNode, in long offset);
|
||||
|
||||
void containsNode(in Node node, in boolean recursive, out boolean aYes);
|
||||
boolean containsNode(in Node node, in boolean recursive);
|
||||
|
||||
void deleteFromDocument();
|
||||
|
||||
|
|
|
@ -223,7 +223,10 @@ HistoryBack(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "history.back", &ok);
|
||||
if (!ok) {
|
||||
|
@ -232,16 +235,13 @@ HistoryBack(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Back()) {
|
||||
return JS_FALSE;
|
||||
|
@ -249,10 +249,6 @@ HistoryBack(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function back requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -270,7 +266,10 @@ HistoryForward(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "history.forward", &ok);
|
||||
if (!ok) {
|
||||
|
@ -279,16 +278,13 @@ HistoryForward(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Forward()) {
|
||||
return JS_FALSE;
|
||||
|
@ -296,10 +292,6 @@ HistoryForward(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function forward requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -318,7 +310,10 @@ HistoryGo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "history.go", &ok);
|
||||
if (!ok) {
|
||||
|
@ -327,16 +322,17 @@ HistoryGo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function go requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
|
@ -349,10 +345,6 @@ HistoryGo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function go requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -375,7 +375,10 @@ LocationToString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "location.tostring", &ok);
|
||||
if (!ok) {
|
||||
|
@ -384,16 +387,13 @@ LocationToString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->ToString(nativeRet)) {
|
||||
return JS_FALSE;
|
||||
|
@ -401,10 +401,6 @@ LocationToString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
|
||||
nsJSUtils::nsConvertStringToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function toString requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -428,7 +424,10 @@ NSLocationReload(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "nslocation.reload", &ok);
|
||||
if (!ok) {
|
||||
|
@ -437,16 +436,13 @@ NSLocationReload(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Reload(cx, argv+0, argc-0)) {
|
||||
return JS_FALSE;
|
||||
|
@ -454,10 +450,6 @@ NSLocationReload(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function reload requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -481,7 +473,10 @@ NSLocationReplace(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "nslocation.replace", &ok);
|
||||
if (!ok) {
|
||||
|
@ -490,16 +485,13 @@ NSLocationReplace(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Replace(cx, argv+0, argc-0)) {
|
||||
return JS_FALSE;
|
||||
|
@ -507,10 +499,6 @@ NSLocationReplace(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function replace requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -215,7 +215,10 @@ MimeTypeArrayItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "mimetypearray.item", &ok);
|
||||
if (!ok) {
|
||||
|
@ -224,16 +227,17 @@ MimeTypeArrayItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function item requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
|
@ -246,10 +250,6 @@ MimeTypeArrayItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function item requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -269,7 +269,10 @@ MimeTypeArrayNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "mimetypearray.nameditem", &ok);
|
||||
if (!ok) {
|
||||
|
@ -278,16 +281,17 @@ MimeTypeArrayNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function namedItem requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -297,10 +301,6 @@ MimeTypeArrayNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function namedItem requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -317,7 +317,10 @@ NavigatorJavaEnabled(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "navigator.javaenabled", &ok);
|
||||
if (!ok) {
|
||||
|
@ -326,16 +329,13 @@ NavigatorJavaEnabled(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->JavaEnabled(&nativeRet)) {
|
||||
return JS_FALSE;
|
||||
|
@ -343,10 +343,6 @@ NavigatorJavaEnabled(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
|||
|
||||
*rval = BOOLEAN_TO_JSVAL(nativeRet);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function javaEnabled requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -266,7 +266,10 @@ PluginItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "plugin.item", &ok);
|
||||
if (!ok) {
|
||||
|
@ -275,16 +278,17 @@ PluginItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function item requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
|
@ -297,10 +301,6 @@ PluginItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function item requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -320,7 +320,10 @@ PluginNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "plugin.nameditem", &ok);
|
||||
if (!ok) {
|
||||
|
@ -329,16 +332,17 @@ PluginNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function namedItem requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -348,10 +352,6 @@ PluginNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function namedItem requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -215,7 +215,10 @@ PluginArrayItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "pluginarray.item", &ok);
|
||||
if (!ok) {
|
||||
|
@ -224,16 +227,17 @@ PluginArrayItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function item requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
|
@ -246,10 +250,6 @@ PluginArrayItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function item requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -269,7 +269,10 @@ PluginArrayNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "pluginarray.nameditem", &ok);
|
||||
if (!ok) {
|
||||
|
@ -278,16 +281,17 @@ PluginArrayNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function namedItem requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -297,10 +301,6 @@ PluginArrayNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function namedItem requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -319,7 +319,10 @@ PluginArrayRefresh(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "pluginarray.refresh", &ok);
|
||||
if (!ok) {
|
||||
|
@ -328,16 +331,17 @@ PluginArrayRefresh(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function refresh requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!nsJSUtils::nsConvertJSValToBool(&b0, cx, argv[0])) {
|
||||
return JS_FALSE;
|
||||
|
@ -349,10 +353,6 @@ PluginArrayRefresh(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function refresh requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -215,7 +215,10 @@ WindowCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "windowcollection.item", &ok);
|
||||
if (!ok) {
|
||||
|
@ -224,16 +227,17 @@ WindowCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function item requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
|
@ -246,10 +250,6 @@ WindowCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function item requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -269,7 +269,10 @@ WindowCollectionNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "windowcollection.nameditem", &ok);
|
||||
if (!ok) {
|
||||
|
@ -278,16 +281,17 @@ WindowCollectionNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function namedItem requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -297,10 +301,6 @@ WindowCollectionNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function namedItem requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -205,7 +205,10 @@ CharacterDataSubstringData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "characterdata.substringdata", &ok);
|
||||
if (!ok) {
|
||||
|
@ -214,22 +217,22 @@ CharacterDataSubstringData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 2) {
|
||||
{
|
||||
if (argc < 2) {
|
||||
JS_ReportError(cx, "Function substringData requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[1], (int32 *)&b1)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
return JS_FALSE;
|
||||
|
@ -241,10 +244,6 @@ CharacterDataSubstringData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
|
|||
|
||||
nsJSUtils::nsConvertStringToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function substringData requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -263,7 +262,10 @@ CharacterDataAppendData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "characterdata.appenddata", &ok);
|
||||
if (!ok) {
|
||||
|
@ -272,16 +274,17 @@ CharacterDataAppendData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function appendData requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -291,10 +294,6 @@ CharacterDataAppendData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function appendData requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -314,7 +313,10 @@ CharacterDataInsertData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "characterdata.insertdata", &ok);
|
||||
if (!ok) {
|
||||
|
@ -323,22 +325,22 @@ CharacterDataInsertData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 2) {
|
||||
{
|
||||
if (argc < 2) {
|
||||
JS_ReportError(cx, "Function insertData requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b1, cx, argv[1]);
|
||||
|
||||
if (NS_OK != nativeThis->InsertData(b0, b1)) {
|
||||
|
@ -347,10 +349,6 @@ CharacterDataInsertData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function insertData requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -370,7 +368,10 @@ CharacterDataDeleteData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "characterdata.deletedata", &ok);
|
||||
if (!ok) {
|
||||
|
@ -379,22 +380,22 @@ CharacterDataDeleteData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 2) {
|
||||
{
|
||||
if (argc < 2) {
|
||||
JS_ReportError(cx, "Function deleteData requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[1], (int32 *)&b1)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
return JS_FALSE;
|
||||
|
@ -406,10 +407,6 @@ CharacterDataDeleteData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function deleteData requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -430,7 +427,10 @@ CharacterDataReplaceData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "characterdata.replacedata", &ok);
|
||||
if (!ok) {
|
||||
|
@ -439,27 +439,26 @@ CharacterDataReplaceData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 3) {
|
||||
{
|
||||
if (argc < 3) {
|
||||
JS_ReportError(cx, "Function replaceData requires 3 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[1], (int32 *)&b1)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b2, cx, argv[2]);
|
||||
|
||||
if (NS_OK != nativeThis->ReplaceData(b0, b1, b2)) {
|
||||
|
@ -468,10 +467,6 @@ CharacterDataReplaceData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function replaceData requires 3 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -154,7 +154,10 @@ DOMImplementationHasFeature(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "domimplementation.hasfeature", &ok);
|
||||
if (!ok) {
|
||||
|
@ -163,19 +166,19 @@ DOMImplementationHasFeature(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 2) {
|
||||
{
|
||||
if (argc < 2) {
|
||||
JS_ReportError(cx, "Function hasFeature requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b1, cx, argv[1]);
|
||||
|
||||
if (NS_OK != nativeThis->HasFeature(b0, b1, &nativeRet)) {
|
||||
|
@ -184,10 +187,6 @@ DOMImplementationHasFeature(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
|
||||
*rval = BOOLEAN_TO_JSVAL(nativeRet);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function hasFeature requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -283,7 +283,10 @@ DocumentCreateElement(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "document.createelement", &ok);
|
||||
if (!ok) {
|
||||
|
@ -292,16 +295,17 @@ DocumentCreateElement(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function createElement requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -311,10 +315,6 @@ DocumentCreateElement(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function createElement requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -333,7 +333,10 @@ DocumentCreateDocumentFragment(JSContext *cx, JSObject *obj, uintN argc, jsval *
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "document.createdocumentfragment", &ok);
|
||||
if (!ok) {
|
||||
|
@ -342,16 +345,13 @@ DocumentCreateDocumentFragment(JSContext *cx, JSObject *obj, uintN argc, jsval *
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->CreateDocumentFragment(&nativeRet)) {
|
||||
return JS_FALSE;
|
||||
|
@ -359,10 +359,6 @@ DocumentCreateDocumentFragment(JSContext *cx, JSObject *obj, uintN argc, jsval *
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function createDocumentFragment requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -382,7 +378,10 @@ DocumentCreateTextNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "document.createtextnode", &ok);
|
||||
if (!ok) {
|
||||
|
@ -391,16 +390,17 @@ DocumentCreateTextNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function createTextNode requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -410,10 +410,6 @@ DocumentCreateTextNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function createTextNode requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -433,7 +429,10 @@ DocumentCreateComment(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "document.createcomment", &ok);
|
||||
if (!ok) {
|
||||
|
@ -442,16 +441,17 @@ DocumentCreateComment(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function createComment requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -461,10 +461,6 @@ DocumentCreateComment(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function createComment requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -484,7 +480,10 @@ DocumentCreateCDATASection(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "document.createcdatasection", &ok);
|
||||
if (!ok) {
|
||||
|
@ -493,16 +492,17 @@ DocumentCreateCDATASection(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function createCDATASection requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -512,10 +512,6 @@ DocumentCreateCDATASection(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function createCDATASection requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -536,7 +532,10 @@ DocumentCreateProcessingInstruction(JSContext *cx, JSObject *obj, uintN argc, js
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "document.createprocessinginstruction", &ok);
|
||||
if (!ok) {
|
||||
|
@ -545,19 +544,19 @@ DocumentCreateProcessingInstruction(JSContext *cx, JSObject *obj, uintN argc, js
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 2) {
|
||||
{
|
||||
if (argc < 2) {
|
||||
JS_ReportError(cx, "Function createProcessingInstruction requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b1, cx, argv[1]);
|
||||
|
||||
if (NS_OK != nativeThis->CreateProcessingInstruction(b0, b1, &nativeRet)) {
|
||||
|
@ -566,10 +565,6 @@ DocumentCreateProcessingInstruction(JSContext *cx, JSObject *obj, uintN argc, js
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function createProcessingInstruction requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -589,7 +584,10 @@ DocumentCreateAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "document.createattribute", &ok);
|
||||
if (!ok) {
|
||||
|
@ -598,16 +596,17 @@ DocumentCreateAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function createAttribute requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -617,10 +616,6 @@ DocumentCreateAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function createAttribute requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -640,7 +635,10 @@ DocumentCreateEntityReference(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "document.createentityreference", &ok);
|
||||
if (!ok) {
|
||||
|
@ -649,16 +647,17 @@ DocumentCreateEntityReference(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function createEntityReference requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -668,10 +667,6 @@ DocumentCreateEntityReference(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function createEntityReference requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -691,7 +686,10 @@ DocumentGetElementsByTagName(JSContext *cx, JSObject *obj, uintN argc, jsval *ar
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "document.getelementsbytagname", &ok);
|
||||
if (!ok) {
|
||||
|
@ -700,16 +698,17 @@ DocumentGetElementsByTagName(JSContext *cx, JSObject *obj, uintN argc, jsval *ar
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function getElementsByTagName requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -719,10 +718,6 @@ DocumentGetElementsByTagName(JSContext *cx, JSObject *obj, uintN argc, jsval *ar
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function getElementsByTagName requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -749,7 +744,10 @@ NSDocumentCreateElementWithNameSpace(JSContext *cx, JSObject *obj, uintN argc, j
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "nsdocument.createelementwithnamespace", &ok);
|
||||
if (!ok) {
|
||||
|
@ -758,19 +756,19 @@ NSDocumentCreateElementWithNameSpace(JSContext *cx, JSObject *obj, uintN argc, j
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 2) {
|
||||
{
|
||||
if (argc < 2) {
|
||||
JS_ReportError(cx, "Function createElementWithNameSpace requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b1, cx, argv[1]);
|
||||
|
||||
if (NS_OK != nativeThis->CreateElementWithNameSpace(b0, b1, &nativeRet)) {
|
||||
|
@ -779,10 +777,6 @@ NSDocumentCreateElementWithNameSpace(JSContext *cx, JSObject *obj, uintN argc, j
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function createElementWithNameSpace requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -807,7 +801,10 @@ NSDocumentCreateRange(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "nsdocument.createrange", &ok);
|
||||
if (!ok) {
|
||||
|
@ -816,16 +813,13 @@ NSDocumentCreateRange(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->CreateRange(&nativeRet)) {
|
||||
return JS_FALSE;
|
||||
|
@ -833,10 +827,6 @@ NSDocumentCreateRange(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function createRange requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -861,7 +851,10 @@ EventCapturerCaptureEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "eventcapturer.captureevent", &ok);
|
||||
if (!ok) {
|
||||
|
@ -870,16 +863,17 @@ EventCapturerCaptureEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function captureEvent requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -889,10 +883,6 @@ EventCapturerCaptureEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function captureEvent requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -917,7 +907,10 @@ EventCapturerReleaseEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "eventcapturer.releaseevent", &ok);
|
||||
if (!ok) {
|
||||
|
@ -926,16 +919,17 @@ EventCapturerReleaseEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function releaseEvent requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -945,10 +939,6 @@ EventCapturerReleaseEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function releaseEvent requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -180,7 +180,10 @@ ElementGetAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "element.getattribute", &ok);
|
||||
if (!ok) {
|
||||
|
@ -189,16 +192,17 @@ ElementGetAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function getAttribute requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -208,10 +212,6 @@ ElementGetAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
nsJSUtils::nsConvertStringToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function getAttribute requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -231,7 +231,10 @@ ElementSetAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "element.setattribute", &ok);
|
||||
if (!ok) {
|
||||
|
@ -240,19 +243,19 @@ ElementSetAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 2) {
|
||||
{
|
||||
if (argc < 2) {
|
||||
JS_ReportError(cx, "Function setAttribute requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b1, cx, argv[1]);
|
||||
|
||||
if (NS_OK != nativeThis->SetAttribute(b0, b1)) {
|
||||
|
@ -261,10 +264,6 @@ ElementSetAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function setAttribute requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -283,7 +282,10 @@ ElementRemoveAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "element.removeattribute", &ok);
|
||||
if (!ok) {
|
||||
|
@ -292,16 +294,17 @@ ElementRemoveAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function removeAttribute requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -311,10 +314,6 @@ ElementRemoveAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function removeAttribute requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -334,7 +333,10 @@ ElementGetAttributeNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "element.getattributenode", &ok);
|
||||
if (!ok) {
|
||||
|
@ -343,16 +345,17 @@ ElementGetAttributeNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function getAttributeNode requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -362,10 +365,6 @@ ElementGetAttributeNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function getAttributeNode requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -385,7 +384,10 @@ ElementSetAttributeNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "element.setattributenode", &ok);
|
||||
if (!ok) {
|
||||
|
@ -394,16 +396,17 @@ ElementSetAttributeNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function setAttributeNode requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kIAttrIID,
|
||||
|
@ -419,10 +422,6 @@ ElementSetAttributeNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function setAttributeNode requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -442,7 +441,10 @@ ElementRemoveAttributeNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "element.removeattributenode", &ok);
|
||||
if (!ok) {
|
||||
|
@ -451,16 +453,17 @@ ElementRemoveAttributeNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function removeAttributeNode requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kIAttrIID,
|
||||
|
@ -476,10 +479,6 @@ ElementRemoveAttributeNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function removeAttributeNode requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -499,7 +498,10 @@ ElementGetElementsByTagName(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "element.getelementsbytagname", &ok);
|
||||
if (!ok) {
|
||||
|
@ -508,16 +510,17 @@ ElementGetElementsByTagName(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function getElementsByTagName requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -527,10 +530,6 @@ ElementGetElementsByTagName(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function getElementsByTagName requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -548,7 +547,10 @@ ElementNormalize(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "element.normalize", &ok);
|
||||
if (!ok) {
|
||||
|
@ -557,16 +559,13 @@ ElementNormalize(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Normalize()) {
|
||||
return JS_FALSE;
|
||||
|
@ -574,10 +573,6 @@ ElementNormalize(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function normalize requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -185,7 +185,10 @@ NamedNodeMapGetNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "namednodemap.getnameditem", &ok);
|
||||
if (!ok) {
|
||||
|
@ -194,16 +197,17 @@ NamedNodeMapGetNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function getNamedItem requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -213,10 +217,6 @@ NamedNodeMapGetNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function getNamedItem requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -236,7 +236,10 @@ NamedNodeMapSetNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "namednodemap.setnameditem", &ok);
|
||||
if (!ok) {
|
||||
|
@ -245,16 +248,17 @@ NamedNodeMapSetNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function setNamedItem requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kINodeIID,
|
||||
|
@ -270,10 +274,6 @@ NamedNodeMapSetNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function setNamedItem requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -293,7 +293,10 @@ NamedNodeMapRemoveNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "namednodemap.removenameditem", &ok);
|
||||
if (!ok) {
|
||||
|
@ -302,16 +305,17 @@ NamedNodeMapRemoveNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function removeNamedItem requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -321,10 +325,6 @@ NamedNodeMapRemoveNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function removeNamedItem requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -344,7 +344,10 @@ NamedNodeMapItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "namednodemap.item", &ok);
|
||||
if (!ok) {
|
||||
|
@ -353,16 +356,17 @@ NamedNodeMapItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function item requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
|
@ -375,10 +379,6 @@ NamedNodeMapItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function item requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -381,7 +381,10 @@ NodeInsertBefore(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "node.insertbefore", &ok);
|
||||
if (!ok) {
|
||||
|
@ -390,16 +393,17 @@ NodeInsertBefore(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 2) {
|
||||
{
|
||||
if (argc < 2) {
|
||||
JS_ReportError(cx, "Function insertBefore requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kINodeIID,
|
||||
|
@ -408,7 +412,6 @@ NodeInsertBefore(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
argv[0])) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b1,
|
||||
kINodeIID,
|
||||
"Node",
|
||||
|
@ -423,10 +426,6 @@ NodeInsertBefore(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function insertBefore requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -447,7 +446,10 @@ NodeReplaceChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "node.replacechild", &ok);
|
||||
if (!ok) {
|
||||
|
@ -456,16 +458,17 @@ NodeReplaceChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 2) {
|
||||
{
|
||||
if (argc < 2) {
|
||||
JS_ReportError(cx, "Function replaceChild requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kINodeIID,
|
||||
|
@ -474,7 +477,6 @@ NodeReplaceChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
argv[0])) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b1,
|
||||
kINodeIID,
|
||||
"Node",
|
||||
|
@ -489,10 +491,6 @@ NodeReplaceChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function replaceChild requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -512,7 +510,10 @@ NodeRemoveChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "node.removechild", &ok);
|
||||
if (!ok) {
|
||||
|
@ -521,16 +522,17 @@ NodeRemoveChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function removeChild requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kINodeIID,
|
||||
|
@ -546,10 +548,6 @@ NodeRemoveChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function removeChild requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -569,7 +567,10 @@ NodeAppendChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "node.appendchild", &ok);
|
||||
if (!ok) {
|
||||
|
@ -578,16 +579,17 @@ NodeAppendChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function appendChild requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kINodeIID,
|
||||
|
@ -603,10 +605,6 @@ NodeAppendChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function appendChild requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -625,7 +623,10 @@ NodeHasChildNodes(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "node.haschildnodes", &ok);
|
||||
if (!ok) {
|
||||
|
@ -634,16 +635,13 @@ NodeHasChildNodes(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->HasChildNodes(&nativeRet)) {
|
||||
return JS_FALSE;
|
||||
|
@ -651,10 +649,6 @@ NodeHasChildNodes(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
|
||||
*rval = BOOLEAN_TO_JSVAL(nativeRet);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function hasChildNodes requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -674,7 +668,10 @@ NodeCloneNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "node.clonenode", &ok);
|
||||
if (!ok) {
|
||||
|
@ -683,16 +680,17 @@ NodeCloneNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function cloneNode requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!nsJSUtils::nsConvertJSValToBool(&b0, cx, argv[0])) {
|
||||
return JS_FALSE;
|
||||
|
@ -704,10 +702,6 @@ NodeCloneNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function cloneNode requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -734,7 +728,10 @@ EventTargetAddEventListener(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "eventtarget.addeventlistener", &ok);
|
||||
if (!ok) {
|
||||
|
@ -743,26 +740,25 @@ EventTargetAddEventListener(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 3) {
|
||||
{
|
||||
if (argc < 3) {
|
||||
JS_ReportError(cx, "Function addEventListener requires 3 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
if (!nsJSUtils::nsConvertJSValToFunc(&b1,
|
||||
cx,
|
||||
obj,
|
||||
argv[1])) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!nsJSUtils::nsConvertJSValToBool(&b2, cx, argv[2])) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
@ -773,10 +769,6 @@ EventTargetAddEventListener(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function addEventListener requires 3 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -803,7 +795,10 @@ EventTargetRemoveEventListener(JSContext *cx, JSObject *obj, uintN argc, jsval *
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "eventtarget.removeeventlistener", &ok);
|
||||
if (!ok) {
|
||||
|
@ -812,26 +807,25 @@ EventTargetRemoveEventListener(JSContext *cx, JSObject *obj, uintN argc, jsval *
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 3) {
|
||||
{
|
||||
if (argc < 3) {
|
||||
JS_ReportError(cx, "Function removeEventListener requires 3 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
if (!nsJSUtils::nsConvertJSValToFunc(&b1,
|
||||
cx,
|
||||
obj,
|
||||
argv[1])) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!nsJSUtils::nsConvertJSValToBool(&b2, cx, argv[2])) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
@ -842,10 +836,6 @@ EventTargetRemoveEventListener(JSContext *cx, JSObject *obj, uintN argc, jsval *
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function removeEventListener requires 3 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -185,7 +185,10 @@ NodeListItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "nodelist.item", &ok);
|
||||
if (!ok) {
|
||||
|
@ -194,16 +197,17 @@ NodeListItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function item requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
|
@ -216,10 +220,6 @@ NodeListItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function item requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -185,7 +185,10 @@ StyleSheetCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "stylesheetcollection.item", &ok);
|
||||
if (!ok) {
|
||||
|
@ -194,16 +197,17 @@ StyleSheetCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function item requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
|
@ -216,10 +220,6 @@ StyleSheetCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function item requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -153,7 +153,10 @@ TextSplitText(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "text.splittext", &ok);
|
||||
if (!ok) {
|
||||
|
@ -162,16 +165,17 @@ TextSplitText(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function splitText requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
|
@ -184,10 +188,6 @@ TextSplitText(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function splitText requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -209,7 +209,10 @@ CSSMediaRuleInsertRule(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "cssmediarule.insertrule", &ok);
|
||||
if (!ok) {
|
||||
|
@ -218,19 +221,19 @@ CSSMediaRuleInsertRule(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 2) {
|
||||
{
|
||||
if (argc < 2) {
|
||||
JS_ReportError(cx, "Function insertRule requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[1], (int32 *)&b1)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
return JS_FALSE;
|
||||
|
@ -242,10 +245,6 @@ CSSMediaRuleInsertRule(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
|
||||
*rval = INT_TO_JSVAL(nativeRet);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function insertRule requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -264,7 +263,10 @@ CSSMediaRuleDeleteRule(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "cssmediarule.deleterule", &ok);
|
||||
if (!ok) {
|
||||
|
@ -273,16 +275,17 @@ CSSMediaRuleDeleteRule(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function deleteRule requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
|
@ -295,10 +298,6 @@ CSSMediaRuleDeleteRule(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function deleteRule requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -211,7 +211,10 @@ CSSStyleDeclarationGetPropertyValue(JSContext *cx, JSObject *obj, uintN argc, js
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "cssstyledeclaration.getpropertyvalue", &ok);
|
||||
if (!ok) {
|
||||
|
@ -220,16 +223,17 @@ CSSStyleDeclarationGetPropertyValue(JSContext *cx, JSObject *obj, uintN argc, js
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function getPropertyValue requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -239,10 +243,6 @@ CSSStyleDeclarationGetPropertyValue(JSContext *cx, JSObject *obj, uintN argc, js
|
|||
|
||||
nsJSUtils::nsConvertStringToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function getPropertyValue requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -262,7 +262,10 @@ CSSStyleDeclarationGetPropertyPriority(JSContext *cx, JSObject *obj, uintN argc,
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "cssstyledeclaration.getpropertypriority", &ok);
|
||||
if (!ok) {
|
||||
|
@ -271,16 +274,17 @@ CSSStyleDeclarationGetPropertyPriority(JSContext *cx, JSObject *obj, uintN argc,
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function getPropertyPriority requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -290,10 +294,6 @@ CSSStyleDeclarationGetPropertyPriority(JSContext *cx, JSObject *obj, uintN argc,
|
|||
|
||||
nsJSUtils::nsConvertStringToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function getPropertyPriority requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -314,7 +314,10 @@ CSSStyleDeclarationSetProperty(JSContext *cx, JSObject *obj, uintN argc, jsval *
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "cssstyledeclaration.setproperty", &ok);
|
||||
if (!ok) {
|
||||
|
@ -323,21 +326,20 @@ CSSStyleDeclarationSetProperty(JSContext *cx, JSObject *obj, uintN argc, jsval *
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 3) {
|
||||
{
|
||||
if (argc < 3) {
|
||||
JS_ReportError(cx, "Function setProperty requires 3 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b1, cx, argv[1]);
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b2, cx, argv[2]);
|
||||
|
||||
if (NS_OK != nativeThis->SetProperty(b0, b1, b2)) {
|
||||
|
@ -346,10 +348,6 @@ CSSStyleDeclarationSetProperty(JSContext *cx, JSObject *obj, uintN argc, jsval *
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function setProperty requires 3 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -369,7 +367,10 @@ CSSStyleDeclarationItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "cssstyledeclaration.item", &ok);
|
||||
if (!ok) {
|
||||
|
@ -378,16 +379,17 @@ CSSStyleDeclarationItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function item requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
|
@ -400,10 +402,6 @@ CSSStyleDeclarationItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
nsJSUtils::nsConvertStringToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function item requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -185,7 +185,10 @@ CSSStyleRuleCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "cssstylerulecollection.item", &ok);
|
||||
if (!ok) {
|
||||
|
@ -194,16 +197,17 @@ CSSStyleRuleCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function item requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
|
@ -216,10 +220,6 @@ CSSStyleRuleCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function item requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -272,7 +272,10 @@ CSSStyleSheetInsertRule(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "cssstylesheet.insertrule", &ok);
|
||||
if (!ok) {
|
||||
|
@ -281,19 +284,19 @@ CSSStyleSheetInsertRule(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 2) {
|
||||
{
|
||||
if (argc < 2) {
|
||||
JS_ReportError(cx, "Function insertRule requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[1], (int32 *)&b1)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
return JS_FALSE;
|
||||
|
@ -305,10 +308,6 @@ CSSStyleSheetInsertRule(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
*rval = INT_TO_JSVAL(nativeRet);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function insertRule requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -327,7 +326,10 @@ CSSStyleSheetDeleteRule(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "cssstylesheet.deleterule", &ok);
|
||||
if (!ok) {
|
||||
|
@ -336,16 +338,17 @@ CSSStyleSheetDeleteRule(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function deleteRule requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
|
@ -358,10 +361,6 @@ CSSStyleSheetDeleteRule(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function deleteRule requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -228,7 +228,10 @@ EventPreventBubble(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "event.preventbubble", &ok);
|
||||
if (!ok) {
|
||||
|
@ -237,16 +240,13 @@ EventPreventBubble(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->PreventBubble()) {
|
||||
return JS_FALSE;
|
||||
|
@ -254,10 +254,6 @@ EventPreventBubble(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function preventBubble requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -275,7 +271,10 @@ EventPreventCapture(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "event.preventcapture", &ok);
|
||||
if (!ok) {
|
||||
|
@ -284,16 +283,13 @@ EventPreventCapture(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->PreventCapture()) {
|
||||
return JS_FALSE;
|
||||
|
@ -301,10 +297,6 @@ EventPreventCapture(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function preventCapture requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -322,7 +314,10 @@ EventPreventDefault(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "event.preventdefault", &ok);
|
||||
if (!ok) {
|
||||
|
@ -331,16 +326,13 @@ EventPreventDefault(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->PreventDefault()) {
|
||||
return JS_FALSE;
|
||||
|
@ -348,10 +340,6 @@ EventPreventDefault(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function preventDefault requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -533,7 +533,10 @@ HTMLAnchorElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmlanchorelement.blur", &ok);
|
||||
if (!ok) {
|
||||
|
@ -542,16 +545,13 @@ HTMLAnchorElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Blur()) {
|
||||
return JS_FALSE;
|
||||
|
@ -559,10 +559,6 @@ HTMLAnchorElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function blur requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -580,7 +576,10 @@ HTMLAnchorElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmlanchorelement.focus", &ok);
|
||||
if (!ok) {
|
||||
|
@ -589,16 +588,13 @@ HTMLAnchorElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Focus()) {
|
||||
return JS_FALSE;
|
||||
|
@ -606,10 +602,6 @@ HTMLAnchorElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function focus requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -365,7 +365,10 @@ NSHTMLButtonElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "nshtmlbuttonelement.blur", &ok);
|
||||
if (!ok) {
|
||||
|
@ -374,16 +377,13 @@ NSHTMLButtonElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Blur()) {
|
||||
return JS_FALSE;
|
||||
|
@ -391,10 +391,6 @@ NSHTMLButtonElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function blur requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -418,7 +414,10 @@ NSHTMLButtonElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "nshtmlbuttonelement.focus", &ok);
|
||||
if (!ok) {
|
||||
|
@ -427,16 +426,13 @@ NSHTMLButtonElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Focus()) {
|
||||
return JS_FALSE;
|
||||
|
@ -444,10 +440,6 @@ NSHTMLButtonElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function focus requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -215,7 +215,10 @@ HTMLCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmlcollection.item", &ok);
|
||||
if (!ok) {
|
||||
|
@ -224,16 +227,17 @@ HTMLCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function item requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
|
@ -246,10 +250,6 @@ HTMLCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function item requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -269,7 +269,10 @@ HTMLCollectionNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmlcollection.nameditem", &ok);
|
||||
if (!ok) {
|
||||
|
@ -278,16 +281,17 @@ HTMLCollectionNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function namedItem requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -297,10 +301,6 @@ HTMLCollectionNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function namedItem requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -799,7 +799,10 @@ HTMLDocumentClose(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmldocument.close", &ok);
|
||||
if (!ok) {
|
||||
|
@ -808,16 +811,13 @@ HTMLDocumentClose(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Close()) {
|
||||
return JS_FALSE;
|
||||
|
@ -825,10 +825,6 @@ HTMLDocumentClose(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function close requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -848,7 +844,10 @@ HTMLDocumentGetElementById(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmldocument.getelementbyid", &ok);
|
||||
if (!ok) {
|
||||
|
@ -857,16 +856,17 @@ HTMLDocumentGetElementById(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function getElementById requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -876,10 +876,6 @@ HTMLDocumentGetElementById(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function getElementById requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -899,7 +895,10 @@ HTMLDocumentGetElementsByName(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmldocument.getelementsbyname", &ok);
|
||||
if (!ok) {
|
||||
|
@ -908,16 +907,17 @@ HTMLDocumentGetElementsByName(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function getElementsByName requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -927,10 +927,6 @@ HTMLDocumentGetElementsByName(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function getElementsByName requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -955,7 +951,10 @@ NSHTMLDocumentGetSelection(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "nshtmldocument.getselection", &ok);
|
||||
if (!ok) {
|
||||
|
@ -964,16 +963,13 @@ NSHTMLDocumentGetSelection(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->GetSelection(nativeRet)) {
|
||||
return JS_FALSE;
|
||||
|
@ -981,10 +977,6 @@ NSHTMLDocumentGetSelection(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
|
|||
|
||||
nsJSUtils::nsConvertStringToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function getSelection requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -1010,7 +1002,10 @@ NSHTMLDocumentNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "nshtmldocument.nameditem", &ok);
|
||||
if (!ok) {
|
||||
|
@ -1019,16 +1014,17 @@ NSHTMLDocumentNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function namedItem requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -1038,10 +1034,6 @@ NSHTMLDocumentNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function namedItem requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -1065,7 +1057,10 @@ NSHTMLDocumentOpen(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "nshtmldocument.open", &ok);
|
||||
if (!ok) {
|
||||
|
@ -1074,16 +1069,13 @@ NSHTMLDocumentOpen(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Open(cx, argv+0, argc-0)) {
|
||||
return JS_FALSE;
|
||||
|
@ -1091,10 +1083,6 @@ NSHTMLDocumentOpen(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function open requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -1118,7 +1106,10 @@ NSHTMLDocumentWrite(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "nshtmldocument.write", &ok);
|
||||
if (!ok) {
|
||||
|
@ -1127,16 +1118,13 @@ NSHTMLDocumentWrite(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Write(cx, argv+0, argc-0)) {
|
||||
return JS_FALSE;
|
||||
|
@ -1144,10 +1132,6 @@ NSHTMLDocumentWrite(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function write requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -1171,7 +1155,10 @@ NSHTMLDocumentWriteln(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "nshtmldocument.writeln", &ok);
|
||||
if (!ok) {
|
||||
|
@ -1180,16 +1167,13 @@ NSHTMLDocumentWriteln(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Writeln(cx, argv+0, argc-0)) {
|
||||
return JS_FALSE;
|
||||
|
@ -1197,10 +1181,6 @@ NSHTMLDocumentWriteln(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function writeln requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ GetHTMLEmbedElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
return JS_FALSE;
|
||||
}
|
||||
nsAutoString prop;
|
||||
if (NS_OK == a->GetAlign(prop)) {
|
||||
if (NS_SUCCEEDED(a->GetAlign(prop))) {
|
||||
nsJSUtils::nsConvertStringToJSVal(prop, cx, vp);
|
||||
}
|
||||
else {
|
||||
|
@ -102,7 +102,7 @@ GetHTMLEmbedElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
return JS_FALSE;
|
||||
}
|
||||
nsAutoString prop;
|
||||
if (NS_OK == a->GetHeight(prop)) {
|
||||
if (NS_SUCCEEDED(a->GetHeight(prop))) {
|
||||
nsJSUtils::nsConvertStringToJSVal(prop, cx, vp);
|
||||
}
|
||||
else {
|
||||
|
@ -118,7 +118,7 @@ GetHTMLEmbedElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
return JS_FALSE;
|
||||
}
|
||||
nsAutoString prop;
|
||||
if (NS_OK == a->GetName(prop)) {
|
||||
if (NS_SUCCEEDED(a->GetName(prop))) {
|
||||
nsJSUtils::nsConvertStringToJSVal(prop, cx, vp);
|
||||
}
|
||||
else {
|
||||
|
@ -134,7 +134,7 @@ GetHTMLEmbedElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
return JS_FALSE;
|
||||
}
|
||||
nsAutoString prop;
|
||||
if (NS_OK == a->GetSrc(prop)) {
|
||||
if (NS_SUCCEEDED(a->GetSrc(prop))) {
|
||||
nsJSUtils::nsConvertStringToJSVal(prop, cx, vp);
|
||||
}
|
||||
else {
|
||||
|
@ -150,7 +150,7 @@ GetHTMLEmbedElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
return JS_FALSE;
|
||||
}
|
||||
nsAutoString prop;
|
||||
if (NS_OK == a->GetType(prop)) {
|
||||
if (NS_SUCCEEDED(a->GetType(prop))) {
|
||||
nsJSUtils::nsConvertStringToJSVal(prop, cx, vp);
|
||||
}
|
||||
else {
|
||||
|
@ -166,7 +166,7 @@ GetHTMLEmbedElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
return JS_FALSE;
|
||||
}
|
||||
nsAutoString prop;
|
||||
if (NS_OK == a->GetWidth(prop)) {
|
||||
if (NS_SUCCEEDED(a->GetWidth(prop))) {
|
||||
nsJSUtils::nsConvertStringToJSVal(prop, cx, vp);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -449,7 +449,10 @@ HTMLFormElementSubmit(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmlformelement.submit", &ok);
|
||||
if (!ok) {
|
||||
|
@ -458,16 +461,13 @@ HTMLFormElementSubmit(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Submit()) {
|
||||
return JS_FALSE;
|
||||
|
@ -475,10 +475,6 @@ HTMLFormElementSubmit(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function submit requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -496,7 +492,10 @@ HTMLFormElementReset(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmlformelement.reset", &ok);
|
||||
if (!ok) {
|
||||
|
@ -505,16 +504,13 @@ HTMLFormElementReset(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Reset()) {
|
||||
return JS_FALSE;
|
||||
|
@ -522,10 +518,6 @@ HTMLFormElementReset(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function reset requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -551,7 +543,10 @@ NSHTMLFormElementNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "nshtmlformelement.nameditem", &ok);
|
||||
if (!ok) {
|
||||
|
@ -560,16 +555,17 @@ NSHTMLFormElementNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function namedItem requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -579,10 +575,6 @@ NSHTMLFormElementNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function namedItem requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -710,7 +710,10 @@ HTMLInputElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.blur", &ok);
|
||||
if (!ok) {
|
||||
|
@ -719,16 +722,13 @@ HTMLInputElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Blur()) {
|
||||
return JS_FALSE;
|
||||
|
@ -736,10 +736,6 @@ HTMLInputElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function blur requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -757,7 +753,10 @@ HTMLInputElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.focus", &ok);
|
||||
if (!ok) {
|
||||
|
@ -766,16 +765,13 @@ HTMLInputElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Focus()) {
|
||||
return JS_FALSE;
|
||||
|
@ -783,10 +779,6 @@ HTMLInputElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function focus requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -804,7 +796,10 @@ HTMLInputElementSelect(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.select", &ok);
|
||||
if (!ok) {
|
||||
|
@ -813,16 +808,13 @@ HTMLInputElementSelect(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Select()) {
|
||||
return JS_FALSE;
|
||||
|
@ -830,10 +822,6 @@ HTMLInputElementSelect(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function select requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -851,7 +839,10 @@ HTMLInputElementClick(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.click", &ok);
|
||||
if (!ok) {
|
||||
|
@ -860,16 +851,13 @@ HTMLInputElementClick(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Click()) {
|
||||
return JS_FALSE;
|
||||
|
@ -877,10 +865,6 @@ HTMLInputElementClick(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function click requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -500,7 +500,10 @@ HTMLSelectElementAdd(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmlselectelement.add", &ok);
|
||||
if (!ok) {
|
||||
|
@ -509,16 +512,17 @@ HTMLSelectElementAdd(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 2) {
|
||||
{
|
||||
if (argc < 2) {
|
||||
JS_ReportError(cx, "Function add requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kIHTMLElementIID,
|
||||
|
@ -527,7 +531,6 @@ HTMLSelectElementAdd(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
|||
argv[0])) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b1,
|
||||
kIHTMLElementIID,
|
||||
"HTMLElement",
|
||||
|
@ -542,10 +545,6 @@ HTMLSelectElementAdd(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function add requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -564,7 +563,10 @@ HTMLSelectElementRemove(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmlselectelement.remove", &ok);
|
||||
if (!ok) {
|
||||
|
@ -573,16 +575,17 @@ HTMLSelectElementRemove(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function remove requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
|
@ -595,10 +598,6 @@ HTMLSelectElementRemove(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function remove requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -616,7 +615,10 @@ HTMLSelectElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmlselectelement.blur", &ok);
|
||||
if (!ok) {
|
||||
|
@ -625,16 +627,13 @@ HTMLSelectElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Blur()) {
|
||||
return JS_FALSE;
|
||||
|
@ -642,10 +641,6 @@ HTMLSelectElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function blur requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -663,7 +658,10 @@ HTMLSelectElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmlselectelement.focus", &ok);
|
||||
if (!ok) {
|
||||
|
@ -672,16 +670,13 @@ HTMLSelectElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Focus()) {
|
||||
return JS_FALSE;
|
||||
|
@ -689,10 +684,6 @@ HTMLSelectElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function focus requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -718,7 +709,10 @@ NSHTMLSelectElementItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "nshtmlselectelement.item", &ok);
|
||||
if (!ok) {
|
||||
|
@ -727,16 +721,17 @@ NSHTMLSelectElementItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function item requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
|
@ -749,10 +744,6 @@ NSHTMLSelectElementItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function item requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -590,7 +590,10 @@ HTMLTableElementCreateTHead(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmltableelement.createthead", &ok);
|
||||
if (!ok) {
|
||||
|
@ -599,16 +602,13 @@ HTMLTableElementCreateTHead(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->CreateTHead(&nativeRet)) {
|
||||
return JS_FALSE;
|
||||
|
@ -616,10 +616,6 @@ HTMLTableElementCreateTHead(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function createTHead requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -637,7 +633,10 @@ HTMLTableElementDeleteTHead(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmltableelement.deletethead", &ok);
|
||||
if (!ok) {
|
||||
|
@ -646,16 +645,13 @@ HTMLTableElementDeleteTHead(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->DeleteTHead()) {
|
||||
return JS_FALSE;
|
||||
|
@ -663,10 +659,6 @@ HTMLTableElementDeleteTHead(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function deleteTHead requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -685,7 +677,10 @@ HTMLTableElementCreateTFoot(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmltableelement.createtfoot", &ok);
|
||||
if (!ok) {
|
||||
|
@ -694,16 +689,13 @@ HTMLTableElementCreateTFoot(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->CreateTFoot(&nativeRet)) {
|
||||
return JS_FALSE;
|
||||
|
@ -711,10 +703,6 @@ HTMLTableElementCreateTFoot(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function createTFoot requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -732,7 +720,10 @@ HTMLTableElementDeleteTFoot(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmltableelement.deletetfoot", &ok);
|
||||
if (!ok) {
|
||||
|
@ -741,16 +732,13 @@ HTMLTableElementDeleteTFoot(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->DeleteTFoot()) {
|
||||
return JS_FALSE;
|
||||
|
@ -758,10 +746,6 @@ HTMLTableElementDeleteTFoot(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function deleteTFoot requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -780,7 +764,10 @@ HTMLTableElementCreateCaption(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmltableelement.createcaption", &ok);
|
||||
if (!ok) {
|
||||
|
@ -789,16 +776,13 @@ HTMLTableElementCreateCaption(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->CreateCaption(&nativeRet)) {
|
||||
return JS_FALSE;
|
||||
|
@ -806,10 +790,6 @@ HTMLTableElementCreateCaption(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function createCaption requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -827,7 +807,10 @@ HTMLTableElementDeleteCaption(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmltableelement.deletecaption", &ok);
|
||||
if (!ok) {
|
||||
|
@ -836,16 +819,13 @@ HTMLTableElementDeleteCaption(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->DeleteCaption()) {
|
||||
return JS_FALSE;
|
||||
|
@ -853,10 +833,6 @@ HTMLTableElementDeleteCaption(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function deleteCaption requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -876,7 +852,10 @@ HTMLTableElementInsertRow(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmltableelement.insertrow", &ok);
|
||||
if (!ok) {
|
||||
|
@ -885,16 +864,17 @@ HTMLTableElementInsertRow(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function insertRow requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
|
@ -907,10 +887,6 @@ HTMLTableElementInsertRow(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function insertRow requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -929,7 +905,10 @@ HTMLTableElementDeleteRow(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmltableelement.deleterow", &ok);
|
||||
if (!ok) {
|
||||
|
@ -938,16 +917,17 @@ HTMLTableElementDeleteRow(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function deleteRow requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
|
@ -960,10 +940,6 @@ HTMLTableElementDeleteRow(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function deleteRow requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -429,7 +429,10 @@ HTMLTableRowElementInsertCell(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmltablerowelement.insertcell", &ok);
|
||||
if (!ok) {
|
||||
|
@ -438,16 +441,17 @@ HTMLTableRowElementInsertCell(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function insertCell requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
|
@ -460,10 +464,6 @@ HTMLTableRowElementInsertCell(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function insertCell requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -482,7 +482,10 @@ HTMLTableRowElementDeleteCell(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmltablerowelement.deletecell", &ok);
|
||||
if (!ok) {
|
||||
|
@ -491,16 +494,17 @@ HTMLTableRowElementDeleteCell(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function deleteCell requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
|
@ -513,10 +517,6 @@ HTMLTableRowElementDeleteCell(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function deleteCell requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -304,7 +304,10 @@ HTMLTableSectionElementInsertRow(JSContext *cx, JSObject *obj, uintN argc, jsval
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmltablesectionelement.insertrow", &ok);
|
||||
if (!ok) {
|
||||
|
@ -313,16 +316,17 @@ HTMLTableSectionElementInsertRow(JSContext *cx, JSObject *obj, uintN argc, jsval
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function insertRow requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
|
@ -335,10 +339,6 @@ HTMLTableSectionElementInsertRow(JSContext *cx, JSObject *obj, uintN argc, jsval
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function insertRow requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -357,7 +357,10 @@ HTMLTableSectionElementDeleteRow(JSContext *cx, JSObject *obj, uintN argc, jsval
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmltablesectionelement.deleterow", &ok);
|
||||
if (!ok) {
|
||||
|
@ -366,16 +369,17 @@ HTMLTableSectionElementDeleteRow(JSContext *cx, JSObject *obj, uintN argc, jsval
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function deleteRow requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
|
@ -388,10 +392,6 @@ HTMLTableSectionElementDeleteRow(JSContext *cx, JSObject *obj, uintN argc, jsval
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function deleteRow requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -496,7 +496,10 @@ HTMLTextAreaElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmltextareaelement.blur", &ok);
|
||||
if (!ok) {
|
||||
|
@ -505,16 +508,13 @@ HTMLTextAreaElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Blur()) {
|
||||
return JS_FALSE;
|
||||
|
@ -522,10 +522,6 @@ HTMLTextAreaElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function blur requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -543,7 +539,10 @@ HTMLTextAreaElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmltextareaelement.focus", &ok);
|
||||
if (!ok) {
|
||||
|
@ -552,16 +551,13 @@ HTMLTextAreaElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Focus()) {
|
||||
return JS_FALSE;
|
||||
|
@ -569,10 +565,6 @@ HTMLTextAreaElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function focus requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -590,7 +582,10 @@ HTMLTextAreaElementSelect(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "htmltextareaelement.select", &ok);
|
||||
if (!ok) {
|
||||
|
@ -599,16 +594,13 @@ HTMLTextAreaElementSelect(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Select()) {
|
||||
return JS_FALSE;
|
||||
|
@ -616,10 +608,6 @@ HTMLTextAreaElementSelect(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function select requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -271,7 +271,10 @@ RangeSetStart(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "range.setstart", &ok);
|
||||
if (!ok) {
|
||||
|
@ -280,16 +283,17 @@ RangeSetStart(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 2) {
|
||||
{
|
||||
if (argc < 2) {
|
||||
JS_ReportError(cx, "Function setStart requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kINodeIID,
|
||||
|
@ -298,7 +302,6 @@ RangeSetStart(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
|
|||
argv[0])) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[1], (int32 *)&b1)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
return JS_FALSE;
|
||||
|
@ -310,10 +313,6 @@ RangeSetStart(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function setStart requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -332,7 +331,10 @@ RangeSetStartBefore(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "range.setstartbefore", &ok);
|
||||
if (!ok) {
|
||||
|
@ -341,16 +343,17 @@ RangeSetStartBefore(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function setStartBefore requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kINodeIID,
|
||||
|
@ -366,10 +369,6 @@ RangeSetStartBefore(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function setStartBefore requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -388,7 +387,10 @@ RangeSetStartAfter(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "range.setstartafter", &ok);
|
||||
if (!ok) {
|
||||
|
@ -397,16 +399,17 @@ RangeSetStartAfter(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function setStartAfter requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kINodeIID,
|
||||
|
@ -422,10 +425,6 @@ RangeSetStartAfter(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function setStartAfter requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -445,7 +444,10 @@ RangeSetEnd(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "range.setend", &ok);
|
||||
if (!ok) {
|
||||
|
@ -454,16 +456,17 @@ RangeSetEnd(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 2) {
|
||||
{
|
||||
if (argc < 2) {
|
||||
JS_ReportError(cx, "Function setEnd requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kINodeIID,
|
||||
|
@ -472,7 +475,6 @@ RangeSetEnd(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
argv[0])) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[1], (int32 *)&b1)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
return JS_FALSE;
|
||||
|
@ -484,10 +486,6 @@ RangeSetEnd(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function setEnd requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -506,7 +504,10 @@ RangeSetEndBefore(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "range.setendbefore", &ok);
|
||||
if (!ok) {
|
||||
|
@ -515,16 +516,17 @@ RangeSetEndBefore(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function setEndBefore requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kINodeIID,
|
||||
|
@ -540,10 +542,6 @@ RangeSetEndBefore(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function setEndBefore requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -562,7 +560,10 @@ RangeSetEndAfter(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "range.setendafter", &ok);
|
||||
if (!ok) {
|
||||
|
@ -571,16 +572,17 @@ RangeSetEndAfter(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function setEndAfter requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kINodeIID,
|
||||
|
@ -596,10 +598,6 @@ RangeSetEndAfter(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function setEndAfter requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -618,7 +616,10 @@ RangeCollapse(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "range.collapse", &ok);
|
||||
if (!ok) {
|
||||
|
@ -627,16 +628,17 @@ RangeCollapse(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function collapse requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!nsJSUtils::nsConvertJSValToBool(&b0, cx, argv[0])) {
|
||||
return JS_FALSE;
|
||||
|
@ -648,10 +650,6 @@ RangeCollapse(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function collapse requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -670,7 +668,10 @@ RangeSelectNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "range.selectnode", &ok);
|
||||
if (!ok) {
|
||||
|
@ -679,16 +680,17 @@ RangeSelectNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function selectNode requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kINodeIID,
|
||||
|
@ -704,10 +706,6 @@ RangeSelectNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function selectNode requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -726,7 +724,10 @@ RangeSelectNodeContents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "range.selectnodecontents", &ok);
|
||||
if (!ok) {
|
||||
|
@ -735,16 +736,17 @@ RangeSelectNodeContents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function selectNodeContents requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kINodeIID,
|
||||
|
@ -760,10 +762,6 @@ RangeSelectNodeContents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function selectNodeContents requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -784,7 +782,10 @@ RangeCompareEndPoints(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "range.compareendpoints", &ok);
|
||||
if (!ok) {
|
||||
|
@ -793,22 +794,22 @@ RangeCompareEndPoints(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 2) {
|
||||
{
|
||||
if (argc < 2) {
|
||||
JS_ReportError(cx, "Function compareEndPoints requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b1,
|
||||
kIRangeIID,
|
||||
"Range",
|
||||
|
@ -823,10 +824,6 @@ RangeCompareEndPoints(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
|
||||
*rval = INT_TO_JSVAL(nativeRet);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function compareEndPoints requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -844,7 +841,10 @@ RangeDeleteContents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "range.deletecontents", &ok);
|
||||
if (!ok) {
|
||||
|
@ -853,16 +853,13 @@ RangeDeleteContents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->DeleteContents()) {
|
||||
return JS_FALSE;
|
||||
|
@ -870,10 +867,6 @@ RangeDeleteContents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function deleteContents requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -892,7 +885,10 @@ RangeExtractContents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "range.extractcontents", &ok);
|
||||
if (!ok) {
|
||||
|
@ -901,16 +897,13 @@ RangeExtractContents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->ExtractContents(&nativeRet)) {
|
||||
return JS_FALSE;
|
||||
|
@ -918,10 +911,6 @@ RangeExtractContents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function extractContents requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -940,7 +929,10 @@ RangeCloneContents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "range.clonecontents", &ok);
|
||||
if (!ok) {
|
||||
|
@ -949,16 +941,13 @@ RangeCloneContents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->CloneContents(&nativeRet)) {
|
||||
return JS_FALSE;
|
||||
|
@ -966,10 +955,6 @@ RangeCloneContents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function cloneContents requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -988,7 +973,10 @@ RangeInsertNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "range.insertnode", &ok);
|
||||
if (!ok) {
|
||||
|
@ -997,16 +985,17 @@ RangeInsertNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function insertNode requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kINodeIID,
|
||||
|
@ -1022,10 +1011,6 @@ RangeInsertNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function insertNode requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -1044,7 +1029,10 @@ RangeSurroundContents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "range.surroundcontents", &ok);
|
||||
if (!ok) {
|
||||
|
@ -1053,16 +1041,17 @@ RangeSurroundContents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function surroundContents requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kINodeIID,
|
||||
|
@ -1078,10 +1067,6 @@ RangeSurroundContents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function surroundContents requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -1100,7 +1085,10 @@ RangeClone(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "range.clone", &ok);
|
||||
if (!ok) {
|
||||
|
@ -1109,16 +1097,13 @@ RangeClone(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Clone(&nativeRet)) {
|
||||
return JS_FALSE;
|
||||
|
@ -1126,10 +1111,6 @@ RangeClone(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function clone requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -1148,7 +1129,10 @@ RangeToString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "range.tostring", &ok);
|
||||
if (!ok) {
|
||||
|
@ -1157,16 +1141,13 @@ RangeToString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->ToString(nativeRet)) {
|
||||
return JS_FALSE;
|
||||
|
@ -1174,10 +1155,6 @@ RangeToString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
|
|||
|
||||
nsJSUtils::nsConvertStringToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function toString requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -1203,7 +1180,10 @@ NSRangeCreateContextualFragment(JSContext *cx, JSObject *obj, uintN argc, jsval
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "nsrange.createcontextualfragment", &ok);
|
||||
if (!ok) {
|
||||
|
@ -1212,16 +1192,17 @@ NSRangeCreateContextualFragment(JSContext *cx, JSObject *obj, uintN argc, jsval
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function createContextualFragment requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -1231,10 +1212,6 @@ NSRangeCreateContextualFragment(JSContext *cx, JSObject *obj, uintN argc, jsval
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function createContextualFragment requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -1260,7 +1237,10 @@ NSRangeIsValidFragment(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "nsrange.isvalidfragment", &ok);
|
||||
if (!ok) {
|
||||
|
@ -1269,16 +1249,17 @@ NSRangeIsValidFragment(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function isValidFragment requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -1288,10 +1269,6 @@ NSRangeIsValidFragment(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
|
||||
*rval = BOOLEAN_TO_JSVAL(nativeRet);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function isValidFragment requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ GetSelectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
return JS_FALSE;
|
||||
}
|
||||
nsIDOMNode* prop;
|
||||
if (NS_OK == a->GetAnchorNode(&prop)) {
|
||||
if (NS_SUCCEEDED(a->GetAnchorNode(&prop))) {
|
||||
// get the js object
|
||||
nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ GetSelectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
return JS_FALSE;
|
||||
}
|
||||
PRInt32 prop;
|
||||
if (NS_OK == a->GetAnchorOffset(&prop)) {
|
||||
if (NS_SUCCEEDED(a->GetAnchorOffset(&prop))) {
|
||||
*vp = INT_TO_JSVAL(prop);
|
||||
}
|
||||
else {
|
||||
|
@ -121,7 +121,7 @@ GetSelectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
return JS_FALSE;
|
||||
}
|
||||
nsIDOMNode* prop;
|
||||
if (NS_OK == a->GetFocusNode(&prop)) {
|
||||
if (NS_SUCCEEDED(a->GetFocusNode(&prop))) {
|
||||
// get the js object
|
||||
nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ GetSelectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
return JS_FALSE;
|
||||
}
|
||||
PRInt32 prop;
|
||||
if (NS_OK == a->GetFocusOffset(&prop)) {
|
||||
if (NS_SUCCEEDED(a->GetFocusOffset(&prop))) {
|
||||
*vp = INT_TO_JSVAL(prop);
|
||||
}
|
||||
else {
|
||||
|
@ -154,7 +154,7 @@ GetSelectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
return JS_FALSE;
|
||||
}
|
||||
PRBool prop;
|
||||
if (NS_OK == a->GetIsCollapsed(&prop)) {
|
||||
if (NS_SUCCEEDED(a->GetIsCollapsed(&prop))) {
|
||||
*vp = BOOLEAN_TO_JSVAL(prop);
|
||||
}
|
||||
else {
|
||||
|
@ -170,7 +170,7 @@ GetSelectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
return JS_FALSE;
|
||||
}
|
||||
PRInt32 prop;
|
||||
if (NS_OK == a->GetRangeCount(&prop)) {
|
||||
if (NS_SUCCEEDED(a->GetRangeCount(&prop))) {
|
||||
*vp = INT_TO_JSVAL(prop);
|
||||
}
|
||||
else {
|
||||
|
@ -270,7 +270,10 @@ SelectionGetRangeAt(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "selection.getrangeat", &ok);
|
||||
if (!ok) {
|
||||
|
@ -279,16 +282,17 @@ SelectionGetRangeAt(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function getRangeAt requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
|
@ -301,10 +305,6 @@ SelectionGetRangeAt(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function getRangeAt requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -322,7 +322,10 @@ SelectionClearSelection(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "selection.clearselection", &ok);
|
||||
if (!ok) {
|
||||
|
@ -331,16 +334,13 @@ SelectionClearSelection(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->ClearSelection()) {
|
||||
return JS_FALSE;
|
||||
|
@ -348,10 +348,6 @@ SelectionClearSelection(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function clearSelection requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -371,7 +367,10 @@ SelectionCollapse(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "selection.collapse", &ok);
|
||||
if (!ok) {
|
||||
|
@ -380,16 +379,17 @@ SelectionCollapse(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 2) {
|
||||
{
|
||||
if (argc < 2) {
|
||||
JS_ReportError(cx, "Function collapse requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kINodeIID,
|
||||
|
@ -398,7 +398,6 @@ SelectionCollapse(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
argv[0])) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[1], (int32 *)&b1)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
return JS_FALSE;
|
||||
|
@ -410,10 +409,6 @@ SelectionCollapse(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function collapse requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -433,7 +428,10 @@ SelectionExtend(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "selection.extend", &ok);
|
||||
if (!ok) {
|
||||
|
@ -442,16 +440,17 @@ SelectionExtend(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 2) {
|
||||
{
|
||||
if (argc < 2) {
|
||||
JS_ReportError(cx, "Function extend requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kINodeIID,
|
||||
|
@ -460,7 +459,6 @@ SelectionExtend(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
argv[0])) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_ValueToInt32(cx, argv[1], (int32 *)&b1)) {
|
||||
JS_ReportError(cx, "Parameter must be a number");
|
||||
return JS_FALSE;
|
||||
|
@ -472,10 +470,6 @@ SelectionExtend(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function extend requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -488,15 +482,18 @@ PR_STATIC_CALLBACK(JSBool)
|
|||
SelectionContainsNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMSelection *nativeThis = (nsIDOMSelection*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
PRBool nativeRet;
|
||||
nsIDOMNodePtr b0;
|
||||
PRBool b1;
|
||||
PRBool b2;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "selection.containsnode", &ok);
|
||||
if (!ok) {
|
||||
|
@ -505,16 +502,17 @@ SelectionContainsNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 3) {
|
||||
{
|
||||
if (argc < 2) {
|
||||
JS_ReportError(cx, "Function containsNode requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kINodeIID,
|
||||
|
@ -523,24 +521,15 @@ SelectionContainsNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
argv[0])) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!nsJSUtils::nsConvertJSValToBool(&b1, cx, argv[1])) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!nsJSUtils::nsConvertJSValToBool(&b2, cx, argv[2])) {
|
||||
if (NS_OK != nativeThis->ContainsNode(b0, b1, &nativeRet)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (NS_OK != nativeThis->ContainsNode(b0, b1, &b2)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function containsNode requires 3 parameters");
|
||||
return JS_FALSE;
|
||||
*rval = BOOLEAN_TO_JSVAL(nativeRet);
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
|
@ -559,7 +548,10 @@ SelectionDeleteFromDocument(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "selection.deletefromdocument", &ok);
|
||||
if (!ok) {
|
||||
|
@ -568,16 +560,13 @@ SelectionDeleteFromDocument(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->DeleteFromDocument()) {
|
||||
return JS_FALSE;
|
||||
|
@ -585,10 +574,6 @@ SelectionDeleteFromDocument(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function deleteFromDocument requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -607,7 +592,10 @@ SelectionAddRange(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "selection.addrange", &ok);
|
||||
if (!ok) {
|
||||
|
@ -616,16 +604,17 @@ SelectionAddRange(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function addRange requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kIRangeIID,
|
||||
|
@ -641,10 +630,6 @@ SelectionAddRange(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function addRange requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -662,7 +647,10 @@ SelectionStartBatchChanges(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "selection.startbatchchanges", &ok);
|
||||
if (!ok) {
|
||||
|
@ -671,16 +659,13 @@ SelectionStartBatchChanges(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->StartBatchChanges()) {
|
||||
return JS_FALSE;
|
||||
|
@ -688,10 +673,6 @@ SelectionStartBatchChanges(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function startBatchChanges requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -709,7 +690,10 @@ SelectionEndBatchChanges(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "selection.endbatchchanges", &ok);
|
||||
if (!ok) {
|
||||
|
@ -718,16 +702,13 @@ SelectionEndBatchChanges(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->EndBatchChanges()) {
|
||||
return JS_FALSE;
|
||||
|
@ -735,10 +716,6 @@ SelectionEndBatchChanges(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function endBatchChanges requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -757,7 +734,10 @@ SelectionAddSelectionListener(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "selection.addselectionlistener", &ok);
|
||||
if (!ok) {
|
||||
|
@ -766,16 +746,17 @@ SelectionAddSelectionListener(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function addSelectionListener requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kISelectionListenerIID,
|
||||
|
@ -791,10 +772,6 @@ SelectionAddSelectionListener(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function addSelectionListener requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -813,7 +790,10 @@ SelectionRemoveSelectionListener(JSContext *cx, JSObject *obj, uintN argc, jsval
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "selection.removeselectionlistener", &ok);
|
||||
if (!ok) {
|
||||
|
@ -822,16 +802,17 @@ SelectionRemoveSelectionListener(JSContext *cx, JSObject *obj, uintN argc, jsval
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function removeSelectionListener requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kISelectionListenerIID,
|
||||
|
@ -847,10 +828,6 @@ SelectionRemoveSelectionListener(JSContext *cx, JSObject *obj, uintN argc, jsval
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function removeSelectionListener requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -898,7 +875,7 @@ static JSFunctionSpec SelectionMethods[] =
|
|||
{"clearSelection", SelectionClearSelection, 0},
|
||||
{"collapse", SelectionCollapse, 2},
|
||||
{"extend", SelectionExtend, 2},
|
||||
{"containsNode", SelectionContainsNode, 3},
|
||||
{"containsNode", SelectionContainsNode, 2},
|
||||
{"deleteFromDocument", SelectionDeleteFromDocument, 0},
|
||||
{"addRange", SelectionAddRange, 1},
|
||||
{"startBatchChanges", SelectionStartBatchChanges, 0},
|
||||
|
|
|
@ -151,7 +151,10 @@ SelectionListenerNotifySelectionChanged(JSContext *cx, JSObject *obj, uintN argc
|
|||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK == scriptCX->GetSecurityManager(&secMan)) {
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "selectionlistener.notifyselectionchanged", &ok);
|
||||
if (!ok) {
|
||||
|
@ -160,16 +163,13 @@ SelectionListenerNotifySelectionChanged(JSContext *cx, JSObject *obj, uintN argc
|
|||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->NotifySelectionChanged()) {
|
||||
return JS_FALSE;
|
||||
|
@ -177,10 +177,6 @@ SelectionListenerNotifySelectionChanged(JSContext *cx, JSObject *obj, uintN argc
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function notifySelectionChanged requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,11 @@ interface BrowserAppCore : BaseAppCore
|
|||
|
||||
void back();
|
||||
void forward();
|
||||
void reload(in int reloadType);
|
||||
|
||||
/* XXXbe reloadType must be unsigned long to match nsIChannel.idl's
|
||||
nsLoadFlags typedef; pls. fix by converting this interface
|
||||
from DOM IDL to XPIDL */
|
||||
void reload(in unsigned long reloadType);
|
||||
void stop();
|
||||
void loadUrl(in wstring url);
|
||||
void loadInitialPage();
|
||||
|
|
|
@ -63,7 +63,7 @@ public:
|
|||
NS_IMETHOD Find(const nsString& aId, nsIDOMBaseAppCore** aReturn) { return _to##Find(aId, aReturn); } \
|
||||
|
||||
|
||||
extern nsresult NS_InitAppCoresManagerClass(nsIScriptContext *aContext, void **aPrototype);
|
||||
extern "C" NS_DOM nsresult NS_InitAppCoresManagerClass(nsIScriptContext *aContext, void **aPrototype);
|
||||
|
||||
extern "C" NS_DOM nsresult NS_NewScriptAppCoresManager(nsIScriptContext *aContext, nsISupports *aSupports, nsISupports *aParent, void **aReturn);
|
||||
|
||||
|
|
|
@ -24,9 +24,6 @@
|
|||
#include "nsString.h"
|
||||
#include "nsIScriptContext.h"
|
||||
#include "nsIDOMBaseAppCore.h"
|
||||
#ifdef NECKO
|
||||
#include "nsIChannel.h" // for nsLoadFlags
|
||||
#endif
|
||||
|
||||
class nsIDOMWindow;
|
||||
|
||||
|
@ -42,11 +39,7 @@ public:
|
|||
|
||||
NS_IMETHOD Forward()=0;
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHOD Reload(nsLoadFlags aReloadType)=0;
|
||||
#else
|
||||
NS_IMETHOD Reload(PRInt32 aReloadType)=0;
|
||||
#endif
|
||||
NS_IMETHOD Reload(PRUint32 aReloadType)=0;
|
||||
|
||||
NS_IMETHOD Stop()=0;
|
||||
|
||||
|
@ -99,16 +92,11 @@ public:
|
|||
NS_IMETHOD FindNext()=0;
|
||||
};
|
||||
|
||||
#ifdef NECKO
|
||||
#define RELOAD_ARG_TYPE nsLoadFlags
|
||||
#else
|
||||
#define RELOAD_ARG_TYPE PRInt32
|
||||
#endif
|
||||
|
||||
#define NS_DECL_IDOMBROWSERAPPCORE \
|
||||
NS_IMETHOD Back(); \
|
||||
NS_IMETHOD Forward(); \
|
||||
NS_IMETHOD Reload(RELOAD_ARG_TYPE aReloadType); \
|
||||
NS_IMETHOD Reload(PRUint32 aReloadType); \
|
||||
NS_IMETHOD Stop(); \
|
||||
NS_IMETHOD LoadUrl(const nsString& aUrl); \
|
||||
NS_IMETHOD LoadInitialPage(); \
|
||||
|
@ -140,7 +128,7 @@ public:
|
|||
#define NS_FORWARD_IDOMBROWSERAPPCORE(_to) \
|
||||
NS_IMETHOD Back() { return _to Back(); } \
|
||||
NS_IMETHOD Forward() { return _to Forward(); } \
|
||||
NS_IMETHOD Reload(RELOAD_ARG_TYPE aReloadType) { return _to Reload(aReloadType); } \
|
||||
NS_IMETHOD Reload(PRUint32 aReloadType) { return _to Reload(aReloadType); } \
|
||||
NS_IMETHOD Stop() { return _to Stop(); } \
|
||||
NS_IMETHOD LoadUrl(const nsString& aUrl) { return _to LoadUrl(aUrl); } \
|
||||
NS_IMETHOD LoadInitialPage() { return _to LoadInitialPage(); } \
|
||||
|
|
|
@ -80,9 +80,9 @@ class nsBrowserAppCore : public nsBaseAppCore,
|
|||
NS_IMETHOD Reload(PRInt32 aType);
|
||||
#endif
|
||||
NS_IMETHOD Stop();
|
||||
NS_IMETHOD BackButtonPopup();
|
||||
NS_IMETHOD ForwardButtonPopup();
|
||||
NS_IMETHOD GotoHistoryIndex(PRInt32 aIndex);
|
||||
NS_IMETHOD BackButtonPopup();
|
||||
NS_IMETHOD ForwardButtonPopup();
|
||||
NS_IMETHOD GotoHistoryIndex(PRInt32 aIndex);
|
||||
|
||||
NS_IMETHOD WalletPreview(nsIDOMWindow* aWin, nsIDOMWindow* aForm);
|
||||
NS_IMETHOD SignonViewer(nsIDOMWindow* aWin);
|
||||
|
@ -224,7 +224,7 @@ class nsBrowserAppCore : public nsBaseAppCore,
|
|||
nsIWebShell * mWebShell; // weak reference
|
||||
nsIWebShell * mContentAreaWebShell; // weak reference
|
||||
|
||||
nsISessionHistory* mSHistory; // this is a service
|
||||
nsISessionHistory* mSHistory; // this is a service
|
||||
|
||||
nsCOMPtr<nsISupports> mSearchContext; // at last, something we really own
|
||||
#ifdef DEBUG_warren
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "nsJSUtils.h"
|
||||
#include "nscore.h"
|
||||
#include "nsIScriptContext.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsIJSScriptObject.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
|
@ -47,7 +48,7 @@ NS_DEF_PTR(nsIDOMBaseAppCore);
|
|||
PR_STATIC_CALLBACK(JSBool)
|
||||
GetAppCoresManagerProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
||||
{
|
||||
nsIDOMAppCoresManager *a = (nsIDOMAppCoresManager*)JS_GetPrivate(cx, obj);
|
||||
nsIDOMAppCoresManager *a = (nsIDOMAppCoresManager*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == a) {
|
||||
|
@ -55,11 +56,18 @@ GetAppCoresManagerProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
}
|
||||
|
||||
if (JSVAL_IS_INT(id)) {
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
PRBool ok = PR_FALSE;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
switch(JSVAL_TO_INT(id)) {
|
||||
case 0:
|
||||
default:
|
||||
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
|
||||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
|
||||
|
@ -75,7 +83,7 @@ GetAppCoresManagerProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
PR_STATIC_CALLBACK(JSBool)
|
||||
SetAppCoresManagerProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
||||
{
|
||||
nsIDOMAppCoresManager *a = (nsIDOMAppCoresManager*)JS_GetPrivate(cx, obj);
|
||||
nsIDOMAppCoresManager *a = (nsIDOMAppCoresManager*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == a) {
|
||||
|
@ -83,11 +91,18 @@ SetAppCoresManagerProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
}
|
||||
|
||||
if (JSVAL_IS_INT(id)) {
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
PRBool ok = PR_FALSE;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
switch(JSVAL_TO_INT(id)) {
|
||||
case 0:
|
||||
default:
|
||||
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
|
||||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
|
||||
|
@ -133,16 +148,31 @@ ResolveAppCoresManager(JSContext *cx, JSObject *obj, jsval id)
|
|||
PR_STATIC_CALLBACK(JSBool)
|
||||
AppCoresManagerStartup(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMAppCoresManager *nativeThis = (nsIDOMAppCoresManager*)JS_GetPrivate(cx, obj);
|
||||
nsIDOMAppCoresManager *nativeThis = (nsIDOMAppCoresManager*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "appcoresmanager.startup", &ok);
|
||||
if (!ok) {
|
||||
//Need to throw error here
|
||||
return JS_FALSE;
|
||||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Startup()) {
|
||||
return JS_FALSE;
|
||||
|
@ -150,10 +180,6 @@ AppCoresManagerStartup(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function Startup requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -165,16 +191,31 @@ AppCoresManagerStartup(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
|
|||
PR_STATIC_CALLBACK(JSBool)
|
||||
AppCoresManagerShutdown(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMAppCoresManager *nativeThis = (nsIDOMAppCoresManager*)JS_GetPrivate(cx, obj);
|
||||
nsIDOMAppCoresManager *nativeThis = (nsIDOMAppCoresManager*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "appcoresmanager.shutdown", &ok);
|
||||
if (!ok) {
|
||||
//Need to throw error here
|
||||
return JS_FALSE;
|
||||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->Shutdown()) {
|
||||
return JS_FALSE;
|
||||
|
@ -182,10 +223,6 @@ AppCoresManagerShutdown(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function Shutdown requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -197,17 +234,36 @@ AppCoresManagerShutdown(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
|
|||
PR_STATIC_CALLBACK(JSBool)
|
||||
AppCoresManagerAdd(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMAppCoresManager *nativeThis = (nsIDOMAppCoresManager*)JS_GetPrivate(cx, obj);
|
||||
nsIDOMAppCoresManager *nativeThis = (nsIDOMAppCoresManager*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
nsIDOMBaseAppCorePtr b0;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "appcoresmanager.add", &ok);
|
||||
if (!ok) {
|
||||
//Need to throw error here
|
||||
return JS_FALSE;
|
||||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function Add requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kIBaseAppCoreIID,
|
||||
|
@ -223,10 +279,6 @@ AppCoresManagerAdd(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function Add requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -238,17 +290,36 @@ AppCoresManagerAdd(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
PR_STATIC_CALLBACK(JSBool)
|
||||
AppCoresManagerRemove(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMAppCoresManager *nativeThis = (nsIDOMAppCoresManager*)JS_GetPrivate(cx, obj);
|
||||
nsIDOMAppCoresManager *nativeThis = (nsIDOMAppCoresManager*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
nsIDOMBaseAppCorePtr b0;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "appcoresmanager.remove", &ok);
|
||||
if (!ok) {
|
||||
//Need to throw error here
|
||||
return JS_FALSE;
|
||||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function Remove requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kIBaseAppCoreIID,
|
||||
|
@ -264,10 +335,6 @@ AppCoresManagerRemove(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function Remove requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -279,18 +346,37 @@ AppCoresManagerRemove(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
PR_STATIC_CALLBACK(JSBool)
|
||||
AppCoresManagerFind(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMAppCoresManager *nativeThis = (nsIDOMAppCoresManager*)JS_GetPrivate(cx, obj);
|
||||
nsIDOMAppCoresManager *nativeThis = (nsIDOMAppCoresManager*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
nsIDOMBaseAppCore* nativeRet;
|
||||
nsAutoString b0;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "appcoresmanager.find", &ok);
|
||||
if (!ok) {
|
||||
//Need to throw error here
|
||||
return JS_FALSE;
|
||||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function Find requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -300,10 +386,6 @@ AppCoresManagerFind(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function Find requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -315,7 +397,7 @@ AppCoresManagerFind(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
//
|
||||
JSClass AppCoresManagerClass = {
|
||||
"AppCoresManager",
|
||||
JSCLASS_HAS_PRIVATE,
|
||||
JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS,
|
||||
JS_PropertyStub,
|
||||
JS_PropertyStub,
|
||||
GetAppCoresManagerProperty,
|
||||
|
@ -363,7 +445,7 @@ AppCoresManager(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
//
|
||||
// AppCoresManager class initialization
|
||||
//
|
||||
nsresult NS_InitAppCoresManagerClass(nsIScriptContext *aContext, void **aPrototype)
|
||||
extern "C" NS_DOM nsresult NS_InitAppCoresManagerClass(nsIScriptContext *aContext, void **aPrototype)
|
||||
{
|
||||
JSContext *jscontext = (JSContext *)aContext->GetNativeContext();
|
||||
JSObject *proto = nsnull;
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "nsJSUtils.h"
|
||||
#include "nscore.h"
|
||||
#include "nsIScriptContext.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsIJSScriptObject.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
|
@ -29,6 +30,7 @@
|
|||
#include "nsIDOMBaseAppCore.h"
|
||||
#include "nsIScriptNameSpaceManager.h"
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsIJSNativeInitializer.h"
|
||||
#include "nsDOMCID.h"
|
||||
|
||||
|
||||
|
@ -53,7 +55,7 @@ enum BaseAppCore_slots {
|
|||
PR_STATIC_CALLBACK(JSBool)
|
||||
GetBaseAppCoreProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
||||
{
|
||||
nsIDOMBaseAppCore *a = (nsIDOMBaseAppCore*)JS_GetPrivate(cx, obj);
|
||||
nsIDOMBaseAppCore *a = (nsIDOMBaseAppCore*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == a) {
|
||||
|
@ -61,11 +63,22 @@ GetBaseAppCoreProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
}
|
||||
|
||||
if (JSVAL_IS_INT(id)) {
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
PRBool ok = PR_FALSE;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
switch(JSVAL_TO_INT(id)) {
|
||||
case BASEAPPCORE_ID:
|
||||
{
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "baseappcore.id", &ok);
|
||||
if (!ok) {
|
||||
//Need to throw error here
|
||||
return JS_FALSE;
|
||||
}
|
||||
nsAutoString prop;
|
||||
if (NS_OK == a->GetId(prop)) {
|
||||
if (NS_SUCCEEDED(a->GetId(prop))) {
|
||||
nsJSUtils::nsConvertStringToJSVal(prop, cx, vp);
|
||||
}
|
||||
else {
|
||||
|
@ -76,6 +89,7 @@ GetBaseAppCoreProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
default:
|
||||
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
|
||||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
|
||||
|
@ -91,7 +105,7 @@ GetBaseAppCoreProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
PR_STATIC_CALLBACK(JSBool)
|
||||
SetBaseAppCoreProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
||||
{
|
||||
nsIDOMBaseAppCore *a = (nsIDOMBaseAppCore*)JS_GetPrivate(cx, obj);
|
||||
nsIDOMBaseAppCore *a = (nsIDOMBaseAppCore*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == a) {
|
||||
|
@ -99,11 +113,18 @@ SetBaseAppCoreProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
}
|
||||
|
||||
if (JSVAL_IS_INT(id)) {
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
PRBool ok = PR_FALSE;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
switch(JSVAL_TO_INT(id)) {
|
||||
case 0:
|
||||
default:
|
||||
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
|
||||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
|
||||
|
@ -149,18 +170,36 @@ ResolveBaseAppCore(JSContext *cx, JSObject *obj, jsval id)
|
|||
PR_STATIC_CALLBACK(JSBool)
|
||||
BaseAppCoreInit(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMBaseAppCore *nativeThis = (nsIDOMBaseAppCore*)JS_GetPrivate(cx, obj);
|
||||
JSBool rBool = JS_FALSE;
|
||||
nsIDOMBaseAppCore *nativeThis = (nsIDOMBaseAppCore*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
nsAutoString b0;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "baseappcore.init", &ok);
|
||||
if (!ok) {
|
||||
//Need to throw error here
|
||||
return JS_FALSE;
|
||||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function Init requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -170,30 +209,47 @@ BaseAppCoreInit(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function Init requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Native method SetDocumentCharset
|
||||
//
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
BaseAppCoreSetDocumentCharset(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMBaseAppCore *nativeThis = (nsIDOMBaseAppCore*)JS_GetPrivate(cx, obj);
|
||||
JSBool rBool = JS_FALSE;
|
||||
nsIDOMBaseAppCore *nativeThis = (nsIDOMBaseAppCore*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
nsAutoString b0;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "baseappcore.setdocumentcharset", &ok);
|
||||
if (!ok) {
|
||||
//Need to throw error here
|
||||
return JS_FALSE;
|
||||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function SetDocumentCharset requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -203,10 +259,6 @@ BaseAppCoreSetDocumentCharset(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function close requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -218,7 +270,7 @@ BaseAppCoreSetDocumentCharset(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
|||
//
|
||||
JSClass BaseAppCoreClass = {
|
||||
"BaseAppCore",
|
||||
JSCLASS_HAS_PRIVATE,
|
||||
JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS,
|
||||
JS_PropertyStub,
|
||||
JS_PropertyStub,
|
||||
GetBaseAppCoreProperty,
|
||||
|
@ -246,7 +298,7 @@ static JSPropertySpec BaseAppCoreProperties[] =
|
|||
static JSFunctionSpec BaseAppCoreMethods[] =
|
||||
{
|
||||
{"Init", BaseAppCoreInit, 1},
|
||||
{"SetDocumentCharset", BaseAppCoreSetDocumentCharset, 1},
|
||||
{"SetDocumentCharset", BaseAppCoreSetDocumentCharset, 1},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
@ -263,8 +315,10 @@ BaseAppCore(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
nsIScriptNameSpaceManager* manager;
|
||||
nsIDOMBaseAppCore *nativeThis;
|
||||
nsIScriptObjectOwner *owner = nsnull;
|
||||
nsIJSNativeInitializer* initializer = nsnull;
|
||||
|
||||
static NS_DEFINE_IID(kIDOMBaseAppCoreIID, NS_IDOMBASEAPPCORE_IID);
|
||||
static NS_DEFINE_IID(kIJSNativeInitializerIID, NS_IJSNATIVEINITIALIZER_IID);
|
||||
|
||||
result = context->GetNameSpaceManager(&manager);
|
||||
if (NS_OK != result) {
|
||||
|
@ -285,7 +339,16 @@ BaseAppCore(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// XXX We should be calling Init() on the instance
|
||||
result = nativeThis->QueryInterface(kIJSNativeInitializerIID, (void **)&initializer);
|
||||
if (NS_OK == result) {
|
||||
result = initializer->Initialize(cx, argc, argv);
|
||||
NS_RELEASE(initializer);
|
||||
|
||||
if (NS_OK != result) {
|
||||
NS_RELEASE(nativeThis);
|
||||
return JS_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
result = nativeThis->QueryInterface(kIScriptObjectOwnerIID, (void **)&owner);
|
||||
if (NS_OK != result) {
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -21,6 +21,7 @@
|
|||
#include "nsJSUtils.h"
|
||||
#include "nscore.h"
|
||||
#include "nsIScriptContext.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsIJSScriptObject.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
|
@ -48,7 +49,7 @@ NS_DEF_PTR(nsIDOMProfileCore);
|
|||
PR_STATIC_CALLBACK(JSBool)
|
||||
GetProfileCoreProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
||||
{
|
||||
nsIDOMProfileCore *a = (nsIDOMProfileCore*)JS_GetPrivate(cx, obj);
|
||||
nsIDOMProfileCore *a = (nsIDOMProfileCore*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == a) {
|
||||
|
@ -56,11 +57,18 @@ GetProfileCoreProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
}
|
||||
|
||||
if (JSVAL_IS_INT(id)) {
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
PRBool ok = PR_FALSE;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
switch(JSVAL_TO_INT(id)) {
|
||||
case 0:
|
||||
default:
|
||||
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
|
||||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
|
||||
|
@ -76,7 +84,7 @@ GetProfileCoreProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
PR_STATIC_CALLBACK(JSBool)
|
||||
SetProfileCoreProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
||||
{
|
||||
nsIDOMProfileCore *a = (nsIDOMProfileCore*)JS_GetPrivate(cx, obj);
|
||||
nsIDOMProfileCore *a = (nsIDOMProfileCore*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == a) {
|
||||
|
@ -84,11 +92,18 @@ SetProfileCoreProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
}
|
||||
|
||||
if (JSVAL_IS_INT(id)) {
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
PRBool ok = PR_FALSE;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
switch(JSVAL_TO_INT(id)) {
|
||||
case 0:
|
||||
default:
|
||||
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
|
||||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
else {
|
||||
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
|
||||
|
@ -134,17 +149,36 @@ ResolveProfileCore(JSContext *cx, JSObject *obj, jsval id)
|
|||
PR_STATIC_CALLBACK(JSBool)
|
||||
ProfileCoreCreateNewProfile(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMProfileCore *nativeThis = (nsIDOMProfileCore*)JS_GetPrivate(cx, obj);
|
||||
nsIDOMProfileCore *nativeThis = (nsIDOMProfileCore*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
nsAutoString b0;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "profilecore.createnewprofile", &ok);
|
||||
if (!ok) {
|
||||
//Need to throw error here
|
||||
return JS_FALSE;
|
||||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function CreateNewProfile requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -154,10 +188,6 @@ ProfileCoreCreateNewProfile(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function CreateNewProfile requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -169,21 +199,39 @@ ProfileCoreCreateNewProfile(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
|||
PR_STATIC_CALLBACK(JSBool)
|
||||
ProfileCoreRenameProfile(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMProfileCore *nativeThis = (nsIDOMProfileCore*)JS_GetPrivate(cx, obj);
|
||||
nsIDOMProfileCore *nativeThis = (nsIDOMProfileCore*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
nsAutoString b0;
|
||||
nsAutoString b1;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "profilecore.renameprofile", &ok);
|
||||
if (!ok) {
|
||||
//Need to throw error here
|
||||
return JS_FALSE;
|
||||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 2) {
|
||||
{
|
||||
if (argc < 2) {
|
||||
JS_ReportError(cx, "Function RenameProfile requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b1, cx, argv[1]);
|
||||
|
||||
if (NS_OK != nativeThis->RenameProfile(b0, b1)) {
|
||||
|
@ -192,10 +240,6 @@ ProfileCoreRenameProfile(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function RenameProfile requires 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -207,17 +251,36 @@ ProfileCoreRenameProfile(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
PR_STATIC_CALLBACK(JSBool)
|
||||
ProfileCoreDeleteProfile(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMProfileCore *nativeThis = (nsIDOMProfileCore*)JS_GetPrivate(cx, obj);
|
||||
nsIDOMProfileCore *nativeThis = (nsIDOMProfileCore*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
nsAutoString b0;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "profilecore.deleteprofile", &ok);
|
||||
if (!ok) {
|
||||
//Need to throw error here
|
||||
return JS_FALSE;
|
||||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function DeleteProfile requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -227,10 +290,6 @@ ProfileCoreDeleteProfile(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function DeleteProfile requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -242,17 +301,32 @@ ProfileCoreDeleteProfile(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
PR_STATIC_CALLBACK(JSBool)
|
||||
ProfileCoreGetProfileList(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMProfileCore *nativeThis = (nsIDOMProfileCore*)JS_GetPrivate(cx, obj);
|
||||
nsIDOMProfileCore *nativeThis = (nsIDOMProfileCore*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
nsAutoString nativeRet;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "profilecore.getprofilelist", &ok);
|
||||
if (!ok) {
|
||||
//Need to throw error here
|
||||
return JS_FALSE;
|
||||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->GetProfileList(nativeRet)) {
|
||||
return JS_FALSE;
|
||||
|
@ -260,10 +334,6 @@ ProfileCoreGetProfileList(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
nsJSUtils::nsConvertStringToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function GetProfileList requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -275,17 +345,36 @@ ProfileCoreGetProfileList(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
PR_STATIC_CALLBACK(JSBool)
|
||||
ProfileCoreStartCommunicator(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMProfileCore *nativeThis = (nsIDOMProfileCore*)JS_GetPrivate(cx, obj);
|
||||
nsIDOMProfileCore *nativeThis = (nsIDOMProfileCore*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
nsAutoString b0;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "profilecore.startcommunicator", &ok);
|
||||
if (!ok) {
|
||||
//Need to throw error here
|
||||
return JS_FALSE;
|
||||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function StartCommunicator requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -295,10 +384,6 @@ ProfileCoreStartCommunicator(JSContext *cx, JSObject *obj, uintN argc, jsval *ar
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function StartCommunicator requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -310,17 +395,32 @@ ProfileCoreStartCommunicator(JSContext *cx, JSObject *obj, uintN argc, jsval *ar
|
|||
PR_STATIC_CALLBACK(JSBool)
|
||||
ProfileCoreGetCurrentProfile(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMProfileCore *nativeThis = (nsIDOMProfileCore*)JS_GetPrivate(cx, obj);
|
||||
nsIDOMProfileCore *nativeThis = (nsIDOMProfileCore*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
nsAutoString nativeRet;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "profilecore.getcurrentprofile", &ok);
|
||||
if (!ok) {
|
||||
//Need to throw error here
|
||||
return JS_FALSE;
|
||||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 0) {
|
||||
{
|
||||
|
||||
if (NS_OK != nativeThis->GetCurrentProfile(nativeRet)) {
|
||||
return JS_FALSE;
|
||||
|
@ -328,10 +428,6 @@ ProfileCoreGetCurrentProfile(JSContext *cx, JSObject *obj, uintN argc, jsval *ar
|
|||
|
||||
nsJSUtils::nsConvertStringToJSVal(nativeRet, cx, rval);
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function GetCurrentProfile requires 0 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -343,17 +439,36 @@ ProfileCoreGetCurrentProfile(JSContext *cx, JSObject *obj, uintN argc, jsval *ar
|
|||
PR_STATIC_CALLBACK(JSBool)
|
||||
ProfileCoreMigrateProfile(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMProfileCore *nativeThis = (nsIDOMProfileCore*)JS_GetPrivate(cx, obj);
|
||||
nsIDOMProfileCore *nativeThis = (nsIDOMProfileCore*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
nsAutoString b0;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
|
||||
nsIScriptSecurityManager *secMan;
|
||||
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
{
|
||||
PRBool ok;
|
||||
secMan->CheckScriptAccess(scriptCX, obj, "profilecore.migrateprofile", &ok);
|
||||
if (!ok) {
|
||||
//Need to throw error here
|
||||
return JS_FALSE;
|
||||
}
|
||||
NS_RELEASE(secMan);
|
||||
}
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
{
|
||||
if (argc < 1) {
|
||||
JS_ReportError(cx, "Function MigrateProfile requires 1 parameter");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]);
|
||||
|
||||
|
@ -363,10 +478,6 @@ ProfileCoreMigrateProfile(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function MigrateProfile requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -1,365 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/* AUTO-GENERATED. DO NOT EDIT!!! */
|
||||
|
||||
#include "jsapi.h"
|
||||
#include "nsJSUtils.h"
|
||||
#include "nscore.h"
|
||||
#include "nsIScriptContext.h"
|
||||
#include "nsIJSScriptObject.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsIPtr.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIDOMRDFCore.h"
|
||||
#include "nsIScriptNameSpaceManager.h"
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsDOMCID.h"
|
||||
|
||||
|
||||
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(kINodeIID, NS_IDOMNODE_IID);
|
||||
static NS_DEFINE_IID(kIRDFCoreIID, NS_IDOMRDFCORE_IID);
|
||||
|
||||
NS_DEF_PTR(nsIDOMNode);
|
||||
NS_DEF_PTR(nsIDOMRDFCore);
|
||||
|
||||
|
||||
/***********************************************************************/
|
||||
//
|
||||
// RDFCore Properties Getter
|
||||
//
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
GetRDFCoreProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
||||
{
|
||||
nsIDOMRDFCore *a = (nsIDOMRDFCore*)JS_GetPrivate(cx, obj);
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == a) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (JSVAL_IS_INT(id)) {
|
||||
switch(JSVAL_TO_INT(id)) {
|
||||
case 0:
|
||||
default:
|
||||
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
|
||||
}
|
||||
}
|
||||
else {
|
||||
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
|
||||
}
|
||||
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
/***********************************************************************/
|
||||
//
|
||||
// RDFCore Properties Setter
|
||||
//
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
SetRDFCoreProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
||||
{
|
||||
nsIDOMRDFCore *a = (nsIDOMRDFCore*)JS_GetPrivate(cx, obj);
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == a) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (JSVAL_IS_INT(id)) {
|
||||
switch(JSVAL_TO_INT(id)) {
|
||||
case 0:
|
||||
default:
|
||||
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
|
||||
}
|
||||
}
|
||||
else {
|
||||
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
|
||||
}
|
||||
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// RDFCore finalizer
|
||||
//
|
||||
PR_STATIC_CALLBACK(void)
|
||||
FinalizeRDFCore(JSContext *cx, JSObject *obj)
|
||||
{
|
||||
nsJSUtils::nsGenericFinalize(cx, obj);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// RDFCore enumerate
|
||||
//
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
EnumerateRDFCore(JSContext *cx, JSObject *obj)
|
||||
{
|
||||
return nsJSUtils::nsGenericEnumerate(cx, obj);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// RDFCore resolve
|
||||
//
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
ResolveRDFCore(JSContext *cx, JSObject *obj, jsval id)
|
||||
{
|
||||
return nsJSUtils::nsGenericResolve(cx, obj, id);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Native method DoSort
|
||||
//
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
RDFCoreDoSort(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMRDFCore *nativeThis = (nsIDOMRDFCore*)JS_GetPrivate(cx, obj);
|
||||
// JSBool rBool = JS_FALSE;
|
||||
nsIDOMNodePtr b0;
|
||||
nsAutoString b1;
|
||||
nsAutoString b2;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 3) {
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kINodeIID,
|
||||
"Node",
|
||||
cx,
|
||||
argv[0])) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b1, cx, argv[1]);
|
||||
|
||||
nsJSUtils::nsConvertJSValToString(b2, cx, argv[2]);
|
||||
|
||||
if (NS_OK != nativeThis->DoSort(b0, b1, b2)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function doSort requires 3 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************/
|
||||
//
|
||||
// class for RDFCore
|
||||
//
|
||||
JSClass RDFCoreClass = {
|
||||
"RDFCore",
|
||||
JSCLASS_HAS_PRIVATE,
|
||||
JS_PropertyStub,
|
||||
JS_PropertyStub,
|
||||
GetRDFCoreProperty,
|
||||
SetRDFCoreProperty,
|
||||
EnumerateRDFCore,
|
||||
ResolveRDFCore,
|
||||
JS_ConvertStub,
|
||||
FinalizeRDFCore
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// RDFCore class properties
|
||||
//
|
||||
static JSPropertySpec RDFCoreProperties[] =
|
||||
{
|
||||
{0}
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// RDFCore class methods
|
||||
//
|
||||
static JSFunctionSpec RDFCoreMethods[] =
|
||||
{
|
||||
{"doSort", RDFCoreDoSort, 3},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// RDFCore constructor
|
||||
//
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
RDFCore(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsresult result;
|
||||
nsIID classID;
|
||||
nsIScriptContext* context = (nsIScriptContext*)JS_GetContextPrivate(cx);
|
||||
nsIScriptNameSpaceManager* manager;
|
||||
nsIDOMRDFCore *nativeThis;
|
||||
nsIScriptObjectOwner *owner = nsnull;
|
||||
|
||||
static NS_DEFINE_IID(kIDOMRDFCoreIID, NS_IDOMRDFCORE_IID);
|
||||
|
||||
result = context->GetNameSpaceManager(&manager);
|
||||
if (NS_OK != result) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
result = manager->LookupName("RDFCore", PR_TRUE, classID);
|
||||
NS_RELEASE(manager);
|
||||
if (NS_OK != result) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
result = nsComponentManager::CreateInstance(classID,
|
||||
nsnull,
|
||||
kIDOMRDFCoreIID,
|
||||
(void **)&nativeThis);
|
||||
if (NS_OK != result) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// XXX We should be calling Init() on the instance
|
||||
|
||||
result = nativeThis->QueryInterface(kIScriptObjectOwnerIID, (void **)&owner);
|
||||
if (NS_OK != result) {
|
||||
NS_RELEASE(nativeThis);
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
owner->SetScriptObject((void *)obj);
|
||||
JS_SetPrivate(cx, obj, nativeThis);
|
||||
|
||||
NS_RELEASE(owner);
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
//
|
||||
// RDFCore class initialization
|
||||
//
|
||||
extern "C" NS_DOM nsresult NS_InitRDFCoreClass(nsIScriptContext *aContext, void **aPrototype)
|
||||
{
|
||||
JSContext *jscontext = (JSContext *)aContext->GetNativeContext();
|
||||
JSObject *proto = nsnull;
|
||||
JSObject *constructor = nsnull;
|
||||
JSObject *parent_proto = nsnull;
|
||||
JSObject *global = JS_GetGlobalObject(jscontext);
|
||||
jsval vp;
|
||||
|
||||
if ((PR_TRUE != JS_LookupProperty(jscontext, global, "RDFCore", &vp)) ||
|
||||
!JSVAL_IS_OBJECT(vp) ||
|
||||
((constructor = JSVAL_TO_OBJECT(vp)) == nsnull) ||
|
||||
(PR_TRUE != JS_LookupProperty(jscontext, JSVAL_TO_OBJECT(vp), "prototype", &vp)) ||
|
||||
!JSVAL_IS_OBJECT(vp)) {
|
||||
|
||||
if (NS_OK != NS_InitBaseAppCoreClass(aContext, (void **)&parent_proto)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
proto = JS_InitClass(jscontext, // context
|
||||
global, // global object
|
||||
parent_proto, // parent proto
|
||||
&RDFCoreClass, // JSClass
|
||||
RDFCore, // JSNative ctor
|
||||
0, // ctor args
|
||||
RDFCoreProperties, // proto props
|
||||
RDFCoreMethods, // proto funcs
|
||||
nsnull, // ctor props (static)
|
||||
nsnull); // ctor funcs (static)
|
||||
if (nsnull == proto) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
}
|
||||
else if ((nsnull != constructor) && JSVAL_IS_OBJECT(vp)) {
|
||||
proto = JSVAL_TO_OBJECT(vp);
|
||||
}
|
||||
else {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (aPrototype) {
|
||||
*aPrototype = proto;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Method for creating a new RDFCore JavaScript object
|
||||
//
|
||||
extern "C" NS_DOM nsresult NS_NewScriptRDFCore(nsIScriptContext *aContext, nsISupports *aSupports, nsISupports *aParent, void **aReturn)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aContext && nsnull != aSupports && nsnull != aReturn, "null argument to NS_NewScriptRDFCore");
|
||||
JSObject *proto;
|
||||
JSObject *parent;
|
||||
nsIScriptObjectOwner *owner;
|
||||
JSContext *jscontext = (JSContext *)aContext->GetNativeContext();
|
||||
nsresult result = NS_OK;
|
||||
nsIDOMRDFCore *aRDFCore;
|
||||
|
||||
if (nsnull == aParent) {
|
||||
parent = nsnull;
|
||||
}
|
||||
else if (NS_OK == aParent->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
|
||||
if (NS_OK != owner->GetScriptObject(aContext, (void **)&parent)) {
|
||||
NS_RELEASE(owner);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
NS_RELEASE(owner);
|
||||
}
|
||||
else {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (NS_OK != NS_InitRDFCoreClass(aContext, (void **)&proto)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
result = aSupports->QueryInterface(kIRDFCoreIID, (void **)&aRDFCore);
|
||||
if (NS_OK != result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
// create a js object for this class
|
||||
*aReturn = JS_NewObject(jscontext, &RDFCoreClass, proto, parent);
|
||||
if (nsnull != *aReturn) {
|
||||
// connect the native object to the js object
|
||||
JS_SetPrivate(jscontext, (JSObject *)*aReturn, aRDFCore);
|
||||
}
|
||||
else {
|
||||
NS_RELEASE(aRDFCore);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
Загрузка…
Ссылка в новой задаче