Slimmed down DOM code by creating a few utility functions for conversion, etc. Fixed bug 1656 - bug in generator with an enum value of 0.

This commit is contained in:
vidur%netscape.com 1998-12-03 00:33:00 +00:00
Родитель 323cec6fdb
Коммит 61df793102
101 изменённых файлов: 2162 добавлений и 12733 удалений

Просмотреть файл

@ -33,7 +33,7 @@ class nsIDOMCSSStyleSheet;
class nsIDOMCSSRule : public nsISupports {
public:
enum {
UNKNOWN_RULE = 14005568,
UNKNOWN_RULE = 0,
STYLE_RULE = 1,
IMPORT_RULE = 2,
MEDIA_RULE = 3,

Просмотреть файл

@ -40,8 +40,11 @@ CPPSRCS = \
nsLocation.cpp \
nsFrameList.cpp \
nsJSSecurityManager.cpp \
nsJSUtils.cpp \
$(NULL)
EXPORTS = nsJSUtils.h
include $(topsrcdir)/config/config.mk
MKSHLIB :=

Просмотреть файл

@ -32,8 +32,11 @@ CPPSRCS = \
nsLocation.cpp \
nsFrameList.cpp \
nsJSSecurityManager.cpp \
nsJSUtils.cpp \
$(NULL)
EXPORTS=nsJSUtils.h
MODULE=raptor
REQUIRES=xpcom raptor js netlib
@ -48,6 +51,7 @@ CPP_OBJS= \
.\$(OBJDIR)\nsFrameList.obj \
.\$(OBJDIR)\nsJSWindowCollection.obj \
.\$(OBJDIR)\nsJSSecurityManager.obj \
.\$(OBJDIR)\nsJSUtils.obj \
$(NULL)
LINCS=-I$(XPDIST)\public\xpcom -I$(XPDIST)\public\raptor \

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -69,9 +70,7 @@ GetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetHash(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -82,9 +81,7 @@ GetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetHost(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -95,9 +92,7 @@ GetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetHostname(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -108,9 +103,7 @@ GetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetHref(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -121,9 +114,7 @@ GetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetPathname(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -134,9 +125,7 @@ GetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetPort(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -147,9 +136,7 @@ GetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetProtocol(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -160,9 +147,7 @@ GetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetSearch(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -170,25 +155,11 @@ GetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -213,13 +184,7 @@ SetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case LOCATION_HASH:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetHash(prop);
@ -228,13 +193,7 @@ SetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case LOCATION_HOST:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetHost(prop);
@ -243,13 +202,7 @@ SetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case LOCATION_HOSTNAME:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetHostname(prop);
@ -258,13 +211,7 @@ SetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case LOCATION_HREF:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetHref(prop);
@ -273,13 +220,7 @@ SetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case LOCATION_PATHNAME:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetPathname(prop);
@ -288,13 +229,7 @@ SetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case LOCATION_PORT:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetPort(prop);
@ -303,13 +238,7 @@ SetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case LOCATION_PROTOCOL:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetProtocol(prop);
@ -318,38 +247,18 @@ SetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case LOCATION_SEARCH:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetSearch(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -362,18 +271,7 @@ SetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeLocation(JSContext *cx, JSObject *obj)
{
nsIDOMLocation *a = (nsIDOMLocation*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -383,17 +281,7 @@ FinalizeLocation(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateLocation(JSContext *cx, JSObject *obj)
{
nsIDOMLocation *a = (nsIDOMLocation*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -403,17 +291,7 @@ EnumerateLocation(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveLocation(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMLocation *a = (nsIDOMLocation*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}
@ -469,13 +347,7 @@ LocationReplace(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->Replace(b0)) {
return JS_FALSE;

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -68,9 +69,7 @@ GetNavigatorProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetUserAgent(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -81,9 +80,7 @@ GetNavigatorProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetAppCodeName(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -94,9 +91,7 @@ GetNavigatorProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetAppVersion(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -107,9 +102,7 @@ GetNavigatorProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetAppName(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -120,9 +113,7 @@ GetNavigatorProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetLanguage(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -133,9 +124,7 @@ GetNavigatorProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetPlatform(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -146,9 +135,7 @@ GetNavigatorProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetSecurityPolicy(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -156,25 +143,11 @@ GetNavigatorProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -198,25 +171,11 @@ SetNavigatorProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -229,18 +188,7 @@ SetNavigatorProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeNavigator(JSContext *cx, JSObject *obj)
{
nsIDOMNavigator *a = (nsIDOMNavigator*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -250,17 +198,7 @@ FinalizeNavigator(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateNavigator(JSContext *cx, JSObject *obj)
{
nsIDOMNavigator *a = (nsIDOMNavigator*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -270,17 +208,7 @@ EnumerateNavigator(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveNavigator(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMNavigator *a = (nsIDOMNavigator*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

226
dom/src/base/nsJSUtils.cpp Normal file
Просмотреть файл

@ -0,0 +1,226 @@
/* -*- 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.
*/
/**
* This is not a generated file. It contains common utility functions
* invoked from the JavaScript code generated from IDL interfaces.
* The goal of the utility functions is to cut down on the size of
* the generated code itself.
*/
#include "jsapi.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsString.h"
static NS_DEFINE_IID(kIJSScriptObjectIID, NS_IJSSCRIPTOBJECT_IID);
static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID);
PRBool
nsCallJSScriptObjectGetProperty(nsISupports* aSupports,
JSContext* aContext,
jsval aId,
jsval* aReturn)
{
nsIJSScriptObject *object;
if (NS_OK == aSupports->QueryInterface(kIJSScriptObjectIID,
(void**)&object)) {
PRBool rval;
rval = object->GetProperty(aContext, aId, aReturn);
NS_RELEASE(object);
return rval;
}
return JS_TRUE;
}
PRBool
nsCallJSScriptObjectSetProperty(nsISupports* aSupports,
JSContext* aContext,
jsval aId,
jsval* aReturn)
{
nsIJSScriptObject *object;
if (NS_OK == aSupports->QueryInterface(kIJSScriptObjectIID,
(void**)&object)) {
PRBool rval;
rval = object->SetProperty(aContext, aId, aReturn);
NS_RELEASE(object);
return rval;
}
return JS_TRUE;
}
void
nsConvertObjectToJSVal(nsISupports* aSupports,
JSContext* aContext,
jsval* aReturn)
{
// get the js object\n"
if (aSupports != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == aSupports->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(aContext);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*aReturn = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(aSupports);
}
else {
*aReturn = JSVAL_NULL;
}
}
void
nsConvertStringToJSVal(const nsString& aProp,
JSContext* aContext,
jsval* aReturn)
{
JSString *jsstring = JS_NewUCStringCopyN(aContext, aProp, aProp.Length());
// set the return value
*aReturn = STRING_TO_JSVAL(jsstring);
}
PRBool
nsConvertJSValToObject(nsISupports** aSupports,
REFNSIID aIID,
const nsString& aTypeName,
JSContext* aContext,
jsval aValue)
{
if (JSVAL_IS_NULL(aValue)) {
*aSupports = nsnull;
}
else if (JSVAL_IS_OBJECT(aValue)) {
JSObject *jsobj = JSVAL_TO_OBJECT(aValue);
nsISupports *supports = (nsISupports *)JS_GetPrivate(aContext, jsobj);
if (NS_OK != supports->QueryInterface(aIID, (void **)aSupports)) {
char buf[128];
char typeName[128];
aTypeName.ToCString(typeName, sizeof(typeName));
sprintf(buf, "Parameter must of type %s", typeName);
JS_ReportError(aContext, buf);
return JS_FALSE;
}
}
else {
JS_ReportError(aContext, "Parameter must be an object");
return JS_FALSE;
}
return JS_TRUE;
}
void
nsConvertJSValToString(nsString& aString,
JSContext* aContext,
jsval aValue)
{
JSString *jsstring;
if ((jsstring = JS_ValueToString(aContext, aValue)) != nsnull) {
aString.SetString(JS_GetStringChars(jsstring));
}
else {
aString.Truncate();
}
}
PRBool
nsConvertJSValToBool(PRBool* aProp,
JSContext* aContext,
jsval aValue)
{
JSBool temp;
if (JSVAL_IS_BOOLEAN(aValue) && JS_ValueToBoolean(aContext, aValue, &temp)) {
*aProp = (PRBool)temp;
}
else {
JS_ReportError(aContext, "Parameter must be a boolean");
return JS_FALSE;
}
return JS_TRUE;
}
void
nsGenericFinalize(JSContext* aContext,
JSObject* aObj)
{
nsISupports *nativeThis = (nsISupports*)JS_GetPrivate(aContext,
aObj);
if (nsnull != nativeThis) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeThis->QueryInterface(kIScriptObjectOwnerIID,
(void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(nativeThis);
}
}
JSBool
nsGenericEnumerate(JSContext* aContext,
JSObject* aObj)
{
nsISupports* nativeThis = (nsISupports*)JS_GetPrivate(aContext,
aObj);
if (nsnull != nativeThis) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == nativeThis->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(aContext);
NS_RELEASE(object);
}
}
return JS_TRUE;
}
JSBool
nsGenericResolve(JSContext* aContext,
JSObject* aObj,
jsval aId)
{
nsISupports* nativeThis = (nsISupports*)JS_GetPrivate(aContext,
aObj);
if (nsnull != nativeThis) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == nativeThis->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(aContext, aId);
NS_RELEASE(object);
}
}
return JS_TRUE;
}

70
dom/src/base/nsJSUtils.h Normal file
Просмотреть файл

@ -0,0 +1,70 @@
/* -*- 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.
*/
/**
* This is not a generated file. It contains common utility functions
* invoked from the JavaScript code generated from IDL interfaces.
* The goal of the utility functions is to cut down on the size of
* the generated code itself.
*/
#include "nsISupports.h"
#include "jsapi.h"
#include "nsString.h"
PRBool nsCallJSScriptObjectGetProperty(nsISupports* aSupports,
JSContext* aContext,
jsval aId,
jsval* aReturn);
PRBool nsCallJSScriptObjectSetProperty(nsISupports* aSupports,
JSContext* aContext,
jsval aId,
jsval* aReturn);
void nsConvertObjectToJSVal(nsISupports* aSupports,
JSContext* aContext,
jsval* aReturn);
void nsConvertStringToJSVal(const nsString& aProp,
JSContext* aContext,
jsval* aReturn);
PRBool nsConvertJSValToObject(nsISupports** aSupports,
REFNSIID aIID,
const nsString& aTypeName,
JSContext* aContext,
jsval aValue);
void nsConvertJSValToString(nsString& aString,
JSContext* aContext,
jsval aValue);
PRBool nsConvertJSValToBool(PRBool* aProp,
JSContext* aContext,
jsval aValue);
void nsGenericFinalize(JSContext* aContext,
JSObject* aObj);
JSBool nsGenericEnumerate(JSContext* aContext,
JSObject* aObj);
JSBool nsGenericResolve(JSContext* aContext,
JSObject* aObj,
jsval aId);

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -94,22 +95,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMWindow* prop;
if (NS_OK == a->GetWindow(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -121,22 +107,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMWindow* prop;
if (NS_OK == a->GetSelf(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -148,22 +119,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMDocument* prop;
if (NS_OK == a->GetDocument(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -175,22 +131,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMNavigator* prop;
if (NS_OK == a->GetNavigator(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -202,22 +143,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMWindow* prop;
if (NS_OK == a->GetParent(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -229,22 +155,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMWindow* prop;
if (NS_OK == a->GetTop(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -267,22 +178,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMWindowCollection* prop;
if (NS_OK == a->GetFrames(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -294,22 +190,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMWindow* prop;
if (NS_OK == a->GetOpener(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -320,9 +201,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetStatus(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -333,9 +212,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetDefaultStatus(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -346,9 +223,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetName(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -444,25 +319,11 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -487,36 +348,20 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case WINDOW_OPENER:
{
nsIDOMWindow* prop;
if (JSVAL_IS_NULL(*vp)) {
prop = nsnull;
}
else if (JSVAL_IS_OBJECT(*vp)) {
JSObject *jsobj = JSVAL_TO_OBJECT(*vp);
nsISupports *supports = (nsISupports *)JS_GetPrivate(cx, jsobj);
if (NS_OK != supports->QueryInterface(kIWindowIID, (void **)&prop)) {
JS_ReportError(cx, "Parameter must be of type Window");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (PR_FALSE == nsConvertJSValToObject((nsISupports **)&prop,
kIWindowIID, "Window",
cx, *vp)) {
return JS_FALSE;
}
a->SetOpener(prop);
if (prop) NS_RELEASE(prop);
NS_IF_RELEASE(prop);
break;
}
case WINDOW_STATUS:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetStatus(prop);
@ -525,13 +370,7 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case WINDOW_DEFAULTSTATUS:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetDefaultStatus(prop);
@ -540,13 +379,7 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case WINDOW_NAME:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetName(prop);
@ -681,25 +514,11 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -721,17 +540,7 @@ FinalizeWindow(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateWindow(JSContext *cx, JSObject *obj)
{
nsIDOMWindow *a = (nsIDOMWindow*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -741,17 +550,7 @@ EnumerateWindow(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveWindow(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMWindow *a = (nsIDOMWindow*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}
@ -774,13 +573,7 @@ WindowDump(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->Dump(b0)) {
return JS_FALSE;
@ -816,13 +609,7 @@ WindowAlert(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->Alert(b0)) {
return JS_FALSE;
@ -1509,22 +1296,7 @@ WindowOpen(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function open requires 0 parameters");
@ -1560,13 +1332,7 @@ EventCapturerCaptureEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->CaptureEvent(b0)) {
return JS_FALSE;
@ -1608,13 +1374,7 @@ EventCapturerReleaseEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->ReleaseEvent(b0)) {
return JS_FALSE;

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -77,22 +78,7 @@ GetWindowCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMWindow* prop;
if (NS_OK == a->Item(JSVAL_TO_INT(id), &prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -115,31 +101,10 @@ GetWindowCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (NS_OK == a->NamedItem(name, &prop)) {
if (NULL != prop) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
*vp = JSVAL_NULL;
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
@ -147,13 +112,7 @@ GetWindowCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -177,25 +136,11 @@ SetWindowCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -208,18 +153,7 @@ SetWindowCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeWindowCollection(JSContext *cx, JSObject *obj)
{
nsIDOMWindowCollection *a = (nsIDOMWindowCollection*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -229,17 +163,7 @@ FinalizeWindowCollection(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateWindowCollection(JSContext *cx, JSObject *obj)
{
nsIDOMWindowCollection *a = (nsIDOMWindowCollection*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -249,17 +173,7 @@ EnumerateWindowCollection(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveWindowCollection(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMWindowCollection *a = (nsIDOMWindowCollection*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}
@ -292,22 +206,7 @@ WindowCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function item requires 1 parameters");
@ -338,34 +237,13 @@ WindowCollectionNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->NamedItem(b0, &nativeRet)) {
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function namedItem requires 1 parameters");

Просмотреть файл

@ -22,9 +22,10 @@ DEFINES=-D_IMPL_NS_DOM
MODULE=raptor
REQUIRES=xpcom raptor dom
CPPSRCS=nsDOMFactory.cpp nsHTMLTagsEnums.cpp
CPPSRCS = nsDOMFactory.cpp \
nsHTMLTagsEnums.cpp
CPP_OBJS=.\$(OBJDIR)\nsDOMFactory.obj .\$(OBJDIR)\nsHTMLTagsEnums.obj
CPP_OBJS = .\$(OBJDIR)\nsDOMFactory.obj .\$(OBJDIR)\nsHTMLTagsEnums.obj
LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor \
-I$(PUBLIC)\dom -I$(PUBLIC)\js -I..\base -I$(PUBLIC)\jsurl

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -64,9 +65,7 @@ GetAttrProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetName(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -88,9 +87,7 @@ GetAttrProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetValue(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -98,25 +95,11 @@ GetAttrProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -141,38 +124,18 @@ SetAttrProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case ATTR_VALUE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetValue(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -185,18 +148,7 @@ SetAttrProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeAttr(JSContext *cx, JSObject *obj)
{
nsIDOMAttr *a = (nsIDOMAttr*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -206,17 +158,7 @@ FinalizeAttr(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateAttr(JSContext *cx, JSObject *obj)
{
nsIDOMAttr *a = (nsIDOMAttr*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -226,17 +168,7 @@ EnumerateAttr(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveAttr(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMAttr *a = (nsIDOMAttr*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -54,25 +55,11 @@ GetCDATASectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -96,25 +83,11 @@ SetCDATASectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -127,18 +100,7 @@ SetCDATASectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeCDATASection(JSContext *cx, JSObject *obj)
{
nsIDOMCDATASection *a = (nsIDOMCDATASection*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -148,17 +110,7 @@ FinalizeCDATASection(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateCDATASection(JSContext *cx, JSObject *obj)
{
nsIDOMCDATASection *a = (nsIDOMCDATASection*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -168,17 +120,7 @@ EnumerateCDATASection(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveCDATASection(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMCDATASection *a = (nsIDOMCDATASection*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -63,9 +64,7 @@ GetCharacterDataProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetData(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -84,25 +83,11 @@ GetCharacterDataProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -127,38 +112,18 @@ SetCharacterDataProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case CHARACTERDATA_DATA:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetData(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -171,18 +136,7 @@ SetCharacterDataProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeCharacterData(JSContext *cx, JSObject *obj)
{
nsIDOMCharacterData *a = (nsIDOMCharacterData*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -192,17 +146,7 @@ FinalizeCharacterData(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateCharacterData(JSContext *cx, JSObject *obj)
{
nsIDOMCharacterData *a = (nsIDOMCharacterData*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -212,17 +156,7 @@ EnumerateCharacterData(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveCharacterData(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMCharacterData *a = (nsIDOMCharacterData*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}
@ -261,9 +195,7 @@ CharacterDataSubstringData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
return JS_FALSE;
}
JSString *jsstring = JS_NewUCStringCopyN(cx, nativeRet, nativeRet.Length());
// set the return value
*rval = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function substringData requires 2 parameters");
@ -293,13 +225,7 @@ CharacterDataAppendData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->AppendData(b0)) {
return JS_FALSE;
@ -341,13 +267,7 @@ CharacterDataInsertData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
return JS_FALSE;
}
JSString *jsstring1 = JS_ValueToString(cx, argv[1]);
if (nsnull != jsstring1) {
b1.SetString(JS_GetStringChars(jsstring1));
}
else {
b1.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b1, cx, argv[1]);
if (NS_OK != nativeThis->InsertData(b0, b1)) {
return JS_FALSE;
@ -440,13 +360,7 @@ CharacterDataReplaceData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
return JS_FALSE;
}
JSString *jsstring2 = JS_ValueToString(cx, argv[2]);
if (nsnull != jsstring2) {
b2.SetString(JS_GetStringChars(jsstring2));
}
else {
b2.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b2, cx, argv[2]);
if (NS_OK != nativeThis->ReplaceData(b0, b1, b2)) {
return JS_FALSE;

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -54,25 +55,11 @@ GetCommentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -96,25 +83,11 @@ SetCommentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -127,18 +100,7 @@ SetCommentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeComment(JSContext *cx, JSObject *obj)
{
nsIDOMComment *a = (nsIDOMComment*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -148,17 +110,7 @@ FinalizeComment(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateComment(JSContext *cx, JSObject *obj)
{
nsIDOMComment *a = (nsIDOMComment*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -168,17 +120,7 @@ EnumerateComment(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveComment(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMComment *a = (nsIDOMComment*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -54,25 +55,11 @@ GetDOMImplementationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -96,25 +83,11 @@ SetDOMImplementationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -127,18 +100,7 @@ SetDOMImplementationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeDOMImplementation(JSContext *cx, JSObject *obj)
{
nsIDOMDOMImplementation *a = (nsIDOMDOMImplementation*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -148,17 +110,7 @@ FinalizeDOMImplementation(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateDOMImplementation(JSContext *cx, JSObject *obj)
{
nsIDOMDOMImplementation *a = (nsIDOMDOMImplementation*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -168,17 +120,7 @@ EnumerateDOMImplementation(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveDOMImplementation(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMDOMImplementation *a = (nsIDOMDOMImplementation*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}
@ -203,21 +145,9 @@ DOMImplementationHasFeature(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
if (argc >= 2) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
JSString *jsstring1 = JS_ValueToString(cx, argv[1]);
if (nsnull != jsstring1) {
b1.SetString(JS_GetStringChars(jsstring1));
}
else {
b1.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b1, cx, argv[1]);
if (NS_OK != nativeThis->HasFeature(b0, b1, &nativeRet)) {
return JS_FALSE;

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -108,22 +109,7 @@ GetDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMDocumentType* prop;
if (NS_OK == a->GetDoctype(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -135,22 +121,7 @@ GetDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMDOMImplementation* prop;
if (NS_OK == a->GetImplementation(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -162,22 +133,7 @@ GetDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMElement* prop;
if (NS_OK == a->GetDocumentElement(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -191,22 +147,7 @@ GetDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (NS_OK == a->QueryInterface(kINSDocumentIID, (void **)&b)) {
if(NS_OK == b->GetStyleSheets(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
NS_RELEASE(b);
}
else {
@ -221,25 +162,11 @@ GetDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -263,25 +190,11 @@ SetDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -294,18 +207,7 @@ SetDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeDocument(JSContext *cx, JSObject *obj)
{
nsIDOMDocument *a = (nsIDOMDocument*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -315,17 +217,7 @@ FinalizeDocument(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateDocument(JSContext *cx, JSObject *obj)
{
nsIDOMDocument *a = (nsIDOMDocument*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -335,17 +227,7 @@ EnumerateDocument(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveDocument(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMDocument *a = (nsIDOMDocument*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}
@ -369,34 +251,13 @@ DocumentCreateElement(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->CreateElement(b0, &nativeRet)) {
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function createElement requires 1 parameters");
@ -430,22 +291,7 @@ DocumentCreateDocumentFragment(JSContext *cx, JSObject *obj, uintN argc, jsval *
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function createDocumentFragment requires 0 parameters");
@ -476,34 +322,13 @@ DocumentCreateTextNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->CreateTextNode(b0, &nativeRet)) {
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function createTextNode requires 1 parameters");
@ -534,34 +359,13 @@ DocumentCreateComment(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->CreateComment(b0, &nativeRet)) {
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function createComment requires 1 parameters");
@ -592,34 +396,13 @@ DocumentCreateCDATASection(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->CreateCDATASection(b0, &nativeRet)) {
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function createCDATASection requires 1 parameters");
@ -651,42 +434,15 @@ DocumentCreateProcessingInstruction(JSContext *cx, JSObject *obj, uintN argc, js
if (argc >= 2) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
JSString *jsstring1 = JS_ValueToString(cx, argv[1]);
if (nsnull != jsstring1) {
b1.SetString(JS_GetStringChars(jsstring1));
}
else {
b1.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b1, cx, argv[1]);
if (NS_OK != nativeThis->CreateProcessingInstruction(b0, b1, &nativeRet)) {
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function createProcessingInstruction requires 2 parameters");
@ -717,34 +473,13 @@ DocumentCreateAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->CreateAttribute(b0, &nativeRet)) {
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function createAttribute requires 1 parameters");
@ -775,34 +510,13 @@ DocumentCreateEntityReference(JSContext *cx, JSObject *obj, uintN argc, jsval *a
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->CreateEntityReference(b0, &nativeRet)) {
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function createEntityReference requires 1 parameters");
@ -833,34 +547,13 @@ DocumentGetElementsByTagName(JSContext *cx, JSObject *obj, uintN argc, jsval *ar
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->GetElementsByTagName(b0, &nativeRet)) {
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function getElementsByTagName requires 1 parameters");
@ -896,13 +589,7 @@ EventCapturerCaptureEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->CaptureEvent(b0)) {
return JS_FALSE;
@ -944,13 +631,7 @@ EventCapturerReleaseEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->ReleaseEvent(b0)) {
return JS_FALSE;

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -54,25 +55,11 @@ GetDocumentFragmentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -96,25 +83,11 @@ SetDocumentFragmentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -127,18 +100,7 @@ SetDocumentFragmentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeDocumentFragment(JSContext *cx, JSObject *obj)
{
nsIDOMDocumentFragment *a = (nsIDOMDocumentFragment*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -148,17 +110,7 @@ FinalizeDocumentFragment(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateDocumentFragment(JSContext *cx, JSObject *obj)
{
nsIDOMDocumentFragment *a = (nsIDOMDocumentFragment*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -168,17 +120,7 @@ EnumerateDocumentFragment(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveDocumentFragment(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMDocumentFragment *a = (nsIDOMDocumentFragment*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -67,9 +68,7 @@ GetDocumentTypeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetName(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -81,22 +80,7 @@ GetDocumentTypeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMNamedNodeMap* prop;
if (NS_OK == a->GetEntities(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -108,22 +92,7 @@ GetDocumentTypeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMNamedNodeMap* prop;
if (NS_OK == a->GetNotations(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -131,25 +100,11 @@ GetDocumentTypeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -173,25 +128,11 @@ SetDocumentTypeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -204,18 +145,7 @@ SetDocumentTypeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeDocumentType(JSContext *cx, JSObject *obj)
{
nsIDOMDocumentType *a = (nsIDOMDocumentType*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -225,17 +155,7 @@ FinalizeDocumentType(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateDocumentType(JSContext *cx, JSObject *obj)
{
nsIDOMDocumentType *a = (nsIDOMDocumentType*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -245,17 +165,7 @@ EnumerateDocumentType(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveDocumentType(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMDocumentType *a = (nsIDOMDocumentType*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -68,9 +69,7 @@ GetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetTagName(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -78,25 +77,11 @@ GetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -120,25 +105,11 @@ SetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -151,18 +122,7 @@ SetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeElement(JSContext *cx, JSObject *obj)
{
nsIDOMElement *a = (nsIDOMElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -172,17 +132,7 @@ FinalizeElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateElement(JSContext *cx, JSObject *obj)
{
nsIDOMElement *a = (nsIDOMElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -192,17 +142,7 @@ EnumerateElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMElement *a = (nsIDOMElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}
@ -226,21 +166,13 @@ ElementGetDOMAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->GetDOMAttribute(b0, nativeRet)) {
return JS_FALSE;
}
JSString *jsstring = JS_NewUCStringCopyN(cx, nativeRet, nativeRet.Length());
// set the return value
*rval = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function getDOMAttribute requires 1 parameters");
@ -271,21 +203,9 @@ ElementSetDOMAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
if (argc >= 2) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
JSString *jsstring1 = JS_ValueToString(cx, argv[1]);
if (nsnull != jsstring1) {
b1.SetString(JS_GetStringChars(jsstring1));
}
else {
b1.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b1, cx, argv[1]);
if (NS_OK != nativeThis->SetDOMAttribute(b0, b1)) {
return JS_FALSE;
@ -321,13 +241,7 @@ ElementRemoveAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->RemoveAttribute(b0)) {
return JS_FALSE;
@ -364,34 +278,13 @@ ElementGetAttributeNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->GetAttributeNode(b0, &nativeRet)) {
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function getAttributeNode requires 1 parameters");
@ -422,21 +315,11 @@ ElementSetAttributeNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
if (argc >= 1) {
if (JSVAL_IS_NULL(argv[0])){
b0 = nsnull;
}
else if (JSVAL_IS_OBJECT(argv[0])) {
nsISupports *supports0 = (nsISupports *)JS_GetPrivate(cx, JSVAL_TO_OBJECT(argv[0]));
NS_ASSERTION(nsnull != supports0, "null pointer");
if ((nsnull == supports0) ||
(NS_OK != supports0->QueryInterface(kIAttrIID, (void **)(b0.Query())))) {
JS_ReportError(cx, "Parameter must be of type Attr");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (JS_FALSE == nsConvertJSValToObject((nsISupports **)&b0,
kIAttrIID,
"Attr",
cx,
argv[0])) {
return JS_FALSE;
}
@ -444,22 +327,7 @@ ElementSetAttributeNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function setAttributeNode requires 1 parameters");
@ -490,21 +358,11 @@ ElementRemoveAttributeNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
if (argc >= 1) {
if (JSVAL_IS_NULL(argv[0])){
b0 = nsnull;
}
else if (JSVAL_IS_OBJECT(argv[0])) {
nsISupports *supports0 = (nsISupports *)JS_GetPrivate(cx, JSVAL_TO_OBJECT(argv[0]));
NS_ASSERTION(nsnull != supports0, "null pointer");
if ((nsnull == supports0) ||
(NS_OK != supports0->QueryInterface(kIAttrIID, (void **)(b0.Query())))) {
JS_ReportError(cx, "Parameter must be of type Attr");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (JS_FALSE == nsConvertJSValToObject((nsISupports **)&b0,
kIAttrIID,
"Attr",
cx,
argv[0])) {
return JS_FALSE;
}
@ -512,22 +370,7 @@ ElementRemoveAttributeNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function removeAttributeNode requires 1 parameters");
@ -558,34 +401,13 @@ ElementGetElementsByTagName(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->GetElementsByTagName(b0, &nativeRet)) {
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function getElementsByTagName requires 1 parameters");
@ -662,8 +484,8 @@ static JSPropertySpec ElementProperties[] =
//
static JSFunctionSpec ElementMethods[] =
{
{"getDOMAttribute", ElementGetDOMAttribute, 1},
{"setDOMAttribute", ElementSetDOMAttribute, 2},
{"getAttribute", ElementGetDOMAttribute, 1},
{"setAttribute", ElementSetDOMAttribute, 2},
{"removeAttribute", ElementRemoveAttribute, 1},
{"getAttributeNode", ElementGetAttributeNode, 1},
{"setAttributeNode", ElementSetAttributeNode, 1},

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -64,9 +65,7 @@ GetEntityProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetPublicId(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -77,9 +76,7 @@ GetEntityProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetSystemId(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -90,9 +87,7 @@ GetEntityProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetNotationName(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -100,25 +95,11 @@ GetEntityProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -142,25 +123,11 @@ SetEntityProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -173,18 +140,7 @@ SetEntityProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeEntity(JSContext *cx, JSObject *obj)
{
nsIDOMEntity *a = (nsIDOMEntity*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -194,17 +150,7 @@ FinalizeEntity(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateEntity(JSContext *cx, JSObject *obj)
{
nsIDOMEntity *a = (nsIDOMEntity*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -214,17 +160,7 @@ EnumerateEntity(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveEntity(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMEntity *a = (nsIDOMEntity*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -54,25 +55,11 @@ GetEntityReferenceProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -96,25 +83,11 @@ SetEntityReferenceProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -127,18 +100,7 @@ SetEntityReferenceProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeEntityReference(JSContext *cx, JSObject *obj)
{
nsIDOMEntityReference *a = (nsIDOMEntityReference*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -148,17 +110,7 @@ FinalizeEntityReference(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateEntityReference(JSContext *cx, JSObject *obj)
{
nsIDOMEntityReference *a = (nsIDOMEntityReference*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -168,17 +120,7 @@ EnumerateEntityReference(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveEntityReference(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMEntityReference *a = (nsIDOMEntityReference*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -77,22 +78,7 @@ GetNamedNodeMapProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMNode* prop;
if (NS_OK == a->Item(JSVAL_TO_INT(id), &prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -101,13 +87,7 @@ GetNamedNodeMapProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -131,25 +111,11 @@ SetNamedNodeMapProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -162,18 +128,7 @@ SetNamedNodeMapProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeNamedNodeMap(JSContext *cx, JSObject *obj)
{
nsIDOMNamedNodeMap *a = (nsIDOMNamedNodeMap*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -183,17 +138,7 @@ FinalizeNamedNodeMap(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateNamedNodeMap(JSContext *cx, JSObject *obj)
{
nsIDOMNamedNodeMap *a = (nsIDOMNamedNodeMap*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -203,17 +148,7 @@ EnumerateNamedNodeMap(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveNamedNodeMap(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMNamedNodeMap *a = (nsIDOMNamedNodeMap*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}
@ -237,34 +172,13 @@ NamedNodeMapGetNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->GetNamedItem(b0, &nativeRet)) {
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function getNamedItem requires 1 parameters");
@ -295,21 +209,11 @@ NamedNodeMapSetNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
if (argc >= 1) {
if (JSVAL_IS_NULL(argv[0])){
b0 = nsnull;
}
else if (JSVAL_IS_OBJECT(argv[0])) {
nsISupports *supports0 = (nsISupports *)JS_GetPrivate(cx, JSVAL_TO_OBJECT(argv[0]));
NS_ASSERTION(nsnull != supports0, "null pointer");
if ((nsnull == supports0) ||
(NS_OK != supports0->QueryInterface(kINodeIID, (void **)(b0.Query())))) {
JS_ReportError(cx, "Parameter must be of type Node");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (JS_FALSE == nsConvertJSValToObject((nsISupports **)&b0,
kINodeIID,
"Node",
cx,
argv[0])) {
return JS_FALSE;
}
@ -317,22 +221,7 @@ NamedNodeMapSetNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function setNamedItem requires 1 parameters");
@ -363,34 +252,13 @@ NamedNodeMapRemoveNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->RemoveNamedItem(b0, &nativeRet)) {
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function removeNamedItem requires 1 parameters");
@ -430,22 +298,7 @@ NamedNodeMapItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function item requires 1 parameters");

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -81,9 +82,7 @@ GetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetNodeName(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -94,9 +93,7 @@ GetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetNodeValue(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -119,22 +116,7 @@ GetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMNode* prop;
if (NS_OK == a->GetParentNode(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -146,22 +128,7 @@ GetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMNodeList* prop;
if (NS_OK == a->GetChildNodes(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -173,22 +140,7 @@ GetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMNode* prop;
if (NS_OK == a->GetFirstChild(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -200,22 +152,7 @@ GetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMNode* prop;
if (NS_OK == a->GetLastChild(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -227,22 +164,7 @@ GetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMNode* prop;
if (NS_OK == a->GetPreviousSibling(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -254,22 +176,7 @@ GetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMNode* prop;
if (NS_OK == a->GetNextSibling(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -281,22 +188,7 @@ GetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMNamedNodeMap* prop;
if (NS_OK == a->GetAttributes(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -308,22 +200,7 @@ GetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMDocument* prop;
if (NS_OK == a->GetOwnerDocument(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -331,25 +208,11 @@ GetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -374,38 +237,18 @@ SetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case NODE_NODEVALUE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetNodeValue(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -418,18 +261,7 @@ SetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeNode(JSContext *cx, JSObject *obj)
{
nsIDOMNode *a = (nsIDOMNode*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -439,17 +271,7 @@ FinalizeNode(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateNode(JSContext *cx, JSObject *obj)
{
nsIDOMNode *a = (nsIDOMNode*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -459,17 +281,7 @@ EnumerateNode(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveNode(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMNode *a = (nsIDOMNode*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}
@ -494,39 +306,19 @@ NodeInsertBefore(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
if (argc >= 2) {
if (JSVAL_IS_NULL(argv[0])){
b0 = nsnull;
}
else if (JSVAL_IS_OBJECT(argv[0])) {
nsISupports *supports0 = (nsISupports *)JS_GetPrivate(cx, JSVAL_TO_OBJECT(argv[0]));
NS_ASSERTION(nsnull != supports0, "null pointer");
if ((nsnull == supports0) ||
(NS_OK != supports0->QueryInterface(kINodeIID, (void **)(b0.Query())))) {
JS_ReportError(cx, "Parameter must be of type Node");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (JS_FALSE == nsConvertJSValToObject((nsISupports **)&b0,
kINodeIID,
"Node",
cx,
argv[0])) {
return JS_FALSE;
}
if (JSVAL_IS_NULL(argv[1])){
b1 = nsnull;
}
else if (JSVAL_IS_OBJECT(argv[1])) {
nsISupports *supports1 = (nsISupports *)JS_GetPrivate(cx, JSVAL_TO_OBJECT(argv[1]));
NS_ASSERTION(nsnull != supports1, "null pointer");
if ((nsnull == supports1) ||
(NS_OK != supports1->QueryInterface(kINodeIID, (void **)(b1.Query())))) {
JS_ReportError(cx, "Parameter must be of type Node");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (JS_FALSE == nsConvertJSValToObject((nsISupports **)&b1,
kINodeIID,
"Node",
cx,
argv[1])) {
return JS_FALSE;
}
@ -534,22 +326,7 @@ NodeInsertBefore(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function insertBefore requires 2 parameters");
@ -581,39 +358,19 @@ NodeReplaceChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
if (argc >= 2) {
if (JSVAL_IS_NULL(argv[0])){
b0 = nsnull;
}
else if (JSVAL_IS_OBJECT(argv[0])) {
nsISupports *supports0 = (nsISupports *)JS_GetPrivate(cx, JSVAL_TO_OBJECT(argv[0]));
NS_ASSERTION(nsnull != supports0, "null pointer");
if ((nsnull == supports0) ||
(NS_OK != supports0->QueryInterface(kINodeIID, (void **)(b0.Query())))) {
JS_ReportError(cx, "Parameter must be of type Node");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (JS_FALSE == nsConvertJSValToObject((nsISupports **)&b0,
kINodeIID,
"Node",
cx,
argv[0])) {
return JS_FALSE;
}
if (JSVAL_IS_NULL(argv[1])){
b1 = nsnull;
}
else if (JSVAL_IS_OBJECT(argv[1])) {
nsISupports *supports1 = (nsISupports *)JS_GetPrivate(cx, JSVAL_TO_OBJECT(argv[1]));
NS_ASSERTION(nsnull != supports1, "null pointer");
if ((nsnull == supports1) ||
(NS_OK != supports1->QueryInterface(kINodeIID, (void **)(b1.Query())))) {
JS_ReportError(cx, "Parameter must be of type Node");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (JS_FALSE == nsConvertJSValToObject((nsISupports **)&b1,
kINodeIID,
"Node",
cx,
argv[1])) {
return JS_FALSE;
}
@ -621,22 +378,7 @@ NodeReplaceChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function replaceChild requires 2 parameters");
@ -667,21 +409,11 @@ NodeRemoveChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
if (argc >= 1) {
if (JSVAL_IS_NULL(argv[0])){
b0 = nsnull;
}
else if (JSVAL_IS_OBJECT(argv[0])) {
nsISupports *supports0 = (nsISupports *)JS_GetPrivate(cx, JSVAL_TO_OBJECT(argv[0]));
NS_ASSERTION(nsnull != supports0, "null pointer");
if ((nsnull == supports0) ||
(NS_OK != supports0->QueryInterface(kINodeIID, (void **)(b0.Query())))) {
JS_ReportError(cx, "Parameter must be of type Node");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (JS_FALSE == nsConvertJSValToObject((nsISupports **)&b0,
kINodeIID,
"Node",
cx,
argv[0])) {
return JS_FALSE;
}
@ -689,22 +421,7 @@ NodeRemoveChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function removeChild requires 1 parameters");
@ -735,21 +452,11 @@ NodeAppendChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
if (argc >= 1) {
if (JSVAL_IS_NULL(argv[0])){
b0 = nsnull;
}
else if (JSVAL_IS_OBJECT(argv[0])) {
nsISupports *supports0 = (nsISupports *)JS_GetPrivate(cx, JSVAL_TO_OBJECT(argv[0]));
NS_ASSERTION(nsnull != supports0, "null pointer");
if ((nsnull == supports0) ||
(NS_OK != supports0->QueryInterface(kINodeIID, (void **)(b0.Query())))) {
JS_ReportError(cx, "Parameter must be of type Node");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (JS_FALSE == nsConvertJSValToObject((nsISupports **)&b0,
kINodeIID,
"Node",
cx,
argv[0])) {
return JS_FALSE;
}
@ -757,22 +464,7 @@ NodeAppendChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function appendChild requires 1 parameters");
@ -837,8 +529,7 @@ NodeCloneNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
if (argc >= 1) {
if (!JS_ValueToBoolean(cx, argv[0], &b0)) {
JS_ReportError(cx, "Parameter must be a boolean");
if (!nsConvertJSValToBool(&b0, cx, argv[0])) {
return JS_FALSE;
}
@ -846,22 +537,7 @@ NodeCloneNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function cloneNode requires 1 parameters");

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -77,22 +78,7 @@ GetNodeListProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMNode* prop;
if (NS_OK == a->Item(JSVAL_TO_INT(id), &prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -101,13 +87,7 @@ GetNodeListProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -131,25 +111,11 @@ SetNodeListProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -162,18 +128,7 @@ SetNodeListProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeNodeList(JSContext *cx, JSObject *obj)
{
nsIDOMNodeList *a = (nsIDOMNodeList*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -183,17 +138,7 @@ FinalizeNodeList(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateNodeList(JSContext *cx, JSObject *obj)
{
nsIDOMNodeList *a = (nsIDOMNodeList*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -203,17 +148,7 @@ EnumerateNodeList(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveNodeList(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMNodeList *a = (nsIDOMNodeList*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}
@ -246,22 +181,7 @@ NodeListItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function item requires 1 parameters");

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -63,9 +64,7 @@ GetNotationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetPublicId(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -76,9 +75,7 @@ GetNotationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetSystemId(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -86,25 +83,11 @@ GetNotationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -128,25 +111,11 @@ SetNotationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -159,18 +128,7 @@ SetNotationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeNotation(JSContext *cx, JSObject *obj)
{
nsIDOMNotation *a = (nsIDOMNotation*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -180,17 +138,7 @@ FinalizeNotation(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateNotation(JSContext *cx, JSObject *obj)
{
nsIDOMNotation *a = (nsIDOMNotation*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -200,17 +148,7 @@ EnumerateNotation(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveNotation(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMNotation *a = (nsIDOMNotation*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -63,9 +64,7 @@ GetProcessingInstructionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *
{
nsAutoString prop;
if (NS_OK == a->GetTarget(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -76,9 +75,7 @@ GetProcessingInstructionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *
{
nsAutoString prop;
if (NS_OK == a->GetData(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -86,25 +83,11 @@ GetProcessingInstructionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -129,38 +112,18 @@ SetProcessingInstructionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *
case PROCESSINGINSTRUCTION_DATA:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetData(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -173,18 +136,7 @@ SetProcessingInstructionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *
PR_STATIC_CALLBACK(void)
FinalizeProcessingInstruction(JSContext *cx, JSObject *obj)
{
nsIDOMProcessingInstruction *a = (nsIDOMProcessingInstruction*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -194,17 +146,7 @@ FinalizeProcessingInstruction(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateProcessingInstruction(JSContext *cx, JSObject *obj)
{
nsIDOMProcessingInstruction *a = (nsIDOMProcessingInstruction*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -214,17 +156,7 @@ EnumerateProcessingInstruction(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveProcessingInstruction(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMProcessingInstruction *a = (nsIDOMProcessingInstruction*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -86,22 +87,7 @@ GetRangeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMNode* prop;
if (NS_OK == a->GetStartParent(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -124,22 +110,7 @@ GetRangeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMNode* prop;
if (NS_OK == a->GetEndParent(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -173,22 +144,7 @@ GetRangeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMNode* prop;
if (NS_OK == a->GetCommonParent(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -196,25 +152,11 @@ GetRangeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -239,12 +181,7 @@ SetRangeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case RANGE_ISPOSITIONED:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -255,24 +192,14 @@ SetRangeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case RANGE_STARTPARENT:
{
nsIDOMNode* prop;
if (JSVAL_IS_NULL(*vp)) {
prop = nsnull;
}
else if (JSVAL_IS_OBJECT(*vp)) {
JSObject *jsobj = JSVAL_TO_OBJECT(*vp);
nsISupports *supports = (nsISupports *)JS_GetPrivate(cx, jsobj);
if (NS_OK != supports->QueryInterface(kINodeIID, (void **)&prop)) {
JS_ReportError(cx, "Parameter must be of type Node");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (PR_FALSE == nsConvertJSValToObject((nsISupports **)&prop,
kINodeIID, "Node",
cx, *vp)) {
return JS_FALSE;
}
a->SetStartParent(prop);
if (prop) NS_RELEASE(prop);
NS_IF_RELEASE(prop);
break;
}
case RANGE_STARTOFFSET:
@ -294,24 +221,14 @@ SetRangeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case RANGE_ENDPARENT:
{
nsIDOMNode* prop;
if (JSVAL_IS_NULL(*vp)) {
prop = nsnull;
}
else if (JSVAL_IS_OBJECT(*vp)) {
JSObject *jsobj = JSVAL_TO_OBJECT(*vp);
nsISupports *supports = (nsISupports *)JS_GetPrivate(cx, jsobj);
if (NS_OK != supports->QueryInterface(kINodeIID, (void **)&prop)) {
JS_ReportError(cx, "Parameter must be of type Node");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (PR_FALSE == nsConvertJSValToObject((nsISupports **)&prop,
kINodeIID, "Node",
cx, *vp)) {
return JS_FALSE;
}
a->SetEndParent(prop);
if (prop) NS_RELEASE(prop);
NS_IF_RELEASE(prop);
break;
}
case RANGE_ENDOFFSET:
@ -333,12 +250,7 @@ SetRangeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case RANGE_ISCOLLAPSED:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -349,46 +261,22 @@ SetRangeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case RANGE_COMMONPARENT:
{
nsIDOMNode* prop;
if (JSVAL_IS_NULL(*vp)) {
prop = nsnull;
}
else if (JSVAL_IS_OBJECT(*vp)) {
JSObject *jsobj = JSVAL_TO_OBJECT(*vp);
nsISupports *supports = (nsISupports *)JS_GetPrivate(cx, jsobj);
if (NS_OK != supports->QueryInterface(kINodeIID, (void **)&prop)) {
JS_ReportError(cx, "Parameter must be of type Node");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (PR_FALSE == nsConvertJSValToObject((nsISupports **)&prop,
kINodeIID, "Node",
cx, *vp)) {
return JS_FALSE;
}
a->SetCommonParent(prop);
if (prop) NS_RELEASE(prop);
NS_IF_RELEASE(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -401,18 +289,7 @@ SetRangeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeRange(JSContext *cx, JSObject *obj)
{
nsIDOMRange *a = (nsIDOMRange*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -422,17 +299,7 @@ FinalizeRange(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateRange(JSContext *cx, JSObject *obj)
{
nsIDOMRange *a = (nsIDOMRange*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -442,17 +309,7 @@ EnumerateRange(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveRange(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMRange *a = (nsIDOMRange*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}
@ -476,21 +333,11 @@ RangeSetStart(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
if (argc >= 2) {
if (JSVAL_IS_NULL(argv[0])){
b0 = nsnull;
}
else if (JSVAL_IS_OBJECT(argv[0])) {
nsISupports *supports0 = (nsISupports *)JS_GetPrivate(cx, JSVAL_TO_OBJECT(argv[0]));
NS_ASSERTION(nsnull != supports0, "null pointer");
if ((nsnull == supports0) ||
(NS_OK != supports0->QueryInterface(kINodeIID, (void **)(b0.Query())))) {
JS_ReportError(cx, "Parameter must be of type Node");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (JS_FALSE == nsConvertJSValToObject((nsISupports **)&b0,
kINodeIID,
"Node",
cx,
argv[0])) {
return JS_FALSE;
}
@ -534,21 +381,11 @@ RangeSetEnd(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
if (argc >= 2) {
if (JSVAL_IS_NULL(argv[0])){
b0 = nsnull;
}
else if (JSVAL_IS_OBJECT(argv[0])) {
nsISupports *supports0 = (nsISupports *)JS_GetPrivate(cx, JSVAL_TO_OBJECT(argv[0]));
NS_ASSERTION(nsnull != supports0, "null pointer");
if ((nsnull == supports0) ||
(NS_OK != supports0->QueryInterface(kINodeIID, (void **)(b0.Query())))) {
JS_ReportError(cx, "Parameter must be of type Node");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (JS_FALSE == nsConvertJSValToObject((nsISupports **)&b0,
kINodeIID,
"Node",
cx,
argv[0])) {
return JS_FALSE;
}
@ -591,8 +428,7 @@ RangeCollapse(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
if (argc >= 1) {
if (!JS_ValueToBoolean(cx, argv[0], &b0)) {
JS_ReportError(cx, "Parameter must be a boolean");
if (!nsConvertJSValToBool(&b0, cx, argv[0])) {
return JS_FALSE;
}
@ -663,21 +499,11 @@ RangeSelectNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
if (argc >= 1) {
if (JSVAL_IS_NULL(argv[0])){
b0 = nsnull;
}
else if (JSVAL_IS_OBJECT(argv[0])) {
nsISupports *supports0 = (nsISupports *)JS_GetPrivate(cx, JSVAL_TO_OBJECT(argv[0]));
NS_ASSERTION(nsnull != supports0, "null pointer");
if ((nsnull == supports0) ||
(NS_OK != supports0->QueryInterface(kINodeIID, (void **)(b0.Query())))) {
JS_ReportError(cx, "Parameter must be of type Node");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (JS_FALSE == nsConvertJSValToObject((nsISupports **)&b0,
kINodeIID,
"Node",
cx,
argv[0])) {
return JS_FALSE;
}
@ -715,21 +541,11 @@ RangeSelectNodeContents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
if (argc >= 1) {
if (JSVAL_IS_NULL(argv[0])){
b0 = nsnull;
}
else if (JSVAL_IS_OBJECT(argv[0])) {
nsISupports *supports0 = (nsISupports *)JS_GetPrivate(cx, JSVAL_TO_OBJECT(argv[0]));
NS_ASSERTION(nsnull != supports0, "null pointer");
if ((nsnull == supports0) ||
(NS_OK != supports0->QueryInterface(kINodeIID, (void **)(b0.Query())))) {
JS_ReportError(cx, "Parameter must be of type Node");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (JS_FALSE == nsConvertJSValToObject((nsISupports **)&b0,
kINodeIID,
"Node",
cx,
argv[0])) {
return JS_FALSE;
}
@ -804,22 +620,7 @@ RangeExtractContents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function extractContents requires 0 parameters");
@ -853,22 +654,7 @@ RangeCopyContents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function copyContents requires 0 parameters");
@ -898,21 +684,11 @@ RangeInsertNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
if (argc >= 1) {
if (JSVAL_IS_NULL(argv[0])){
b0 = nsnull;
}
else if (JSVAL_IS_OBJECT(argv[0])) {
nsISupports *supports0 = (nsISupports *)JS_GetPrivate(cx, JSVAL_TO_OBJECT(argv[0]));
NS_ASSERTION(nsnull != supports0, "null pointer");
if ((nsnull == supports0) ||
(NS_OK != supports0->QueryInterface(kINodeIID, (void **)(b0.Query())))) {
JS_ReportError(cx, "Parameter must be of type Node");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (JS_FALSE == nsConvertJSValToObject((nsISupports **)&b0,
kINodeIID,
"Node",
cx,
argv[0])) {
return JS_FALSE;
}
@ -950,21 +726,11 @@ RangeSurroundContents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
if (argc >= 1) {
if (JSVAL_IS_NULL(argv[0])){
b0 = nsnull;
}
else if (JSVAL_IS_OBJECT(argv[0])) {
nsISupports *supports0 = (nsISupports *)JS_GetPrivate(cx, JSVAL_TO_OBJECT(argv[0]));
NS_ASSERTION(nsnull != supports0, "null pointer");
if ((nsnull == supports0) ||
(NS_OK != supports0->QueryInterface(kINodeIID, (void **)(b0.Query())))) {
JS_ReportError(cx, "Parameter must be of type Node");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (JS_FALSE == nsConvertJSValToObject((nsISupports **)&b0,
kINodeIID,
"Node",
cx,
argv[0])) {
return JS_FALSE;
}
@ -1006,22 +772,7 @@ RangeClone(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function clone requires 0 parameters");
@ -1055,9 +806,7 @@ RangeToString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
return JS_FALSE;
}
JSString *jsstring = JS_NewUCStringCopyN(cx, nativeRet, nativeRet.Length());
// set the return value
*rval = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function toString requires 0 parameters");

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -64,9 +65,7 @@ GetStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetType(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -96,25 +95,11 @@ GetStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -139,12 +124,7 @@ SetStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case STYLESHEET_DISABLED:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -153,25 +133,11 @@ SetStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -184,18 +150,7 @@ SetStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeStyleSheet(JSContext *cx, JSObject *obj)
{
nsIDOMStyleSheet *a = (nsIDOMStyleSheet*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -205,17 +160,7 @@ FinalizeStyleSheet(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateStyleSheet(JSContext *cx, JSObject *obj)
{
nsIDOMStyleSheet *a = (nsIDOMStyleSheet*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -225,17 +170,7 @@ EnumerateStyleSheet(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveStyleSheet(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMStyleSheet *a = (nsIDOMStyleSheet*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -77,22 +78,7 @@ GetStyleSheetCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
nsIDOMStyleSheet* prop;
if (NS_OK == a->Item(JSVAL_TO_INT(id), &prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -101,13 +87,7 @@ GetStyleSheetCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -131,25 +111,11 @@ SetStyleSheetCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -162,18 +128,7 @@ SetStyleSheetCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
PR_STATIC_CALLBACK(void)
FinalizeStyleSheetCollection(JSContext *cx, JSObject *obj)
{
nsIDOMStyleSheetCollection *a = (nsIDOMStyleSheetCollection*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -183,17 +138,7 @@ FinalizeStyleSheetCollection(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateStyleSheetCollection(JSContext *cx, JSObject *obj)
{
nsIDOMStyleSheetCollection *a = (nsIDOMStyleSheetCollection*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -203,17 +148,7 @@ EnumerateStyleSheetCollection(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveStyleSheetCollection(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMStyleSheetCollection *a = (nsIDOMStyleSheetCollection*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}
@ -246,22 +181,7 @@ StyleSheetCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function item requires 1 parameters");

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -54,25 +55,11 @@ GetTextProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -96,25 +83,11 @@ SetTextProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -127,18 +100,7 @@ SetTextProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeText(JSContext *cx, JSObject *obj)
{
nsIDOMText *a = (nsIDOMText*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -148,17 +110,7 @@ FinalizeText(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateText(JSContext *cx, JSObject *obj)
{
nsIDOMText *a = (nsIDOMText*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -168,17 +120,7 @@ EnumerateText(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveText(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMText *a = (nsIDOMText*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}
@ -211,22 +153,7 @@ TextSplitText(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function splitText requires 1 parameters");

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -66,22 +67,7 @@ GetCSSFontFaceRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMCSSStyleDeclaration* prop;
if (NS_OK == a->GetStyle(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -89,25 +75,11 @@ GetCSSFontFaceRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -132,46 +104,22 @@ SetCSSFontFaceRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case CSSFONTFACERULE_STYLE:
{
nsIDOMCSSStyleDeclaration* prop;
if (JSVAL_IS_NULL(*vp)) {
prop = nsnull;
}
else if (JSVAL_IS_OBJECT(*vp)) {
JSObject *jsobj = JSVAL_TO_OBJECT(*vp);
nsISupports *supports = (nsISupports *)JS_GetPrivate(cx, jsobj);
if (NS_OK != supports->QueryInterface(kICSSStyleDeclarationIID, (void **)&prop)) {
JS_ReportError(cx, "Parameter must be of type CSSStyleDeclaration");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (PR_FALSE == nsConvertJSValToObject((nsISupports **)&prop,
kICSSStyleDeclarationIID, "CSSStyleDeclaration",
cx, *vp)) {
return JS_FALSE;
}
a->SetStyle(prop);
if (prop) NS_RELEASE(prop);
NS_IF_RELEASE(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -184,18 +132,7 @@ SetCSSFontFaceRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeCSSFontFaceRule(JSContext *cx, JSObject *obj)
{
nsIDOMCSSFontFaceRule *a = (nsIDOMCSSFontFaceRule*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -205,17 +142,7 @@ FinalizeCSSFontFaceRule(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateCSSFontFaceRule(JSContext *cx, JSObject *obj)
{
nsIDOMCSSFontFaceRule *a = (nsIDOMCSSFontFaceRule*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -225,17 +152,7 @@ EnumerateCSSFontFaceRule(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveCSSFontFaceRule(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMCSSFontFaceRule *a = (nsIDOMCSSFontFaceRule*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -67,9 +68,7 @@ GetCSSImportRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetHref(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -80,9 +79,7 @@ GetCSSImportRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetMedia(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -94,22 +91,7 @@ GetCSSImportRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMCSSStyleSheet* prop;
if (NS_OK == a->GetStyleSheet(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -117,25 +99,11 @@ GetCSSImportRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -160,13 +128,7 @@ SetCSSImportRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case CSSIMPORTRULE_HREF:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetHref(prop);
@ -175,38 +137,18 @@ SetCSSImportRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case CSSIMPORTRULE_MEDIA:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetMedia(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -219,18 +161,7 @@ SetCSSImportRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeCSSImportRule(JSContext *cx, JSObject *obj)
{
nsIDOMCSSImportRule *a = (nsIDOMCSSImportRule*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -240,17 +171,7 @@ FinalizeCSSImportRule(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateCSSImportRule(JSContext *cx, JSObject *obj)
{
nsIDOMCSSImportRule *a = (nsIDOMCSSImportRule*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -260,17 +181,7 @@ EnumerateCSSImportRule(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveCSSImportRule(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMCSSImportRule *a = (nsIDOMCSSImportRule*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -66,9 +67,7 @@ GetCSSMediaRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetMediaTypes(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -80,22 +79,7 @@ GetCSSMediaRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMCSSStyleRuleCollection* prop;
if (NS_OK == a->GetCssRules(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -103,25 +87,11 @@ GetCSSMediaRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -146,38 +116,18 @@ SetCSSMediaRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case CSSMEDIARULE_MEDIATYPES:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetMediaTypes(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -190,18 +140,7 @@ SetCSSMediaRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeCSSMediaRule(JSContext *cx, JSObject *obj)
{
nsIDOMCSSMediaRule *a = (nsIDOMCSSMediaRule*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -211,17 +150,7 @@ FinalizeCSSMediaRule(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateCSSMediaRule(JSContext *cx, JSObject *obj)
{
nsIDOMCSSMediaRule *a = (nsIDOMCSSMediaRule*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -231,17 +160,7 @@ EnumerateCSSMediaRule(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveCSSMediaRule(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMCSSMediaRule *a = (nsIDOMCSSMediaRule*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}
@ -266,13 +185,7 @@ CSSMediaRuleInsertRule(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
if (argc >= 2) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (!JS_ValueToInt32(cx, argv[1], (int32 *)&b1)) {
JS_ReportError(cx, "Parameter must be a number");

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -66,9 +67,7 @@ GetCSSPageRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetName(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -80,22 +79,7 @@ GetCSSPageRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMCSSStyleDeclaration* prop;
if (NS_OK == a->GetStyle(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -103,25 +87,11 @@ GetCSSPageRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -146,13 +116,7 @@ SetCSSPageRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case CSSPAGERULE_NAME:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetName(prop);
@ -161,46 +125,22 @@ SetCSSPageRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case CSSPAGERULE_STYLE:
{
nsIDOMCSSStyleDeclaration* prop;
if (JSVAL_IS_NULL(*vp)) {
prop = nsnull;
}
else if (JSVAL_IS_OBJECT(*vp)) {
JSObject *jsobj = JSVAL_TO_OBJECT(*vp);
nsISupports *supports = (nsISupports *)JS_GetPrivate(cx, jsobj);
if (NS_OK != supports->QueryInterface(kICSSStyleDeclarationIID, (void **)&prop)) {
JS_ReportError(cx, "Parameter must be of type CSSStyleDeclaration");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (PR_FALSE == nsConvertJSValToObject((nsISupports **)&prop,
kICSSStyleDeclarationIID, "CSSStyleDeclaration",
cx, *vp)) {
return JS_FALSE;
}
a->SetStyle(prop);
if (prop) NS_RELEASE(prop);
NS_IF_RELEASE(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -213,18 +153,7 @@ SetCSSPageRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeCSSPageRule(JSContext *cx, JSObject *obj)
{
nsIDOMCSSPageRule *a = (nsIDOMCSSPageRule*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -234,17 +163,7 @@ FinalizeCSSPageRule(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateCSSPageRule(JSContext *cx, JSObject *obj)
{
nsIDOMCSSPageRule *a = (nsIDOMCSSPageRule*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -254,17 +173,7 @@ EnumerateCSSPageRule(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveCSSPageRule(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMCSSPageRule *a = (nsIDOMCSSPageRule*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -78,9 +79,7 @@ GetCSSRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetCssText(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -92,22 +91,7 @@ GetCSSRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMCSSStyleSheet* prop;
if (NS_OK == a->GetSheet(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -115,25 +99,11 @@ GetCSSRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -158,38 +128,18 @@ SetCSSRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case CSSRULE_CSSTEXT:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetCssText(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -202,18 +152,7 @@ SetCSSRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeCSSRule(JSContext *cx, JSObject *obj)
{
nsIDOMCSSRule *a = (nsIDOMCSSRule*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -223,17 +162,7 @@ FinalizeCSSRule(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateCSSRule(JSContext *cx, JSObject *obj)
{
nsIDOMCSSRule *a = (nsIDOMCSSRule*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -243,17 +172,7 @@ EnumerateCSSRule(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveCSSRule(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMCSSRule *a = (nsIDOMCSSRule*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -63,9 +64,7 @@ GetCSSStyleDeclarationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
{
nsAutoString prop;
if (NS_OK == a->GetCssText(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -87,9 +86,7 @@ GetCSSStyleDeclarationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
{
nsAutoString prop;
if (NS_OK == a->Item(JSVAL_TO_INT(id), prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -98,13 +95,7 @@ GetCSSStyleDeclarationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -129,38 +120,18 @@ SetCSSStyleDeclarationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
case CSSSTYLEDECLARATION_CSSTEXT:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetCssText(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -173,18 +144,7 @@ SetCSSStyleDeclarationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
PR_STATIC_CALLBACK(void)
FinalizeCSSStyleDeclaration(JSContext *cx, JSObject *obj)
{
nsIDOMCSSStyleDeclaration *a = (nsIDOMCSSStyleDeclaration*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -194,17 +154,7 @@ FinalizeCSSStyleDeclaration(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateCSSStyleDeclaration(JSContext *cx, JSObject *obj)
{
nsIDOMCSSStyleDeclaration *a = (nsIDOMCSSStyleDeclaration*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -214,17 +164,7 @@ EnumerateCSSStyleDeclaration(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveCSSStyleDeclaration(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMCSSStyleDeclaration *a = (nsIDOMCSSStyleDeclaration*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}
@ -248,21 +188,13 @@ CSSStyleDeclarationGetPropertyValue(JSContext *cx, JSObject *obj, uintN argc, js
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->GetPropertyValue(b0, nativeRet)) {
return JS_FALSE;
}
JSString *jsstring = JS_NewUCStringCopyN(cx, nativeRet, nativeRet.Length());
// set the return value
*rval = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function getPropertyValue requires 1 parameters");
@ -293,21 +225,13 @@ CSSStyleDeclarationGetPropertyPriority(JSContext *cx, JSObject *obj, uintN argc,
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->GetPropertyPriority(b0, nativeRet)) {
return JS_FALSE;
}
JSString *jsstring = JS_NewUCStringCopyN(cx, nativeRet, nativeRet.Length());
// set the return value
*rval = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function getPropertyPriority requires 1 parameters");
@ -339,29 +263,11 @@ CSSStyleDeclarationSetProperty(JSContext *cx, JSObject *obj, uintN argc, jsval *
if (argc >= 3) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
JSString *jsstring1 = JS_ValueToString(cx, argv[1]);
if (nsnull != jsstring1) {
b1.SetString(JS_GetStringChars(jsstring1));
}
else {
b1.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b1, cx, argv[1]);
JSString *jsstring2 = JS_ValueToString(cx, argv[2]);
if (nsnull != jsstring2) {
b2.SetString(JS_GetStringChars(jsstring2));
}
else {
b2.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b2, cx, argv[2]);
if (NS_OK != nativeThis->SetProperty(b0, b1, b2)) {
return JS_FALSE;
@ -407,9 +313,7 @@ CSSStyleDeclarationItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
return JS_FALSE;
}
JSString *jsstring = JS_NewUCStringCopyN(cx, nativeRet, nativeRet.Length());
// set the return value
*rval = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function item requires 1 parameters");

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -66,9 +67,7 @@ GetCSSStyleRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetSelectorText(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -80,22 +79,7 @@ GetCSSStyleRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMCSSStyleDeclaration* prop;
if (NS_OK == a->GetStyle(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -103,25 +87,11 @@ GetCSSStyleRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -146,13 +116,7 @@ SetCSSStyleRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case CSSSTYLERULE_SELECTORTEXT:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetSelectorText(prop);
@ -161,46 +125,22 @@ SetCSSStyleRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case CSSSTYLERULE_STYLE:
{
nsIDOMCSSStyleDeclaration* prop;
if (JSVAL_IS_NULL(*vp)) {
prop = nsnull;
}
else if (JSVAL_IS_OBJECT(*vp)) {
JSObject *jsobj = JSVAL_TO_OBJECT(*vp);
nsISupports *supports = (nsISupports *)JS_GetPrivate(cx, jsobj);
if (NS_OK != supports->QueryInterface(kICSSStyleDeclarationIID, (void **)&prop)) {
JS_ReportError(cx, "Parameter must be of type CSSStyleDeclaration");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (PR_FALSE == nsConvertJSValToObject((nsISupports **)&prop,
kICSSStyleDeclarationIID, "CSSStyleDeclaration",
cx, *vp)) {
return JS_FALSE;
}
a->SetStyle(prop);
if (prop) NS_RELEASE(prop);
NS_IF_RELEASE(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -213,18 +153,7 @@ SetCSSStyleRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeCSSStyleRule(JSContext *cx, JSObject *obj)
{
nsIDOMCSSStyleRule *a = (nsIDOMCSSStyleRule*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -234,17 +163,7 @@ FinalizeCSSStyleRule(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateCSSStyleRule(JSContext *cx, JSObject *obj)
{
nsIDOMCSSStyleRule *a = (nsIDOMCSSStyleRule*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -254,17 +173,7 @@ EnumerateCSSStyleRule(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveCSSStyleRule(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMCSSStyleRule *a = (nsIDOMCSSStyleRule*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -77,22 +78,7 @@ GetCSSStyleRuleCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval
nsIDOMCSSStyleRule* prop;
if (NS_OK == a->Item(JSVAL_TO_INT(id), &prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -101,13 +87,7 @@ GetCSSStyleRuleCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -131,25 +111,11 @@ SetCSSStyleRuleCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -162,18 +128,7 @@ SetCSSStyleRuleCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval
PR_STATIC_CALLBACK(void)
FinalizeCSSStyleRuleCollection(JSContext *cx, JSObject *obj)
{
nsIDOMCSSStyleRuleCollection *a = (nsIDOMCSSStyleRuleCollection*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -183,17 +138,7 @@ FinalizeCSSStyleRuleCollection(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateCSSStyleRuleCollection(JSContext *cx, JSObject *obj)
{
nsIDOMCSSStyleRuleCollection *a = (nsIDOMCSSStyleRuleCollection*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -203,17 +148,7 @@ EnumerateCSSStyleRuleCollection(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveCSSStyleRuleCollection(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMCSSStyleRuleCollection *a = (nsIDOMCSSStyleRuleCollection*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}
@ -246,22 +181,7 @@ CSSStyleRuleCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function item requires 1 parameters");

Просмотреть файл

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -77,22 +78,7 @@ GetCSSStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMNode* prop;
if (NS_OK == a->GetOwningNode(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -104,22 +90,7 @@ GetCSSStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMStyleSheet* prop;
if (NS_OK == a->GetParentStyleSheet(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -130,9 +101,7 @@ GetCSSStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetHref(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -143,9 +112,7 @@ GetCSSStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetTitle(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -156,9 +123,7 @@ GetCSSStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetMedia(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -170,22 +135,7 @@ GetCSSStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMCSSStyleRuleCollection* prop;
if (NS_OK == a->GetCssRules(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -193,25 +143,11 @@ GetCSSStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -235,25 +171,11 @@ SetCSSStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -266,18 +188,7 @@ SetCSSStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeCSSStyleSheet(JSContext *cx, JSObject *obj)
{
nsIDOMCSSStyleSheet *a = (nsIDOMCSSStyleSheet*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -287,17 +198,7 @@ FinalizeCSSStyleSheet(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateCSSStyleSheet(JSContext *cx, JSObject *obj)
{
nsIDOMCSSStyleSheet *a = (nsIDOMCSSStyleSheet*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -307,17 +208,7 @@ EnumerateCSSStyleSheet(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveCSSStyleSheet(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMCSSStyleSheet *a = (nsIDOMCSSStyleSheet*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}
@ -342,13 +233,7 @@ CSSStyleSheetInsertRule(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
if (argc >= 2) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (!JS_ValueToInt32(cx, argv[1], (int32 *)&b1)) {
JS_ReportError(cx, "Parameter must be a number");

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -54,25 +55,11 @@ GetCSSUnknownRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -96,25 +83,11 @@ SetCSSUnknownRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -127,18 +100,7 @@ SetCSSUnknownRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeCSSUnknownRule(JSContext *cx, JSObject *obj)
{
nsIDOMCSSUnknownRule *a = (nsIDOMCSSUnknownRule*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -148,17 +110,7 @@ FinalizeCSSUnknownRule(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateCSSUnknownRule(JSContext *cx, JSObject *obj)
{
nsIDOMCSSUnknownRule *a = (nsIDOMCSSUnknownRule*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -168,17 +120,7 @@ EnumerateCSSUnknownRule(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveCSSUnknownRule(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMCSSUnknownRule *a = (nsIDOMCSSUnknownRule*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -90,9 +91,7 @@ GetEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetType(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -104,22 +103,7 @@ GetEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMNode* prop;
if (NS_OK == a->GetTarget(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -365,22 +349,7 @@ GetEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (NS_OK == a->QueryInterface(kINSEventIID, (void **)&b)) {
if(NS_OK == b->GetRc(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
NS_RELEASE(b);
}
else {
@ -395,25 +364,11 @@ GetEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -438,13 +393,7 @@ SetEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case EVENT_TYPE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetType(prop);
@ -453,24 +402,14 @@ SetEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case EVENT_TARGET:
{
nsIDOMNode* prop;
if (JSVAL_IS_NULL(*vp)) {
prop = nsnull;
}
else if (JSVAL_IS_OBJECT(*vp)) {
JSObject *jsobj = JSVAL_TO_OBJECT(*vp);
nsISupports *supports = (nsISupports *)JS_GetPrivate(cx, jsobj);
if (NS_OK != supports->QueryInterface(kINodeIID, (void **)&prop)) {
JS_ReportError(cx, "Parameter must be of type Node");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (PR_FALSE == nsConvertJSValToObject((nsISupports **)&prop,
kINodeIID, "Node",
cx, *vp)) {
return JS_FALSE;
}
a->SetTarget(prop);
if (prop) NS_RELEASE(prop);
NS_IF_RELEASE(prop);
break;
}
case EVENT_SCREENX:
@ -540,12 +479,7 @@ SetEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case EVENT_ALTKEY:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -556,12 +490,7 @@ SetEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case EVENT_CTRLKEY:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -572,12 +501,7 @@ SetEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case EVENT_SHIFTKEY:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -588,12 +512,7 @@ SetEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case EVENT_METAKEY:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -604,12 +523,7 @@ SetEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case EVENT_CANCELBUBBLE:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -791,25 +705,11 @@ SetEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -822,18 +722,7 @@ SetEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeEvent(JSContext *cx, JSObject *obj)
{
nsIDOMEvent *a = (nsIDOMEvent*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -843,17 +732,7 @@ FinalizeEvent(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateEvent(JSContext *cx, JSObject *obj)
{
nsIDOMEvent *a = (nsIDOMEvent*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -863,17 +742,7 @@ EnumerateEvent(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveEvent(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMEvent *a = (nsIDOMEvent*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -73,9 +74,7 @@ GetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetAccessKey(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -86,9 +85,7 @@ GetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetCharset(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -99,9 +96,7 @@ GetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetCoords(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -112,9 +107,7 @@ GetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetHref(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -125,9 +118,7 @@ GetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetHreflang(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -138,9 +129,7 @@ GetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetName(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -151,9 +140,7 @@ GetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetRel(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -164,9 +151,7 @@ GetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetRev(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -177,9 +162,7 @@ GetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetShape(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -201,9 +184,7 @@ GetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetTarget(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -214,9 +195,7 @@ GetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetType(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -224,25 +203,11 @@ GetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -267,13 +232,7 @@ SetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLANCHORELEMENT_ACCESSKEY:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAccessKey(prop);
@ -282,13 +241,7 @@ SetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLANCHORELEMENT_CHARSET:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetCharset(prop);
@ -297,13 +250,7 @@ SetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLANCHORELEMENT_COORDS:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetCoords(prop);
@ -312,13 +259,7 @@ SetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLANCHORELEMENT_HREF:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetHref(prop);
@ -327,13 +268,7 @@ SetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLANCHORELEMENT_HREFLANG:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetHreflang(prop);
@ -342,13 +277,7 @@ SetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLANCHORELEMENT_NAME:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetName(prop);
@ -357,13 +286,7 @@ SetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLANCHORELEMENT_REL:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetRel(prop);
@ -372,13 +295,7 @@ SetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLANCHORELEMENT_REV:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetRev(prop);
@ -387,13 +304,7 @@ SetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLANCHORELEMENT_SHAPE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetShape(prop);
@ -418,13 +329,7 @@ SetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLANCHORELEMENT_TARGET:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetTarget(prop);
@ -433,38 +338,18 @@ SetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLANCHORELEMENT_TYPE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetType(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -477,18 +362,7 @@ SetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLAnchorElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLAnchorElement *a = (nsIDOMHTMLAnchorElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -498,17 +372,7 @@ FinalizeHTMLAnchorElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLAnchorElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLAnchorElement *a = (nsIDOMHTMLAnchorElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -518,17 +382,7 @@ EnumerateHTMLAnchorElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLAnchorElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLAnchorElement *a = (nsIDOMHTMLAnchorElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -72,9 +73,7 @@ GetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetAlign(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -85,9 +84,7 @@ GetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetAlt(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -98,9 +95,7 @@ GetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetArchive(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -111,9 +106,7 @@ GetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetCode(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -124,9 +117,7 @@ GetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetCodeBase(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -137,9 +128,7 @@ GetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetHeight(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -150,9 +139,7 @@ GetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetHspace(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -163,9 +150,7 @@ GetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetName(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -176,9 +161,7 @@ GetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetObject(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -189,9 +172,7 @@ GetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetVspace(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -202,9 +183,7 @@ GetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetWidth(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -212,25 +191,11 @@ GetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -255,13 +220,7 @@ SetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLAPPLETELEMENT_ALIGN:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAlign(prop);
@ -270,13 +229,7 @@ SetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLAPPLETELEMENT_ALT:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAlt(prop);
@ -285,13 +238,7 @@ SetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLAPPLETELEMENT_ARCHIVE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetArchive(prop);
@ -300,13 +247,7 @@ SetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLAPPLETELEMENT_CODE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetCode(prop);
@ -315,13 +256,7 @@ SetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLAPPLETELEMENT_CODEBASE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetCodeBase(prop);
@ -330,13 +265,7 @@ SetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLAPPLETELEMENT_HEIGHT:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetHeight(prop);
@ -345,13 +274,7 @@ SetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLAPPLETELEMENT_HSPACE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetHspace(prop);
@ -360,13 +283,7 @@ SetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLAPPLETELEMENT_NAME:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetName(prop);
@ -375,13 +292,7 @@ SetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLAPPLETELEMENT_OBJECT:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetObject(prop);
@ -390,13 +301,7 @@ SetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLAPPLETELEMENT_VSPACE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetVspace(prop);
@ -405,38 +310,18 @@ SetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLAPPLETELEMENT_WIDTH:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetWidth(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -449,18 +334,7 @@ SetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLAppletElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLAppletElement *a = (nsIDOMHTMLAppletElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -470,17 +344,7 @@ FinalizeHTMLAppletElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLAppletElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLAppletElement *a = (nsIDOMHTMLAppletElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -490,17 +354,7 @@ EnumerateHTMLAppletElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLAppletElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLAppletElement *a = (nsIDOMHTMLAppletElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -69,9 +70,7 @@ GetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetAccessKey(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -82,9 +81,7 @@ GetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetAlt(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -95,9 +92,7 @@ GetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetCoords(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -108,9 +103,7 @@ GetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetHref(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -132,9 +125,7 @@ GetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetShape(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -156,9 +147,7 @@ GetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetTarget(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -166,25 +155,11 @@ GetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -209,13 +184,7 @@ SetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLAREAELEMENT_ACCESSKEY:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAccessKey(prop);
@ -224,13 +193,7 @@ SetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLAREAELEMENT_ALT:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAlt(prop);
@ -239,13 +202,7 @@ SetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLAREAELEMENT_COORDS:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetCoords(prop);
@ -254,13 +211,7 @@ SetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLAREAELEMENT_HREF:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetHref(prop);
@ -269,12 +220,7 @@ SetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLAREAELEMENT_NOHREF:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -285,13 +231,7 @@ SetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLAREAELEMENT_SHAPE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetShape(prop);
@ -316,38 +256,18 @@ SetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLAREAELEMENT_TARGET:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetTarget(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -360,18 +280,7 @@ SetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLAreaElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLAreaElement *a = (nsIDOMHTMLAreaElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -381,17 +290,7 @@ FinalizeHTMLAreaElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLAreaElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLAreaElement *a = (nsIDOMHTMLAreaElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -401,17 +300,7 @@ EnumerateHTMLAreaElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLAreaElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLAreaElement *a = (nsIDOMHTMLAreaElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -62,9 +63,7 @@ GetHTMLBRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetClear(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -72,25 +71,11 @@ GetHTMLBRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -115,38 +100,18 @@ SetHTMLBRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLBRELEMENT_CLEAR:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetClear(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -159,18 +124,7 @@ SetHTMLBRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLBRElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLBRElement *a = (nsIDOMHTMLBRElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -180,17 +134,7 @@ FinalizeHTMLBRElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLBRElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLBRElement *a = (nsIDOMHTMLBRElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -200,17 +144,7 @@ EnumerateHTMLBRElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLBRElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLBRElement *a = (nsIDOMHTMLBRElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -63,9 +64,7 @@ GetHTMLBaseElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetHref(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -76,9 +75,7 @@ GetHTMLBaseElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetTarget(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -86,25 +83,11 @@ GetHTMLBaseElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -129,13 +112,7 @@ SetHTMLBaseElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLBASEELEMENT_HREF:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetHref(prop);
@ -144,38 +121,18 @@ SetHTMLBaseElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLBASEELEMENT_TARGET:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetTarget(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -188,18 +145,7 @@ SetHTMLBaseElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLBaseElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLBaseElement *a = (nsIDOMHTMLBaseElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -209,17 +155,7 @@ FinalizeHTMLBaseElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLBaseElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLBaseElement *a = (nsIDOMHTMLBaseElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -229,17 +165,7 @@ EnumerateHTMLBaseElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLBaseElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLBaseElement *a = (nsIDOMHTMLBaseElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -64,9 +65,7 @@ GetHTMLBaseFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
{
nsAutoString prop;
if (NS_OK == a->GetColor(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -77,9 +76,7 @@ GetHTMLBaseFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
{
nsAutoString prop;
if (NS_OK == a->GetFace(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -90,9 +87,7 @@ GetHTMLBaseFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
{
nsAutoString prop;
if (NS_OK == a->GetSize(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -100,25 +95,11 @@ GetHTMLBaseFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -143,13 +124,7 @@ SetHTMLBaseFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
case HTMLBASEFONTELEMENT_COLOR:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetColor(prop);
@ -158,13 +133,7 @@ SetHTMLBaseFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
case HTMLBASEFONTELEMENT_FACE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetFace(prop);
@ -173,38 +142,18 @@ SetHTMLBaseFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
case HTMLBASEFONTELEMENT_SIZE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetSize(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -217,18 +166,7 @@ SetHTMLBaseFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
PR_STATIC_CALLBACK(void)
FinalizeHTMLBaseFontElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLBaseFontElement *a = (nsIDOMHTMLBaseFontElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -238,17 +176,7 @@ FinalizeHTMLBaseFontElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLBaseFontElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLBaseFontElement *a = (nsIDOMHTMLBaseFontElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -258,17 +186,7 @@ EnumerateHTMLBaseFontElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLBaseFontElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLBaseFontElement *a = (nsIDOMHTMLBaseFontElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -62,9 +63,7 @@ GetHTMLBlockquoteElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *
{
nsAutoString prop;
if (NS_OK == a->GetCite(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -72,25 +71,11 @@ GetHTMLBlockquoteElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -115,38 +100,18 @@ SetHTMLBlockquoteElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *
case HTMLBLOCKQUOTEELEMENT_CITE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetCite(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -159,18 +124,7 @@ SetHTMLBlockquoteElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *
PR_STATIC_CALLBACK(void)
FinalizeHTMLBlockquoteElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLBlockquoteElement *a = (nsIDOMHTMLBlockquoteElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -180,17 +134,7 @@ FinalizeHTMLBlockquoteElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLBlockquoteElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLBlockquoteElement *a = (nsIDOMHTMLBlockquoteElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -200,17 +144,7 @@ EnumerateHTMLBlockquoteElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLBlockquoteElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLBlockquoteElement *a = (nsIDOMHTMLBlockquoteElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -67,9 +68,7 @@ GetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetALink(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -80,9 +79,7 @@ GetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetBackground(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -93,9 +90,7 @@ GetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetBgColor(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -106,9 +101,7 @@ GetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetLink(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -119,9 +112,7 @@ GetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetText(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -132,9 +123,7 @@ GetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetVLink(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -142,25 +131,11 @@ GetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -185,13 +160,7 @@ SetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLBODYELEMENT_ALINK:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetALink(prop);
@ -200,13 +169,7 @@ SetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLBODYELEMENT_BACKGROUND:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetBackground(prop);
@ -215,13 +178,7 @@ SetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLBODYELEMENT_BGCOLOR:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetBgColor(prop);
@ -230,13 +187,7 @@ SetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLBODYELEMENT_LINK:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetLink(prop);
@ -245,13 +196,7 @@ SetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLBODYELEMENT_TEXT:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetText(prop);
@ -260,38 +205,18 @@ SetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLBODYELEMENT_VLINK:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetVLink(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -304,18 +229,7 @@ SetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLBodyElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLBodyElement *a = (nsIDOMHTMLBodyElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -325,17 +239,7 @@ FinalizeHTMLBodyElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLBodyElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLBodyElement *a = (nsIDOMHTMLBodyElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -345,17 +249,7 @@ EnumerateHTMLBodyElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLBodyElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLBodyElement *a = (nsIDOMHTMLBodyElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -75,22 +76,7 @@ GetHTMLButtonElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMHTMLFormElement* prop;
if (NS_OK == a->GetForm(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -101,9 +87,7 @@ GetHTMLButtonElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetAccessKey(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -125,9 +109,7 @@ GetHTMLButtonElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetName(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -149,9 +131,7 @@ GetHTMLButtonElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetType(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -162,9 +142,7 @@ GetHTMLButtonElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetValue(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -172,25 +150,11 @@ GetHTMLButtonElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -215,13 +179,7 @@ SetHTMLButtonElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLBUTTONELEMENT_ACCESSKEY:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAccessKey(prop);
@ -230,12 +188,7 @@ SetHTMLButtonElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLBUTTONELEMENT_DISABLED:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -246,13 +199,7 @@ SetHTMLButtonElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLBUTTONELEMENT_NAME:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetName(prop);
@ -277,38 +224,18 @@ SetHTMLButtonElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLBUTTONELEMENT_VALUE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetValue(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -321,18 +248,7 @@ SetHTMLButtonElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLButtonElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLButtonElement *a = (nsIDOMHTMLButtonElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -342,17 +258,7 @@ FinalizeHTMLButtonElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLButtonElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLButtonElement *a = (nsIDOMHTMLButtonElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -362,17 +268,7 @@ EnumerateHTMLButtonElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLButtonElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLButtonElement *a = (nsIDOMHTMLButtonElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -77,22 +78,7 @@ GetHTMLCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMNode* prop;
if (NS_OK == a->Item(JSVAL_TO_INT(id), &prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -115,31 +101,10 @@ GetHTMLCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (NS_OK == a->NamedItem(name, &prop)) {
if (NULL != prop) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
*vp = JSVAL_NULL;
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
@ -147,13 +112,7 @@ GetHTMLCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -177,25 +136,11 @@ SetHTMLCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -208,18 +153,7 @@ SetHTMLCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLCollection(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLCollection *a = (nsIDOMHTMLCollection*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -229,17 +163,7 @@ FinalizeHTMLCollection(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLCollection(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLCollection *a = (nsIDOMHTMLCollection*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -249,17 +173,7 @@ EnumerateHTMLCollection(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLCollection(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLCollection *a = (nsIDOMHTMLCollection*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}
@ -292,22 +206,7 @@ HTMLCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function item requires 1 parameters");
@ -338,34 +237,13 @@ HTMLCollectionNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->NamedItem(b0, &nativeRet)) {
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function namedItem requires 1 parameters");

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -70,25 +71,11 @@ GetHTMLDListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -113,12 +100,7 @@ SetHTMLDListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLDLISTELEMENT_COMPACT:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -127,25 +109,11 @@ SetHTMLDListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -158,18 +126,7 @@ SetHTMLDListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLDListElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLDListElement *a = (nsIDOMHTMLDListElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -179,17 +136,7 @@ FinalizeHTMLDListElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLDListElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLDListElement *a = (nsIDOMHTMLDListElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -199,17 +146,7 @@ EnumerateHTMLDListElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLDListElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLDListElement *a = (nsIDOMHTMLDListElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -70,25 +71,11 @@ GetHTMLDirectoryElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -113,12 +100,7 @@ SetHTMLDirectoryElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
case HTMLDIRECTORYELEMENT_COMPACT:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -127,25 +109,11 @@ SetHTMLDirectoryElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -158,18 +126,7 @@ SetHTMLDirectoryElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
PR_STATIC_CALLBACK(void)
FinalizeHTMLDirectoryElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLDirectoryElement *a = (nsIDOMHTMLDirectoryElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -179,17 +136,7 @@ FinalizeHTMLDirectoryElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLDirectoryElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLDirectoryElement *a = (nsIDOMHTMLDirectoryElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -199,17 +146,7 @@ EnumerateHTMLDirectoryElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLDirectoryElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLDirectoryElement *a = (nsIDOMHTMLDirectoryElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -62,9 +63,7 @@ GetHTMLDivElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetAlign(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -72,25 +71,11 @@ GetHTMLDivElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -115,38 +100,18 @@ SetHTMLDivElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLDIVELEMENT_ALIGN:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAlign(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -159,18 +124,7 @@ SetHTMLDivElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLDivElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLDivElement *a = (nsIDOMHTMLDivElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -180,17 +134,7 @@ FinalizeHTMLDivElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLDivElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLDivElement *a = (nsIDOMHTMLDivElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -200,17 +144,7 @@ EnumerateHTMLDivElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLDivElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLDivElement *a = (nsIDOMHTMLDivElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -96,9 +97,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetTitle(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -109,9 +108,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetReferrer(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -122,9 +119,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetDomain(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -135,9 +130,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetURL(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -149,22 +142,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMHTMLElement* prop;
if (NS_OK == a->GetBody(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -176,22 +154,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMHTMLCollection* prop;
if (NS_OK == a->GetImages(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -203,22 +166,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMHTMLCollection* prop;
if (NS_OK == a->GetApplets(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -230,22 +178,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMHTMLCollection* prop;
if (NS_OK == a->GetLinks(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -257,22 +190,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMHTMLCollection* prop;
if (NS_OK == a->GetForms(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -284,22 +202,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMHTMLCollection* prop;
if (NS_OK == a->GetAnchors(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -310,9 +213,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetCookie(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -325,9 +226,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMNSHTMLDocument* b;
if (NS_OK == a->QueryInterface(kINSHTMLDocumentIID, (void **)&b)) {
if(NS_OK == b->GetAlinkColor(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
NS_RELEASE(b);
}
else {
@ -347,9 +246,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMNSHTMLDocument* b;
if (NS_OK == a->QueryInterface(kINSHTMLDocumentIID, (void **)&b)) {
if(NS_OK == b->GetLinkColor(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
NS_RELEASE(b);
}
else {
@ -369,9 +266,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMNSHTMLDocument* b;
if (NS_OK == a->QueryInterface(kINSHTMLDocumentIID, (void **)&b)) {
if(NS_OK == b->GetVlinkColor(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
NS_RELEASE(b);
}
else {
@ -391,9 +286,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMNSHTMLDocument* b;
if (NS_OK == a->QueryInterface(kINSHTMLDocumentIID, (void **)&b)) {
if(NS_OK == b->GetBgColor(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
NS_RELEASE(b);
}
else {
@ -413,9 +306,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMNSHTMLDocument* b;
if (NS_OK == a->QueryInterface(kINSHTMLDocumentIID, (void **)&b)) {
if(NS_OK == b->GetFgColor(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
NS_RELEASE(b);
}
else {
@ -435,9 +326,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMNSHTMLDocument* b;
if (NS_OK == a->QueryInterface(kINSHTMLDocumentIID, (void **)&b)) {
if(NS_OK == b->GetLastModified(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
NS_RELEASE(b);
}
else {
@ -458,22 +347,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (NS_OK == a->QueryInterface(kINSHTMLDocumentIID, (void **)&b)) {
if(NS_OK == b->GetEmbeds(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
NS_RELEASE(b);
}
else {
@ -494,22 +368,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (NS_OK == a->QueryInterface(kINSHTMLDocumentIID, (void **)&b)) {
if(NS_OK == b->GetLayers(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
NS_RELEASE(b);
}
else {
@ -530,22 +389,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (NS_OK == a->QueryInterface(kINSHTMLDocumentIID, (void **)&b)) {
if(NS_OK == b->GetPlugins(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
NS_RELEASE(b);
}
else {
@ -560,15 +404,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else if (JSVAL_IS_STRING(id)) {
@ -589,31 +425,10 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
NS_RELEASE(b);
if (NULL != prop) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
*vp = JSVAL_NULL;
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
@ -627,13 +442,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -658,13 +467,7 @@ SetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLDOCUMENT_TITLE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetTitle(prop);
@ -673,36 +476,20 @@ SetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLDOCUMENT_BODY:
{
nsIDOMHTMLElement* prop;
if (JSVAL_IS_NULL(*vp)) {
prop = nsnull;
}
else if (JSVAL_IS_OBJECT(*vp)) {
JSObject *jsobj = JSVAL_TO_OBJECT(*vp);
nsISupports *supports = (nsISupports *)JS_GetPrivate(cx, jsobj);
if (NS_OK != supports->QueryInterface(kIHTMLElementIID, (void **)&prop)) {
JS_ReportError(cx, "Parameter must be of type HTMLElement");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (PR_FALSE == nsConvertJSValToObject((nsISupports **)&prop,
kIHTMLElementIID, "HTMLElement",
cx, *vp)) {
return JS_FALSE;
}
a->SetBody(prop);
if (prop) NS_RELEASE(prop);
NS_IF_RELEASE(prop);
break;
}
case HTMLDOCUMENT_COOKIE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetCookie(prop);
@ -711,13 +498,7 @@ SetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case NSHTMLDOCUMENT_ALINKCOLOR:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
nsIDOMNSHTMLDocument *b;
if (NS_OK == a->QueryInterface(kINSHTMLDocumentIID, (void **)&b)) {
@ -735,13 +516,7 @@ SetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case NSHTMLDOCUMENT_LINKCOLOR:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
nsIDOMNSHTMLDocument *b;
if (NS_OK == a->QueryInterface(kINSHTMLDocumentIID, (void **)&b)) {
@ -759,13 +534,7 @@ SetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case NSHTMLDOCUMENT_VLINKCOLOR:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
nsIDOMNSHTMLDocument *b;
if (NS_OK == a->QueryInterface(kINSHTMLDocumentIID, (void **)&b)) {
@ -783,13 +552,7 @@ SetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case NSHTMLDOCUMENT_BGCOLOR:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
nsIDOMNSHTMLDocument *b;
if (NS_OK == a->QueryInterface(kINSHTMLDocumentIID, (void **)&b)) {
@ -807,13 +570,7 @@ SetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case NSHTMLDOCUMENT_FGCOLOR:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
nsIDOMNSHTMLDocument *b;
if (NS_OK == a->QueryInterface(kINSHTMLDocumentIID, (void **)&b)) {
@ -829,25 +586,11 @@ SetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -860,18 +603,7 @@ SetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLDocument(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLDocument *a = (nsIDOMHTMLDocument*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -881,17 +613,7 @@ FinalizeHTMLDocument(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLDocument(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLDocument *a = (nsIDOMHTMLDocument*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -901,17 +623,7 @@ EnumerateHTMLDocument(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLDocument(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLDocument *a = (nsIDOMHTMLDocument*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}
@ -1067,34 +779,13 @@ HTMLDocumentGetElementById(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->GetElementById(b0, &nativeRet)) {
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function getElementById requires 1 parameters");
@ -1125,34 +816,13 @@ HTMLDocumentGetElementsByName(JSContext *cx, JSObject *obj, uintN argc, jsval *a
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->GetElementsByName(b0, &nativeRet)) {
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function getElementsByName requires 1 parameters");
@ -1192,9 +862,7 @@ NSHTMLDocumentGetSelection(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
return JS_FALSE;
}
JSString *jsstring = JS_NewUCStringCopyN(cx, nativeRet, nativeRet.Length());
// set the return value
*rval = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function getSelection requires 0 parameters");
@ -1231,34 +899,13 @@ NSHTMLDocumentNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->NamedItem(b0, &nativeRet)) {
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function namedItem requires 1 parameters");

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -70,9 +71,7 @@ GetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetId(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -83,9 +82,7 @@ GetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetTitle(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -96,9 +93,7 @@ GetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetLang(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -109,9 +104,7 @@ GetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetDir(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -122,9 +115,7 @@ GetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetClassName(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -136,22 +127,7 @@ GetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMCSSStyleDeclaration* prop;
if (NS_OK == a->GetStyle(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -159,25 +135,11 @@ GetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -202,13 +164,7 @@ SetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLELEMENT_ID:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetId(prop);
@ -217,13 +173,7 @@ SetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLELEMENT_TITLE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetTitle(prop);
@ -232,13 +182,7 @@ SetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLELEMENT_LANG:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetLang(prop);
@ -247,13 +191,7 @@ SetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLELEMENT_DIR:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetDir(prop);
@ -262,38 +200,18 @@ SetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLELEMENT_CLASSNAME:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetClassName(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -306,18 +224,7 @@ SetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLElement *a = (nsIDOMHTMLElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -327,17 +234,7 @@ FinalizeHTMLElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLElement *a = (nsIDOMHTMLElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -347,17 +244,7 @@ EnumerateHTMLElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLElement *a = (nsIDOMHTMLElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -66,22 +67,7 @@ GetHTMLFieldSetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
nsIDOMHTMLFormElement* prop;
if (NS_OK == a->GetForm(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -89,25 +75,11 @@ GetHTMLFieldSetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -131,25 +103,11 @@ SetHTMLFieldSetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
switch(JSVAL_TO_INT(id)) {
case 0:
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -162,18 +120,7 @@ SetHTMLFieldSetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
PR_STATIC_CALLBACK(void)
FinalizeHTMLFieldSetElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLFieldSetElement *a = (nsIDOMHTMLFieldSetElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -183,17 +130,7 @@ FinalizeHTMLFieldSetElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLFieldSetElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLFieldSetElement *a = (nsIDOMHTMLFieldSetElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -203,17 +140,7 @@ EnumerateHTMLFieldSetElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLFieldSetElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLFieldSetElement *a = (nsIDOMHTMLFieldSetElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -64,9 +65,7 @@ GetHTMLFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetColor(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -77,9 +76,7 @@ GetHTMLFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetFace(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -90,9 +87,7 @@ GetHTMLFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetSize(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -100,25 +95,11 @@ GetHTMLFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -143,13 +124,7 @@ SetHTMLFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLFONTELEMENT_COLOR:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetColor(prop);
@ -158,13 +133,7 @@ SetHTMLFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLFONTELEMENT_FACE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetFace(prop);
@ -173,38 +142,18 @@ SetHTMLFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLFONTELEMENT_SIZE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetSize(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -217,18 +166,7 @@ SetHTMLFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLFontElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLFontElement *a = (nsIDOMHTMLFontElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -238,17 +176,7 @@ FinalizeHTMLFontElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLFontElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLFontElement *a = (nsIDOMHTMLFontElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -258,17 +186,7 @@ EnumerateHTMLFontElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLFontElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLFontElement *a = (nsIDOMHTMLFontElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -80,22 +81,7 @@ GetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMHTMLCollection* prop;
if (NS_OK == a->GetElements(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -117,9 +103,7 @@ GetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetName(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -130,9 +114,7 @@ GetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetAcceptCharset(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -143,9 +125,7 @@ GetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetAction(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -156,9 +136,7 @@ GetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetEnctype(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -169,9 +147,7 @@ GetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetMethod(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -182,9 +158,7 @@ GetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetTarget(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -197,9 +171,7 @@ GetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMNSHTMLFormElement* b;
if (NS_OK == a->QueryInterface(kINSHTMLFormElementIID, (void **)&b)) {
if(NS_OK == b->GetEncoding(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
NS_RELEASE(b);
}
else {
@ -214,15 +186,7 @@ GetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else if (JSVAL_IS_STRING(id)) {
@ -243,31 +207,10 @@ GetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
NS_RELEASE(b);
if (NULL != prop) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
*vp = JSVAL_NULL;
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
@ -281,13 +224,7 @@ GetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -312,13 +249,7 @@ SetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLFORMELEMENT_NAME:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetName(prop);
@ -327,13 +258,7 @@ SetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLFORMELEMENT_ACCEPTCHARSET:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAcceptCharset(prop);
@ -342,13 +267,7 @@ SetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLFORMELEMENT_ACTION:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAction(prop);
@ -357,13 +276,7 @@ SetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLFORMELEMENT_ENCTYPE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetEnctype(prop);
@ -372,13 +285,7 @@ SetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLFORMELEMENT_METHOD:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetMethod(prop);
@ -387,38 +294,18 @@ SetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLFORMELEMENT_TARGET:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetTarget(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -431,18 +318,7 @@ SetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLFormElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLFormElement *a = (nsIDOMHTMLFormElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -452,17 +328,7 @@ FinalizeHTMLFormElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLFormElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLFormElement *a = (nsIDOMHTMLFormElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -472,17 +338,7 @@ EnumerateHTMLFormElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLFormElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLFormElement *a = (nsIDOMHTMLFormElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}
@ -578,34 +434,13 @@ NSHTMLFormElementNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
nsConvertJSValToString(b0, cx, argv[0]);
if (NS_OK != nativeThis->NamedItem(b0, &nativeRet)) {
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function namedItem requires 1 parameters");

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -69,9 +70,7 @@ GetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetFrameBorder(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -82,9 +81,7 @@ GetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetLongDesc(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -95,9 +92,7 @@ GetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetMarginHeight(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -108,9 +103,7 @@ GetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetMarginWidth(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -121,9 +114,7 @@ GetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetName(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -145,9 +136,7 @@ GetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetScrolling(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -158,9 +147,7 @@ GetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetSrc(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -168,25 +155,11 @@ GetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -211,13 +184,7 @@ SetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLFRAMEELEMENT_FRAMEBORDER:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetFrameBorder(prop);
@ -226,13 +193,7 @@ SetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLFRAMEELEMENT_LONGDESC:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetLongDesc(prop);
@ -241,13 +202,7 @@ SetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLFRAMEELEMENT_MARGINHEIGHT:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetMarginHeight(prop);
@ -256,13 +211,7 @@ SetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLFRAMEELEMENT_MARGINWIDTH:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetMarginWidth(prop);
@ -271,13 +220,7 @@ SetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLFRAMEELEMENT_NAME:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetName(prop);
@ -286,12 +229,7 @@ SetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLFRAMEELEMENT_NORESIZE:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -302,13 +240,7 @@ SetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLFRAMEELEMENT_SCROLLING:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetScrolling(prop);
@ -317,38 +249,18 @@ SetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLFRAMEELEMENT_SRC:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetSrc(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -361,18 +273,7 @@ SetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLFrameElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLFrameElement *a = (nsIDOMHTMLFrameElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -382,17 +283,7 @@ FinalizeHTMLFrameElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLFrameElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLFrameElement *a = (nsIDOMHTMLFrameElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -402,17 +293,7 @@ EnumerateHTMLFrameElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLFrameElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLFrameElement *a = (nsIDOMHTMLFrameElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -63,9 +64,7 @@ GetHTMLFrameSetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
{
nsAutoString prop;
if (NS_OK == a->GetCols(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -76,9 +75,7 @@ GetHTMLFrameSetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
{
nsAutoString prop;
if (NS_OK == a->GetRows(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -86,25 +83,11 @@ GetHTMLFrameSetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -129,13 +112,7 @@ SetHTMLFrameSetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
case HTMLFRAMESETELEMENT_COLS:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetCols(prop);
@ -144,38 +121,18 @@ SetHTMLFrameSetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
case HTMLFRAMESETELEMENT_ROWS:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetRows(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -188,18 +145,7 @@ SetHTMLFrameSetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
PR_STATIC_CALLBACK(void)
FinalizeHTMLFrameSetElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLFrameSetElement *a = (nsIDOMHTMLFrameSetElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -209,17 +155,7 @@ FinalizeHTMLFrameSetElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLFrameSetElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLFrameSetElement *a = (nsIDOMHTMLFrameSetElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -229,17 +165,7 @@ EnumerateHTMLFrameSetElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLFrameSetElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLFrameSetElement *a = (nsIDOMHTMLFrameSetElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -65,9 +66,7 @@ GetHTMLHRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetAlign(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -89,9 +88,7 @@ GetHTMLHRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetSize(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -102,9 +99,7 @@ GetHTMLHRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetWidth(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -112,25 +107,11 @@ GetHTMLHRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -155,13 +136,7 @@ SetHTMLHRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLHRELEMENT_ALIGN:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAlign(prop);
@ -170,12 +145,7 @@ SetHTMLHRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLHRELEMENT_NOSHADE:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -186,13 +156,7 @@ SetHTMLHRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLHRELEMENT_SIZE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetSize(prop);
@ -201,38 +165,18 @@ SetHTMLHRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLHRELEMENT_WIDTH:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetWidth(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -245,18 +189,7 @@ SetHTMLHRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLHRElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLHRElement *a = (nsIDOMHTMLHRElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -266,17 +199,7 @@ FinalizeHTMLHRElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLHRElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLHRElement *a = (nsIDOMHTMLHRElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -286,17 +209,7 @@ EnumerateHTMLHRElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLHRElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLHRElement *a = (nsIDOMHTMLHRElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -62,9 +63,7 @@ GetHTMLHeadElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetProfile(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -72,25 +71,11 @@ GetHTMLHeadElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -115,38 +100,18 @@ SetHTMLHeadElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLHEADELEMENT_PROFILE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetProfile(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -159,18 +124,7 @@ SetHTMLHeadElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLHeadElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLHeadElement *a = (nsIDOMHTMLHeadElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -180,17 +134,7 @@ FinalizeHTMLHeadElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLHeadElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLHeadElement *a = (nsIDOMHTMLHeadElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -200,17 +144,7 @@ EnumerateHTMLHeadElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLHeadElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLHeadElement *a = (nsIDOMHTMLHeadElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -62,9 +63,7 @@ GetHTMLHeadingElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetAlign(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -72,25 +71,11 @@ GetHTMLHeadingElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -115,38 +100,18 @@ SetHTMLHeadingElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLHEADINGELEMENT_ALIGN:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAlign(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -159,18 +124,7 @@ SetHTMLHeadingElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLHeadingElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLHeadingElement *a = (nsIDOMHTMLHeadingElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -180,17 +134,7 @@ FinalizeHTMLHeadingElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLHeadingElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLHeadingElement *a = (nsIDOMHTMLHeadingElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -200,17 +144,7 @@ EnumerateHTMLHeadingElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLHeadingElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLHeadingElement *a = (nsIDOMHTMLHeadingElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -62,9 +63,7 @@ GetHTMLHtmlElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetVersion(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -72,25 +71,11 @@ GetHTMLHtmlElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -115,38 +100,18 @@ SetHTMLHtmlElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLHTMLELEMENT_VERSION:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetVersion(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -159,18 +124,7 @@ SetHTMLHtmlElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLHtmlElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLHtmlElement *a = (nsIDOMHTMLHtmlElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -180,17 +134,7 @@ FinalizeHTMLHtmlElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLHtmlElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLHtmlElement *a = (nsIDOMHTMLHtmlElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -200,17 +144,7 @@ EnumerateHTMLHtmlElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLHtmlElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLHtmlElement *a = (nsIDOMHTMLHtmlElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -71,9 +72,7 @@ GetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetAlign(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -84,9 +83,7 @@ GetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetFrameBorder(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -97,9 +94,7 @@ GetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetHeight(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -110,9 +105,7 @@ GetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetLongDesc(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -123,9 +116,7 @@ GetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetMarginHeight(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -136,9 +127,7 @@ GetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetMarginWidth(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -149,9 +138,7 @@ GetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetName(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -162,9 +149,7 @@ GetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetScrolling(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -175,9 +160,7 @@ GetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetSrc(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -188,9 +171,7 @@ GetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetWidth(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -198,25 +179,11 @@ GetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -241,13 +208,7 @@ SetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLIFRAMEELEMENT_ALIGN:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAlign(prop);
@ -256,13 +217,7 @@ SetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLIFRAMEELEMENT_FRAMEBORDER:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetFrameBorder(prop);
@ -271,13 +226,7 @@ SetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLIFRAMEELEMENT_HEIGHT:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetHeight(prop);
@ -286,13 +235,7 @@ SetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLIFRAMEELEMENT_LONGDESC:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetLongDesc(prop);
@ -301,13 +244,7 @@ SetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLIFRAMEELEMENT_MARGINHEIGHT:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetMarginHeight(prop);
@ -316,13 +253,7 @@ SetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLIFRAMEELEMENT_MARGINWIDTH:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetMarginWidth(prop);
@ -331,13 +262,7 @@ SetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLIFRAMEELEMENT_NAME:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetName(prop);
@ -346,13 +271,7 @@ SetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLIFRAMEELEMENT_SCROLLING:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetScrolling(prop);
@ -361,13 +280,7 @@ SetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLIFRAMEELEMENT_SRC:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetSrc(prop);
@ -376,38 +289,18 @@ SetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLIFRAMEELEMENT_WIDTH:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetWidth(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -420,18 +313,7 @@ SetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLIFrameElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLIFrameElement *a = (nsIDOMHTMLIFrameElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -441,17 +323,7 @@ FinalizeHTMLIFrameElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLIFrameElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLIFrameElement *a = (nsIDOMHTMLIFrameElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -461,17 +333,7 @@ EnumerateHTMLIFrameElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLIFrameElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLIFrameElement *a = (nsIDOMHTMLIFrameElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -81,9 +82,7 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetLowSrc(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -94,9 +93,7 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetName(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -107,9 +104,7 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetAlign(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -120,9 +115,7 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetAlt(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -133,9 +126,7 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetBorder(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -146,9 +137,7 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetHeight(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -159,9 +148,7 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetHspace(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -183,9 +170,7 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetLongDesc(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -196,9 +181,7 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetSrc(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -209,9 +192,7 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetUseMap(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -222,9 +203,7 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetVspace(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -235,9 +214,7 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetWidth(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -245,25 +222,11 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -288,13 +251,7 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLIMAGEELEMENT_LOWSRC:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetLowSrc(prop);
@ -303,13 +260,7 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLIMAGEELEMENT_NAME:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetName(prop);
@ -318,13 +269,7 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLIMAGEELEMENT_ALIGN:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAlign(prop);
@ -333,13 +278,7 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLIMAGEELEMENT_ALT:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAlt(prop);
@ -348,13 +287,7 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLIMAGEELEMENT_BORDER:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetBorder(prop);
@ -363,13 +296,7 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLIMAGEELEMENT_HEIGHT:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetHeight(prop);
@ -378,13 +305,7 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLIMAGEELEMENT_HSPACE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetHspace(prop);
@ -393,12 +314,7 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLIMAGEELEMENT_ISMAP:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -409,13 +325,7 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLIMAGEELEMENT_LONGDESC:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetLongDesc(prop);
@ -424,13 +334,7 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLIMAGEELEMENT_SRC:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetSrc(prop);
@ -439,13 +343,7 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLIMAGEELEMENT_USEMAP:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetUseMap(prop);
@ -454,13 +352,7 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLIMAGEELEMENT_VSPACE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetVspace(prop);
@ -469,38 +361,18 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLIMAGEELEMENT_WIDTH:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetWidth(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -513,18 +385,7 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLImageElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLImageElement *a = (nsIDOMHTMLImageElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -534,17 +395,7 @@ FinalizeHTMLImageElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLImageElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLImageElement *a = (nsIDOMHTMLImageElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -554,17 +405,7 @@ EnumerateHTMLImageElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLImageElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLImageElement *a = (nsIDOMHTMLImageElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -82,9 +83,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetDefaultValue(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -107,22 +106,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMHTMLFormElement* prop;
if (NS_OK == a->GetForm(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -133,9 +117,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetAccept(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -146,9 +128,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetAccessKey(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -159,9 +139,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetAlign(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -172,9 +150,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetAlt(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -218,9 +194,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetName(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -242,9 +216,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetSize(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -255,9 +227,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetSrc(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -279,9 +249,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetType(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -292,9 +260,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetUseMap(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -305,9 +271,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetValue(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -315,25 +279,11 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -358,13 +308,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLINPUTELEMENT_DEFAULTVALUE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetDefaultValue(prop);
@ -373,12 +317,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLINPUTELEMENT_DEFAULTCHECKED:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -389,13 +328,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLINPUTELEMENT_ACCEPT:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAccept(prop);
@ -404,13 +337,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLINPUTELEMENT_ACCESSKEY:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAccessKey(prop);
@ -419,13 +346,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLINPUTELEMENT_ALIGN:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAlign(prop);
@ -434,13 +355,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLINPUTELEMENT_ALT:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAlt(prop);
@ -449,12 +364,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLINPUTELEMENT_CHECKED:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -465,12 +375,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLINPUTELEMENT_DISABLED:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -497,13 +402,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLINPUTELEMENT_NAME:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetName(prop);
@ -512,12 +411,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLINPUTELEMENT_READONLY:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -528,13 +422,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLINPUTELEMENT_SIZE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetSize(prop);
@ -543,13 +431,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLINPUTELEMENT_SRC:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetSrc(prop);
@ -574,13 +456,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLINPUTELEMENT_USEMAP:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetUseMap(prop);
@ -589,38 +465,18 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLINPUTELEMENT_VALUE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetValue(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -633,18 +489,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLInputElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLInputElement *a = (nsIDOMHTMLInputElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -654,17 +499,7 @@ FinalizeHTMLInputElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLInputElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLInputElement *a = (nsIDOMHTMLInputElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -674,17 +509,7 @@ EnumerateHTMLInputElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLInputElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLInputElement *a = (nsIDOMHTMLInputElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -67,22 +68,7 @@ GetHTMLIsIndexElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMHTMLFormElement* prop;
if (NS_OK == a->GetForm(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -93,9 +79,7 @@ GetHTMLIsIndexElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetPrompt(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -103,25 +87,11 @@ GetHTMLIsIndexElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -146,38 +116,18 @@ SetHTMLIsIndexElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLISINDEXELEMENT_PROMPT:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetPrompt(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -190,18 +140,7 @@ SetHTMLIsIndexElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLIsIndexElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLIsIndexElement *a = (nsIDOMHTMLIsIndexElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -211,17 +150,7 @@ FinalizeHTMLIsIndexElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLIsIndexElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLIsIndexElement *a = (nsIDOMHTMLIsIndexElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -231,17 +160,7 @@ EnumerateHTMLIsIndexElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLIsIndexElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLIsIndexElement *a = (nsIDOMHTMLIsIndexElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -63,9 +64,7 @@ GetHTMLLIElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetType(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -84,25 +83,11 @@ GetHTMLLIElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -127,13 +112,7 @@ SetHTMLLIElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLLIELEMENT_TYPE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetType(prop);
@ -156,25 +135,11 @@ SetHTMLLIElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -187,18 +152,7 @@ SetHTMLLIElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLLIElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLLIElement *a = (nsIDOMHTMLLIElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -208,17 +162,7 @@ FinalizeHTMLLIElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLLIElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLLIElement *a = (nsIDOMHTMLLIElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -228,17 +172,7 @@ EnumerateHTMLLIElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLLIElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLLIElement *a = (nsIDOMHTMLLIElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -68,22 +69,7 @@ GetHTMLLabelElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMHTMLFormElement* prop;
if (NS_OK == a->GetForm(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -94,9 +80,7 @@ GetHTMLLabelElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetAccessKey(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -107,9 +91,7 @@ GetHTMLLabelElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetHtmlFor(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -117,25 +99,11 @@ GetHTMLLabelElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -160,13 +128,7 @@ SetHTMLLabelElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLLABELELEMENT_ACCESSKEY:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAccessKey(prop);
@ -175,38 +137,18 @@ SetHTMLLabelElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLLABELELEMENT_HTMLFOR:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetHtmlFor(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -219,18 +161,7 @@ SetHTMLLabelElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLLabelElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLLabelElement *a = (nsIDOMHTMLLabelElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -240,17 +171,7 @@ FinalizeHTMLLabelElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLLabelElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLLabelElement *a = (nsIDOMHTMLLabelElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -260,17 +181,7 @@ EnumerateHTMLLabelElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLLabelElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLLabelElement *a = (nsIDOMHTMLLabelElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -68,22 +69,7 @@ GetHTMLLegendElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMHTMLFormElement* prop;
if (NS_OK == a->GetForm(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -94,9 +80,7 @@ GetHTMLLegendElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetAccessKey(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -107,9 +91,7 @@ GetHTMLLegendElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetAlign(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -117,25 +99,11 @@ GetHTMLLegendElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -160,13 +128,7 @@ SetHTMLLegendElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLLEGENDELEMENT_ACCESSKEY:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAccessKey(prop);
@ -175,38 +137,18 @@ SetHTMLLegendElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLLEGENDELEMENT_ALIGN:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAlign(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -219,18 +161,7 @@ SetHTMLLegendElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLLegendElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLLegendElement *a = (nsIDOMHTMLLegendElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -240,17 +171,7 @@ FinalizeHTMLLegendElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLLegendElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLLegendElement *a = (nsIDOMHTMLLegendElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -260,17 +181,7 @@ EnumerateHTMLLegendElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLLegendElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLLegendElement *a = (nsIDOMHTMLLegendElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -81,9 +82,7 @@ GetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetCharset(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -94,9 +93,7 @@ GetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetHref(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -107,9 +104,7 @@ GetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetHreflang(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -120,9 +115,7 @@ GetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetMedia(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -133,9 +126,7 @@ GetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetRel(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -146,9 +137,7 @@ GetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetRev(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -159,9 +148,7 @@ GetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetTarget(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -172,9 +159,7 @@ GetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetType(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -182,25 +167,11 @@ GetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -225,12 +196,7 @@ SetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLLINKELEMENT_DISABLED:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -241,13 +207,7 @@ SetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLLINKELEMENT_CHARSET:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetCharset(prop);
@ -256,13 +216,7 @@ SetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLLINKELEMENT_HREF:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetHref(prop);
@ -271,13 +225,7 @@ SetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLLINKELEMENT_HREFLANG:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetHreflang(prop);
@ -286,13 +234,7 @@ SetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLLINKELEMENT_MEDIA:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetMedia(prop);
@ -301,13 +243,7 @@ SetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLLINKELEMENT_REL:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetRel(prop);
@ -316,13 +252,7 @@ SetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLLINKELEMENT_REV:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetRev(prop);
@ -331,13 +261,7 @@ SetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLLINKELEMENT_TARGET:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetTarget(prop);
@ -346,38 +270,18 @@ SetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLLINKELEMENT_TYPE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetType(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -390,18 +294,7 @@ SetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLLinkElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLLinkElement *a = (nsIDOMHTMLLinkElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -411,17 +304,7 @@ FinalizeHTMLLinkElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLLinkElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLLinkElement *a = (nsIDOMHTMLLinkElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -431,17 +314,7 @@ EnumerateHTMLLinkElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLLinkElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLLinkElement *a = (nsIDOMHTMLLinkElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -67,22 +68,7 @@ GetHTMLMapElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMHTMLCollection* prop;
if (NS_OK == a->GetAreas(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -93,9 +79,7 @@ GetHTMLMapElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetName(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -103,25 +87,11 @@ GetHTMLMapElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -146,38 +116,18 @@ SetHTMLMapElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLMAPELEMENT_NAME:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetName(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -190,18 +140,7 @@ SetHTMLMapElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLMapElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLMapElement *a = (nsIDOMHTMLMapElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -211,17 +150,7 @@ FinalizeHTMLMapElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLMapElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLMapElement *a = (nsIDOMHTMLMapElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -231,17 +160,7 @@ EnumerateHTMLMapElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLMapElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLMapElement *a = (nsIDOMHTMLMapElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -70,25 +71,11 @@ GetHTMLMenuElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -113,12 +100,7 @@ SetHTMLMenuElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLMENUELEMENT_COMPACT:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -127,25 +109,11 @@ SetHTMLMenuElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -158,18 +126,7 @@ SetHTMLMenuElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLMenuElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLMenuElement *a = (nsIDOMHTMLMenuElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -179,17 +136,7 @@ FinalizeHTMLMenuElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLMenuElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLMenuElement *a = (nsIDOMHTMLMenuElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -199,17 +146,7 @@ EnumerateHTMLMenuElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLMenuElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLMenuElement *a = (nsIDOMHTMLMenuElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -65,9 +66,7 @@ GetHTMLMetaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetContent(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -78,9 +77,7 @@ GetHTMLMetaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetHttpEquiv(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -91,9 +88,7 @@ GetHTMLMetaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetName(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -104,9 +99,7 @@ GetHTMLMetaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetScheme(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -114,25 +107,11 @@ GetHTMLMetaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -157,13 +136,7 @@ SetHTMLMetaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLMETAELEMENT_CONTENT:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetContent(prop);
@ -172,13 +145,7 @@ SetHTMLMetaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLMETAELEMENT_HTTPEQUIV:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetHttpEquiv(prop);
@ -187,13 +154,7 @@ SetHTMLMetaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLMETAELEMENT_NAME:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetName(prop);
@ -202,38 +163,18 @@ SetHTMLMetaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLMETAELEMENT_SCHEME:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetScheme(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -246,18 +187,7 @@ SetHTMLMetaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLMetaElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLMetaElement *a = (nsIDOMHTMLMetaElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -267,17 +197,7 @@ FinalizeHTMLMetaElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLMetaElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLMetaElement *a = (nsIDOMHTMLMetaElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -287,17 +207,7 @@ EnumerateHTMLMetaElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLMetaElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLMetaElement *a = (nsIDOMHTMLMetaElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -63,9 +64,7 @@ GetHTMLModElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetCite(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -76,9 +75,7 @@ GetHTMLModElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetDateTime(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -86,25 +83,11 @@ GetHTMLModElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -129,13 +112,7 @@ SetHTMLModElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLMODELEMENT_CITE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetCite(prop);
@ -144,38 +121,18 @@ SetHTMLModElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLMODELEMENT_DATETIME:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetDateTime(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -188,18 +145,7 @@ SetHTMLModElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLModElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLModElement *a = (nsIDOMHTMLModElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -209,17 +155,7 @@ FinalizeHTMLModElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLModElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLModElement *a = (nsIDOMHTMLModElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -229,17 +165,7 @@ EnumerateHTMLModElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLModElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLModElement *a = (nsIDOMHTMLModElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -86,9 +87,7 @@ GetHTMLOListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetType(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -96,25 +95,11 @@ GetHTMLOListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -139,12 +124,7 @@ SetHTMLOListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLOLISTELEMENT_COMPACT:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -171,38 +151,18 @@ SetHTMLOListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLOLISTELEMENT_TYPE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetType(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -215,18 +175,7 @@ SetHTMLOListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLOListElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLOListElement *a = (nsIDOMHTMLOListElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -236,17 +185,7 @@ FinalizeHTMLOListElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLOListElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLOListElement *a = (nsIDOMHTMLOListElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -256,17 +195,7 @@ EnumerateHTMLOListElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLOListElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLOListElement *a = (nsIDOMHTMLOListElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -83,22 +84,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMHTMLFormElement* prop;
if (NS_OK == a->GetForm(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -109,9 +95,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetCode(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -122,9 +106,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetAlign(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -135,9 +117,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetArchive(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -148,9 +128,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetBorder(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -161,9 +139,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetCodeBase(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -174,9 +150,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetCodeType(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -187,9 +161,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetData(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -211,9 +183,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetHeight(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -224,9 +194,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetHspace(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -237,9 +205,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetName(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -250,9 +216,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetStandby(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -274,9 +238,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetType(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -287,9 +249,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetUseMap(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -300,9 +260,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetVspace(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -313,9 +271,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetWidth(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -323,25 +279,11 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -366,13 +308,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLOBJECTELEMENT_CODE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetCode(prop);
@ -381,13 +317,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLOBJECTELEMENT_ALIGN:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAlign(prop);
@ -396,13 +326,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLOBJECTELEMENT_ARCHIVE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetArchive(prop);
@ -411,13 +335,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLOBJECTELEMENT_BORDER:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetBorder(prop);
@ -426,13 +344,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLOBJECTELEMENT_CODEBASE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetCodeBase(prop);
@ -441,13 +353,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLOBJECTELEMENT_CODETYPE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetCodeType(prop);
@ -456,13 +362,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLOBJECTELEMENT_DATA:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetData(prop);
@ -471,12 +371,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLOBJECTELEMENT_DECLARE:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -487,13 +382,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLOBJECTELEMENT_HEIGHT:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetHeight(prop);
@ -502,13 +391,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLOBJECTELEMENT_HSPACE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetHspace(prop);
@ -517,13 +400,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLOBJECTELEMENT_NAME:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetName(prop);
@ -532,13 +409,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLOBJECTELEMENT_STANDBY:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetStandby(prop);
@ -563,13 +434,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLOBJECTELEMENT_TYPE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetType(prop);
@ -578,13 +443,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLOBJECTELEMENT_USEMAP:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetUseMap(prop);
@ -593,13 +452,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLOBJECTELEMENT_VSPACE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetVspace(prop);
@ -608,38 +461,18 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLOBJECTELEMENT_WIDTH:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetWidth(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -652,18 +485,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLObjectElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLObjectElement *a = (nsIDOMHTMLObjectElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -673,17 +495,7 @@ FinalizeHTMLObjectElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLObjectElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLObjectElement *a = (nsIDOMHTMLObjectElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -693,17 +505,7 @@ EnumerateHTMLObjectElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLObjectElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLObjectElement *a = (nsIDOMHTMLObjectElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -74,9 +75,7 @@ GetHTMLOptGroupElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
{
nsAutoString prop;
if (NS_OK == a->GetLabel(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -84,25 +83,11 @@ GetHTMLOptGroupElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -127,12 +112,7 @@ SetHTMLOptGroupElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
case HTMLOPTGROUPELEMENT_DISABLED:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -143,38 +123,18 @@ SetHTMLOptGroupElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
case HTMLOPTGROUPELEMENT_LABEL:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetLabel(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -187,18 +147,7 @@ SetHTMLOptGroupElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
PR_STATIC_CALLBACK(void)
FinalizeHTMLOptGroupElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLOptGroupElement *a = (nsIDOMHTMLOptGroupElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -208,17 +157,7 @@ FinalizeHTMLOptGroupElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLOptGroupElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLOptGroupElement *a = (nsIDOMHTMLOptGroupElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -228,17 +167,7 @@ EnumerateHTMLOptGroupElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLOptGroupElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLOptGroupElement *a = (nsIDOMHTMLOptGroupElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -73,22 +74,7 @@ GetHTMLOptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMHTMLFormElement* prop;
if (NS_OK == a->GetForm(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -110,9 +96,7 @@ GetHTMLOptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetText(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -145,9 +129,7 @@ GetHTMLOptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetLabel(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -169,9 +151,7 @@ GetHTMLOptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetValue(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -179,25 +159,11 @@ GetHTMLOptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -222,12 +188,7 @@ SetHTMLOptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLOPTIONELEMENT_DEFAULTSELECTED:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -254,12 +215,7 @@ SetHTMLOptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLOPTIONELEMENT_DISABLED:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -270,13 +226,7 @@ SetHTMLOptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLOPTIONELEMENT_LABEL:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetLabel(prop);
@ -285,38 +235,18 @@ SetHTMLOptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLOPTIONELEMENT_VALUE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetValue(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -329,18 +259,7 @@ SetHTMLOptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLOptionElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLOptionElement *a = (nsIDOMHTMLOptionElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -350,17 +269,7 @@ FinalizeHTMLOptionElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLOptionElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLOptionElement *a = (nsIDOMHTMLOptionElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -370,17 +279,7 @@ EnumerateHTMLOptionElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLOptionElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLOptionElement *a = (nsIDOMHTMLOptionElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -62,9 +63,7 @@ GetHTMLParagraphElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
{
nsAutoString prop;
if (NS_OK == a->GetAlign(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -72,25 +71,11 @@ GetHTMLParagraphElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -115,38 +100,18 @@ SetHTMLParagraphElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
case HTMLPARAGRAPHELEMENT_ALIGN:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAlign(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -159,18 +124,7 @@ SetHTMLParagraphElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
PR_STATIC_CALLBACK(void)
FinalizeHTMLParagraphElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLParagraphElement *a = (nsIDOMHTMLParagraphElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -180,17 +134,7 @@ FinalizeHTMLParagraphElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLParagraphElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLParagraphElement *a = (nsIDOMHTMLParagraphElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -200,17 +144,7 @@ EnumerateHTMLParagraphElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLParagraphElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLParagraphElement *a = (nsIDOMHTMLParagraphElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -65,9 +66,7 @@ GetHTMLParamElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetName(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -78,9 +77,7 @@ GetHTMLParamElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetType(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -91,9 +88,7 @@ GetHTMLParamElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetValue(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -104,9 +99,7 @@ GetHTMLParamElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetValueType(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -114,25 +107,11 @@ GetHTMLParamElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -157,13 +136,7 @@ SetHTMLParamElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLPARAMELEMENT_NAME:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetName(prop);
@ -172,13 +145,7 @@ SetHTMLParamElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLPARAMELEMENT_TYPE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetType(prop);
@ -187,13 +154,7 @@ SetHTMLParamElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLPARAMELEMENT_VALUE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetValue(prop);
@ -202,38 +163,18 @@ SetHTMLParamElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLPARAMELEMENT_VALUETYPE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetValueType(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -246,18 +187,7 @@ SetHTMLParamElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLParamElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLParamElement *a = (nsIDOMHTMLParamElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -267,17 +197,7 @@ FinalizeHTMLParamElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLParamElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLParamElement *a = (nsIDOMHTMLParamElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -287,17 +207,7 @@ EnumerateHTMLParamElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLParamElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLParamElement *a = (nsIDOMHTMLParamElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -70,25 +71,11 @@ GetHTMLPreElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -127,25 +114,11 @@ SetHTMLPreElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -158,18 +131,7 @@ SetHTMLPreElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLPreElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLPreElement *a = (nsIDOMHTMLPreElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -179,17 +141,7 @@ FinalizeHTMLPreElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLPreElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLPreElement *a = (nsIDOMHTMLPreElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -199,17 +151,7 @@ EnumerateHTMLPreElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLPreElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLPreElement *a = (nsIDOMHTMLPreElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -62,9 +63,7 @@ GetHTMLQuoteElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetCite(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -72,25 +71,11 @@ GetHTMLQuoteElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -115,38 +100,18 @@ SetHTMLQuoteElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLQUOTEELEMENT_CITE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetCite(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -159,18 +124,7 @@ SetHTMLQuoteElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLQuoteElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLQuoteElement *a = (nsIDOMHTMLQuoteElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -180,17 +134,7 @@ FinalizeHTMLQuoteElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLQuoteElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLQuoteElement *a = (nsIDOMHTMLQuoteElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -200,17 +144,7 @@ EnumerateHTMLQuoteElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLQuoteElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLQuoteElement *a = (nsIDOMHTMLQuoteElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -68,9 +69,7 @@ GetHTMLScriptElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetText(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -81,9 +80,7 @@ GetHTMLScriptElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetHtmlFor(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -94,9 +91,7 @@ GetHTMLScriptElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetEvent(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -107,9 +102,7 @@ GetHTMLScriptElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetCharset(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -131,9 +124,7 @@ GetHTMLScriptElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetSrc(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -144,9 +135,7 @@ GetHTMLScriptElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetType(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -154,25 +143,11 @@ GetHTMLScriptElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -197,13 +172,7 @@ SetHTMLScriptElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLSCRIPTELEMENT_TEXT:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetText(prop);
@ -212,13 +181,7 @@ SetHTMLScriptElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLSCRIPTELEMENT_HTMLFOR:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetHtmlFor(prop);
@ -227,13 +190,7 @@ SetHTMLScriptElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLSCRIPTELEMENT_EVENT:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetEvent(prop);
@ -242,13 +199,7 @@ SetHTMLScriptElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLSCRIPTELEMENT_CHARSET:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetCharset(prop);
@ -257,12 +208,7 @@ SetHTMLScriptElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLSCRIPTELEMENT_DEFER:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -273,13 +219,7 @@ SetHTMLScriptElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLSCRIPTELEMENT_SRC:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetSrc(prop);
@ -288,38 +228,18 @@ SetHTMLScriptElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLSCRIPTELEMENT_TYPE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetType(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -332,18 +252,7 @@ SetHTMLScriptElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLScriptElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLScriptElement *a = (nsIDOMHTMLScriptElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -353,17 +262,7 @@ FinalizeHTMLScriptElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLScriptElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLScriptElement *a = (nsIDOMHTMLScriptElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -373,17 +272,7 @@ EnumerateHTMLScriptElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLScriptElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLScriptElement *a = (nsIDOMHTMLScriptElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -81,9 +82,7 @@ GetHTMLSelectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetType(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -105,9 +104,7 @@ GetHTMLSelectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetValue(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -130,22 +127,7 @@ GetHTMLSelectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMHTMLFormElement* prop;
if (NS_OK == a->GetForm(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -157,22 +139,7 @@ GetHTMLSelectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMHTMLCollection* prop;
if (NS_OK == a->GetOptions(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -205,9 +172,7 @@ GetHTMLSelectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetName(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -237,25 +202,11 @@ GetHTMLSelectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -296,13 +247,7 @@ SetHTMLSelectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLSELECTELEMENT_VALUE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetValue(prop);
@ -311,12 +256,7 @@ SetHTMLSelectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLSELECTELEMENT_DISABLED:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -327,12 +267,7 @@ SetHTMLSelectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLSELECTELEMENT_MULTIPLE:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -343,13 +278,7 @@ SetHTMLSelectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLSELECTELEMENT_NAME:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetName(prop);
@ -388,25 +317,11 @@ SetHTMLSelectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -419,18 +334,7 @@ SetHTMLSelectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLSelectElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLSelectElement *a = (nsIDOMHTMLSelectElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -440,17 +344,7 @@ FinalizeHTMLSelectElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLSelectElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLSelectElement *a = (nsIDOMHTMLSelectElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -460,17 +354,7 @@ EnumerateHTMLSelectElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLSelectElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLSelectElement *a = (nsIDOMHTMLSelectElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}
@ -494,39 +378,19 @@ HTMLSelectElementAdd(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
if (argc >= 2) {
if (JSVAL_IS_NULL(argv[0])){
b0 = nsnull;
}
else if (JSVAL_IS_OBJECT(argv[0])) {
nsISupports *supports0 = (nsISupports *)JS_GetPrivate(cx, JSVAL_TO_OBJECT(argv[0]));
NS_ASSERTION(nsnull != supports0, "null pointer");
if ((nsnull == supports0) ||
(NS_OK != supports0->QueryInterface(kIHTMLElementIID, (void **)(b0.Query())))) {
JS_ReportError(cx, "Parameter must be of type HTMLElement");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (JS_FALSE == nsConvertJSValToObject((nsISupports **)&b0,
kIHTMLElementIID,
"HTMLElement",
cx,
argv[0])) {
return JS_FALSE;
}
if (JSVAL_IS_NULL(argv[1])){
b1 = nsnull;
}
else if (JSVAL_IS_OBJECT(argv[1])) {
nsISupports *supports1 = (nsISupports *)JS_GetPrivate(cx, JSVAL_TO_OBJECT(argv[1]));
NS_ASSERTION(nsnull != supports1, "null pointer");
if ((nsnull == supports1) ||
(NS_OK != supports1->QueryInterface(kIHTMLElementIID, (void **)(b1.Query())))) {
JS_ReportError(cx, "Parameter must be of type HTMLElement");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (JS_FALSE == nsConvertJSValToObject((nsISupports **)&b1,
kIHTMLElementIID,
"HTMLElement",
cx,
argv[1])) {
return JS_FALSE;
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -75,9 +76,7 @@ GetHTMLStyleElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetMedia(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -88,9 +87,7 @@ GetHTMLStyleElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetType(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -98,25 +95,11 @@ GetHTMLStyleElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -141,12 +124,7 @@ SetHTMLStyleElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLSTYLEELEMENT_DISABLED:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -157,13 +135,7 @@ SetHTMLStyleElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLSTYLEELEMENT_MEDIA:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetMedia(prop);
@ -172,38 +144,18 @@ SetHTMLStyleElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLSTYLEELEMENT_TYPE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetType(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -216,18 +168,7 @@ SetHTMLStyleElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLStyleElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLStyleElement *a = (nsIDOMHTMLStyleElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -237,17 +178,7 @@ FinalizeHTMLStyleElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLStyleElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLStyleElement *a = (nsIDOMHTMLStyleElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -257,17 +188,7 @@ EnumerateHTMLStyleElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLStyleElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLStyleElement *a = (nsIDOMHTMLStyleElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -62,9 +63,7 @@ GetHTMLTableCaptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval
{
nsAutoString prop;
if (NS_OK == a->GetAlign(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -72,25 +71,11 @@ GetHTMLTableCaptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -115,38 +100,18 @@ SetHTMLTableCaptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval
case HTMLTABLECAPTIONELEMENT_ALIGN:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAlign(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -159,18 +124,7 @@ SetHTMLTableCaptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval
PR_STATIC_CALLBACK(void)
FinalizeHTMLTableCaptionElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLTableCaptionElement *a = (nsIDOMHTMLTableCaptionElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -180,17 +134,7 @@ FinalizeHTMLTableCaptionElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLTableCaptionElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLTableCaptionElement *a = (nsIDOMHTMLTableCaptionElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -200,17 +144,7 @@ EnumerateHTMLTableCaptionElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLTableCaptionElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLTableCaptionElement *a = (nsIDOMHTMLTableCaptionElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -87,9 +88,7 @@ GetHTMLTableCellElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
{
nsAutoString prop;
if (NS_OK == a->GetAbbr(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -100,9 +99,7 @@ GetHTMLTableCellElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
{
nsAutoString prop;
if (NS_OK == a->GetAlign(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -113,9 +110,7 @@ GetHTMLTableCellElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
{
nsAutoString prop;
if (NS_OK == a->GetAxis(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -126,9 +121,7 @@ GetHTMLTableCellElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
{
nsAutoString prop;
if (NS_OK == a->GetBgColor(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -139,9 +132,7 @@ GetHTMLTableCellElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
{
nsAutoString prop;
if (NS_OK == a->GetCh(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -152,9 +143,7 @@ GetHTMLTableCellElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
{
nsAutoString prop;
if (NS_OK == a->GetChOff(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -176,9 +165,7 @@ GetHTMLTableCellElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
{
nsAutoString prop;
if (NS_OK == a->GetHeaders(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -189,9 +176,7 @@ GetHTMLTableCellElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
{
nsAutoString prop;
if (NS_OK == a->GetHeight(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -224,9 +209,7 @@ GetHTMLTableCellElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
{
nsAutoString prop;
if (NS_OK == a->GetScope(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -237,9 +220,7 @@ GetHTMLTableCellElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
{
nsAutoString prop;
if (NS_OK == a->GetVAlign(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -250,9 +231,7 @@ GetHTMLTableCellElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
{
nsAutoString prop;
if (NS_OK == a->GetWidth(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -260,25 +239,11 @@ GetHTMLTableCellElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -319,13 +284,7 @@ SetHTMLTableCellElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
case HTMLTABLECELLELEMENT_ABBR:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAbbr(prop);
@ -334,13 +293,7 @@ SetHTMLTableCellElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
case HTMLTABLECELLELEMENT_ALIGN:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAlign(prop);
@ -349,13 +302,7 @@ SetHTMLTableCellElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
case HTMLTABLECELLELEMENT_AXIS:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAxis(prop);
@ -364,13 +311,7 @@ SetHTMLTableCellElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
case HTMLTABLECELLELEMENT_BGCOLOR:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetBgColor(prop);
@ -379,13 +320,7 @@ SetHTMLTableCellElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
case HTMLTABLECELLELEMENT_CH:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetCh(prop);
@ -394,13 +329,7 @@ SetHTMLTableCellElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
case HTMLTABLECELLELEMENT_CHOFF:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetChOff(prop);
@ -425,13 +354,7 @@ SetHTMLTableCellElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
case HTMLTABLECELLELEMENT_HEADERS:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetHeaders(prop);
@ -440,13 +363,7 @@ SetHTMLTableCellElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
case HTMLTABLECELLELEMENT_HEIGHT:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetHeight(prop);
@ -455,12 +372,7 @@ SetHTMLTableCellElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
case HTMLTABLECELLELEMENT_NOWRAP:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -487,13 +399,7 @@ SetHTMLTableCellElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
case HTMLTABLECELLELEMENT_SCOPE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetScope(prop);
@ -502,13 +408,7 @@ SetHTMLTableCellElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
case HTMLTABLECELLELEMENT_VALIGN:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetVAlign(prop);
@ -517,38 +417,18 @@ SetHTMLTableCellElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
case HTMLTABLECELLELEMENT_WIDTH:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetWidth(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -561,18 +441,7 @@ SetHTMLTableCellElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
PR_STATIC_CALLBACK(void)
FinalizeHTMLTableCellElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLTableCellElement *a = (nsIDOMHTMLTableCellElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -582,17 +451,7 @@ FinalizeHTMLTableCellElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLTableCellElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLTableCellElement *a = (nsIDOMHTMLTableCellElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -602,17 +461,7 @@ EnumerateHTMLTableCellElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLTableCellElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLTableCellElement *a = (nsIDOMHTMLTableCellElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -67,9 +68,7 @@ GetHTMLTableColElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
{
nsAutoString prop;
if (NS_OK == a->GetAlign(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -80,9 +79,7 @@ GetHTMLTableColElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
{
nsAutoString prop;
if (NS_OK == a->GetCh(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -93,9 +90,7 @@ GetHTMLTableColElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
{
nsAutoString prop;
if (NS_OK == a->GetChOff(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -117,9 +112,7 @@ GetHTMLTableColElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
{
nsAutoString prop;
if (NS_OK == a->GetVAlign(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -130,9 +123,7 @@ GetHTMLTableColElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
{
nsAutoString prop;
if (NS_OK == a->GetWidth(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -140,25 +131,11 @@ GetHTMLTableColElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -183,13 +160,7 @@ SetHTMLTableColElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
case HTMLTABLECOLELEMENT_ALIGN:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAlign(prop);
@ -198,13 +169,7 @@ SetHTMLTableColElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
case HTMLTABLECOLELEMENT_CH:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetCh(prop);
@ -213,13 +178,7 @@ SetHTMLTableColElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
case HTMLTABLECOLELEMENT_CHOFF:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetChOff(prop);
@ -244,13 +203,7 @@ SetHTMLTableColElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
case HTMLTABLECOLELEMENT_VALIGN:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetVAlign(prop);
@ -259,38 +212,18 @@ SetHTMLTableColElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
case HTMLTABLECOLELEMENT_WIDTH:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetWidth(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -303,18 +236,7 @@ SetHTMLTableColElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
PR_STATIC_CALLBACK(void)
FinalizeHTMLTableColElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLTableColElement *a = (nsIDOMHTMLTableColElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -324,17 +246,7 @@ FinalizeHTMLTableColElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLTableColElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLTableColElement *a = (nsIDOMHTMLTableColElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -344,17 +256,7 @@ EnumerateHTMLTableColElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLTableColElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLTableColElement *a = (nsIDOMHTMLTableColElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -88,22 +89,7 @@ GetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMHTMLTableCaptionElement* prop;
if (NS_OK == a->GetCaption(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -115,22 +101,7 @@ GetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMHTMLTableSectionElement* prop;
if (NS_OK == a->GetTHead(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -142,22 +113,7 @@ GetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMHTMLTableSectionElement* prop;
if (NS_OK == a->GetTFoot(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -169,22 +125,7 @@ GetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMHTMLCollection* prop;
if (NS_OK == a->GetRows(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -196,22 +137,7 @@ GetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
nsIDOMHTMLCollection* prop;
if (NS_OK == a->GetTBodies(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -222,9 +148,7 @@ GetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetAlign(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -235,9 +159,7 @@ GetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetBgColor(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -248,9 +170,7 @@ GetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetBorder(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -261,9 +181,7 @@ GetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetCellPadding(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -274,9 +192,7 @@ GetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetCellSpacing(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -287,9 +203,7 @@ GetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetFrame(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -300,9 +214,7 @@ GetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetRules(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -313,9 +225,7 @@ GetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetSummary(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -326,9 +236,7 @@ GetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetWidth(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -336,25 +244,11 @@ GetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -379,82 +273,46 @@ SetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLTABLEELEMENT_CAPTION:
{
nsIDOMHTMLTableCaptionElement* prop;
if (JSVAL_IS_NULL(*vp)) {
prop = nsnull;
}
else if (JSVAL_IS_OBJECT(*vp)) {
JSObject *jsobj = JSVAL_TO_OBJECT(*vp);
nsISupports *supports = (nsISupports *)JS_GetPrivate(cx, jsobj);
if (NS_OK != supports->QueryInterface(kIHTMLTableCaptionElementIID, (void **)&prop)) {
JS_ReportError(cx, "Parameter must be of type HTMLTableCaptionElement");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (PR_FALSE == nsConvertJSValToObject((nsISupports **)&prop,
kIHTMLTableCaptionElementIID, "HTMLTableCaptionElement",
cx, *vp)) {
return JS_FALSE;
}
a->SetCaption(prop);
if (prop) NS_RELEASE(prop);
NS_IF_RELEASE(prop);
break;
}
case HTMLTABLEELEMENT_THEAD:
{
nsIDOMHTMLTableSectionElement* prop;
if (JSVAL_IS_NULL(*vp)) {
prop = nsnull;
}
else if (JSVAL_IS_OBJECT(*vp)) {
JSObject *jsobj = JSVAL_TO_OBJECT(*vp);
nsISupports *supports = (nsISupports *)JS_GetPrivate(cx, jsobj);
if (NS_OK != supports->QueryInterface(kIHTMLTableSectionElementIID, (void **)&prop)) {
JS_ReportError(cx, "Parameter must be of type HTMLTableSectionElement");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (PR_FALSE == nsConvertJSValToObject((nsISupports **)&prop,
kIHTMLTableSectionElementIID, "HTMLTableSectionElement",
cx, *vp)) {
return JS_FALSE;
}
a->SetTHead(prop);
if (prop) NS_RELEASE(prop);
NS_IF_RELEASE(prop);
break;
}
case HTMLTABLEELEMENT_TFOOT:
{
nsIDOMHTMLTableSectionElement* prop;
if (JSVAL_IS_NULL(*vp)) {
prop = nsnull;
}
else if (JSVAL_IS_OBJECT(*vp)) {
JSObject *jsobj = JSVAL_TO_OBJECT(*vp);
nsISupports *supports = (nsISupports *)JS_GetPrivate(cx, jsobj);
if (NS_OK != supports->QueryInterface(kIHTMLTableSectionElementIID, (void **)&prop)) {
JS_ReportError(cx, "Parameter must be of type HTMLTableSectionElement");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (PR_FALSE == nsConvertJSValToObject((nsISupports **)&prop,
kIHTMLTableSectionElementIID, "HTMLTableSectionElement",
cx, *vp)) {
return JS_FALSE;
}
a->SetTFoot(prop);
if (prop) NS_RELEASE(prop);
NS_IF_RELEASE(prop);
break;
}
case HTMLTABLEELEMENT_ALIGN:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAlign(prop);
@ -463,13 +321,7 @@ SetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLTABLEELEMENT_BGCOLOR:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetBgColor(prop);
@ -478,13 +330,7 @@ SetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLTABLEELEMENT_BORDER:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetBorder(prop);
@ -493,13 +339,7 @@ SetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLTABLEELEMENT_CELLPADDING:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetCellPadding(prop);
@ -508,13 +348,7 @@ SetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLTABLEELEMENT_CELLSPACING:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetCellSpacing(prop);
@ -523,13 +357,7 @@ SetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLTABLEELEMENT_FRAME:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetFrame(prop);
@ -538,13 +366,7 @@ SetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLTABLEELEMENT_RULES:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetRules(prop);
@ -553,13 +375,7 @@ SetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLTABLEELEMENT_SUMMARY:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetSummary(prop);
@ -568,38 +384,18 @@ SetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLTABLEELEMENT_WIDTH:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetWidth(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -612,18 +408,7 @@ SetHTMLTableElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLTableElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLTableElement *a = (nsIDOMHTMLTableElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -633,17 +418,7 @@ FinalizeHTMLTableElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLTableElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLTableElement *a = (nsIDOMHTMLTableElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -653,17 +428,7 @@ EnumerateHTMLTableElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLTableElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLTableElement *a = (nsIDOMHTMLTableElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}
@ -690,22 +455,7 @@ HTMLTableElementCreateTHead(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function createTHead requires 0 parameters");
@ -772,22 +522,7 @@ HTMLTableElementCreateTFoot(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function createTFoot requires 0 parameters");
@ -854,22 +589,7 @@ HTMLTableElementCreateCaption(JSContext *cx, JSObject *obj, uintN argc, jsval *a
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function createCaption requires 0 parameters");
@ -942,22 +662,7 @@ HTMLTableElementInsertRow(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function insertRow requires 1 parameters");

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -98,22 +99,7 @@ GetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
nsIDOMHTMLCollection* prop;
if (NS_OK == a->GetCells(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -124,9 +110,7 @@ GetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
{
nsAutoString prop;
if (NS_OK == a->GetAlign(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -137,9 +121,7 @@ GetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
{
nsAutoString prop;
if (NS_OK == a->GetBgColor(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -150,9 +132,7 @@ GetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
{
nsAutoString prop;
if (NS_OK == a->GetCh(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -163,9 +143,7 @@ GetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
{
nsAutoString prop;
if (NS_OK == a->GetChOff(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -176,9 +154,7 @@ GetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
{
nsAutoString prop;
if (NS_OK == a->GetVAlign(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -186,25 +162,11 @@ GetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -261,36 +223,20 @@ SetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
case HTMLTABLEROWELEMENT_CELLS:
{
nsIDOMHTMLCollection* prop;
if (JSVAL_IS_NULL(*vp)) {
prop = nsnull;
}
else if (JSVAL_IS_OBJECT(*vp)) {
JSObject *jsobj = JSVAL_TO_OBJECT(*vp);
nsISupports *supports = (nsISupports *)JS_GetPrivate(cx, jsobj);
if (NS_OK != supports->QueryInterface(kIHTMLCollectionIID, (void **)&prop)) {
JS_ReportError(cx, "Parameter must be of type HTMLCollection");
return JS_FALSE;
}
}
else {
JS_ReportError(cx, "Parameter must be an object");
if (PR_FALSE == nsConvertJSValToObject((nsISupports **)&prop,
kIHTMLCollectionIID, "HTMLCollection",
cx, *vp)) {
return JS_FALSE;
}
a->SetCells(prop);
if (prop) NS_RELEASE(prop);
NS_IF_RELEASE(prop);
break;
}
case HTMLTABLEROWELEMENT_ALIGN:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAlign(prop);
@ -299,13 +245,7 @@ SetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
case HTMLTABLEROWELEMENT_BGCOLOR:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetBgColor(prop);
@ -314,13 +254,7 @@ SetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
case HTMLTABLEROWELEMENT_CH:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetCh(prop);
@ -329,13 +263,7 @@ SetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
case HTMLTABLEROWELEMENT_CHOFF:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetChOff(prop);
@ -344,38 +272,18 @@ SetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
case HTMLTABLEROWELEMENT_VALIGN:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetVAlign(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -388,18 +296,7 @@ SetHTMLTableRowElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
PR_STATIC_CALLBACK(void)
FinalizeHTMLTableRowElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLTableRowElement *a = (nsIDOMHTMLTableRowElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -409,17 +306,7 @@ FinalizeHTMLTableRowElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLTableRowElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLTableRowElement *a = (nsIDOMHTMLTableRowElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -429,17 +316,7 @@ EnumerateHTMLTableRowElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLTableRowElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLTableRowElement *a = (nsIDOMHTMLTableRowElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}
@ -472,22 +349,7 @@ HTMLTableRowElementInsertCell(JSContext *cx, JSObject *obj, uintN argc, jsval *a
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function insertCell requires 1 parameters");

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -72,9 +73,7 @@ GetHTMLTableSectionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval
{
nsAutoString prop;
if (NS_OK == a->GetAlign(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -85,9 +84,7 @@ GetHTMLTableSectionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval
{
nsAutoString prop;
if (NS_OK == a->GetCh(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -98,9 +95,7 @@ GetHTMLTableSectionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval
{
nsAutoString prop;
if (NS_OK == a->GetChOff(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -111,9 +106,7 @@ GetHTMLTableSectionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval
{
nsAutoString prop;
if (NS_OK == a->GetVAlign(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -125,22 +118,7 @@ GetHTMLTableSectionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval
nsIDOMHTMLCollection* prop;
if (NS_OK == a->GetRows(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -148,25 +126,11 @@ GetHTMLTableSectionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -191,13 +155,7 @@ SetHTMLTableSectionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval
case HTMLTABLESECTIONELEMENT_ALIGN:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAlign(prop);
@ -206,13 +164,7 @@ SetHTMLTableSectionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval
case HTMLTABLESECTIONELEMENT_CH:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetCh(prop);
@ -221,13 +173,7 @@ SetHTMLTableSectionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval
case HTMLTABLESECTIONELEMENT_CHOFF:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetChOff(prop);
@ -236,38 +182,18 @@ SetHTMLTableSectionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval
case HTMLTABLESECTIONELEMENT_VALIGN:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetVAlign(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -280,18 +206,7 @@ SetHTMLTableSectionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval
PR_STATIC_CALLBACK(void)
FinalizeHTMLTableSectionElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLTableSectionElement *a = (nsIDOMHTMLTableSectionElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -301,17 +216,7 @@ FinalizeHTMLTableSectionElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLTableSectionElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLTableSectionElement *a = (nsIDOMHTMLTableSectionElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -321,17 +226,7 @@ EnumerateHTMLTableSectionElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLTableSectionElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLTableSectionElement *a = (nsIDOMHTMLTableSectionElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}
@ -364,22 +259,7 @@ HTMLTableSectionElementInsertRow(JSContext *cx, JSObject *obj, uintN argc, jsval
return JS_FALSE;
}
if (nativeRet != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == nativeRet->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*rval = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(nativeRet);
}
else {
*rval = JSVAL_NULL;
}
nsConvertObjectToJSVal(nativeRet, cx, rval);
}
else {
JS_ReportError(cx, "Function insertRow requires 1 parameters");

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -75,9 +76,7 @@ GetHTMLTextAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
{
nsAutoString prop;
if (NS_OK == a->GetDefaultValue(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -89,22 +88,7 @@ GetHTMLTextAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
nsIDOMHTMLFormElement* prop;
if (NS_OK == a->GetForm(&prop)) {
// get the js object
if (prop != nsnull) {
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == prop->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
JSObject *object = nsnull;
nsIScriptContext *script_cx = (nsIScriptContext *)JS_GetContextPrivate(cx);
if (NS_OK == owner->GetScriptObject(script_cx, (void**)&object)) {
// set the return value
*vp = OBJECT_TO_JSVAL(object);
}
NS_RELEASE(owner);
}
NS_RELEASE(prop);
}
else {
*vp = JSVAL_NULL;
}
nsConvertObjectToJSVal((nsISupports *)prop, cx, vp);
}
else {
return JS_FALSE;
@ -115,9 +99,7 @@ GetHTMLTextAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
{
nsAutoString prop;
if (NS_OK == a->GetAccessKey(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -150,9 +132,7 @@ GetHTMLTextAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
{
nsAutoString prop;
if (NS_OK == a->GetName(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -196,9 +176,7 @@ GetHTMLTextAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
{
nsAutoString prop;
if (NS_OK == a->GetType(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -209,9 +187,7 @@ GetHTMLTextAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
{
nsAutoString prop;
if (NS_OK == a->GetValue(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -219,25 +195,11 @@ GetHTMLTextAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -262,13 +224,7 @@ SetHTMLTextAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
case HTMLTEXTAREAELEMENT_DEFAULTVALUE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetDefaultValue(prop);
@ -277,13 +233,7 @@ SetHTMLTextAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
case HTMLTEXTAREAELEMENT_ACCESSKEY:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetAccessKey(prop);
@ -308,12 +258,7 @@ SetHTMLTextAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
case HTMLTEXTAREAELEMENT_DISABLED:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -324,13 +269,7 @@ SetHTMLTextAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
case HTMLTEXTAREAELEMENT_NAME:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetName(prop);
@ -339,12 +278,7 @@ SetHTMLTextAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
case HTMLTEXTAREAELEMENT_READONLY:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -387,38 +321,18 @@ SetHTMLTextAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
case HTMLTEXTAREAELEMENT_VALUE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetValue(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -431,18 +345,7 @@ SetHTMLTextAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
PR_STATIC_CALLBACK(void)
FinalizeHTMLTextAreaElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLTextAreaElement *a = (nsIDOMHTMLTextAreaElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -452,17 +355,7 @@ FinalizeHTMLTextAreaElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLTextAreaElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLTextAreaElement *a = (nsIDOMHTMLTextAreaElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -472,17 +365,7 @@ EnumerateHTMLTextAreaElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLTextAreaElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLTextAreaElement *a = (nsIDOMHTMLTextAreaElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -62,9 +63,7 @@ GetHTMLTitleElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetText(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -72,25 +71,11 @@ GetHTMLTitleElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -115,38 +100,18 @@ SetHTMLTitleElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLTITLEELEMENT_TEXT:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetText(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -159,18 +124,7 @@ SetHTMLTitleElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLTitleElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLTitleElement *a = (nsIDOMHTMLTitleElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -180,17 +134,7 @@ FinalizeHTMLTitleElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLTitleElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLTitleElement *a = (nsIDOMHTMLTitleElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -200,17 +144,7 @@ EnumerateHTMLTitleElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLTitleElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLTitleElement *a = (nsIDOMHTMLTitleElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -18,6 +18,7 @@
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsIJSScriptObject.h"
@ -74,9 +75,7 @@ GetHTMLUListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsAutoString prop;
if (NS_OK == a->GetType(prop)) {
JSString *jsstring = JS_NewUCStringCopyN(cx, prop, prop.Length());
// set the return value
*vp = STRING_TO_JSVAL(jsstring);
nsConvertStringToJSVal(prop, cx, vp);
}
else {
return JS_FALSE;
@ -84,25 +83,11 @@ GetHTMLUListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->GetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -127,12 +112,7 @@ SetHTMLUListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLULISTELEMENT_COMPACT:
{
PRBool prop;
JSBool temp;
if (JSVAL_IS_BOOLEAN(*vp) && JS_ValueToBoolean(cx, *vp, &temp)) {
prop = (PRBool)temp;
}
else {
JS_ReportError(cx, "Parameter must be a boolean");
if (PR_FALSE == nsConvertJSValToBool(&prop, cx, *vp)) {
return JS_FALSE;
}
@ -143,38 +123,18 @@ SetHTMLUListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case HTMLULISTELEMENT_TYPE:
{
nsAutoString prop;
JSString *jsstring;
if ((jsstring = JS_ValueToString(cx, *vp)) != nsnull) {
prop.SetString(JS_GetStringChars(jsstring));
}
else {
prop.SetString((const char *)nsnull);
}
nsConvertJSValToString(prop, cx, *vp);
a->SetType(prop);
break;
}
default:
{
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
}
else {
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
PRBool rval;
rval = object->SetProperty(cx, id, vp);
NS_RELEASE(object);
return rval;
}
return nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
return PR_TRUE;
@ -187,18 +147,7 @@ SetHTMLUListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PR_STATIC_CALLBACK(void)
FinalizeHTMLUListElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLUListElement *a = (nsIDOMHTMLUListElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIScriptObjectOwner *owner = nsnull;
if (NS_OK == a->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
owner->SetScriptObject(nsnull);
NS_RELEASE(owner);
}
NS_RELEASE(a);
}
nsGenericFinalize(cx, obj);
}
@ -208,17 +157,7 @@ FinalizeHTMLUListElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
EnumerateHTMLUListElement(JSContext *cx, JSObject *obj)
{
nsIDOMHTMLUListElement *a = (nsIDOMHTMLUListElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->EnumerateProperty(cx);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericEnumerate(cx, obj);
}
@ -228,17 +167,7 @@ EnumerateHTMLUListElement(JSContext *cx, JSObject *obj)
PR_STATIC_CALLBACK(JSBool)
ResolveHTMLUListElement(JSContext *cx, JSObject *obj, jsval id)
{
nsIDOMHTMLUListElement *a = (nsIDOMHTMLUListElement*)JS_GetPrivate(cx, obj);
if (nsnull != a) {
// get the js object
nsIJSScriptObject *object;
if (NS_OK == a->QueryInterface(kIJSScriptObjectIID, (void**)&object)) {
object->Resolve(cx, id);
NS_RELEASE(object);
}
}
return JS_TRUE;
return nsGenericResolve(cx, obj, id);
}

Просмотреть файл

@ -1150,6 +1150,7 @@ void IdlScanner::Number(int aStartChar, Token *aToken)
}
else {
mInputFile->putback(aStartChar);
aStartChar = '0';
}
}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше