Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2005-08-23 01:42:49 +00:00
|
|
|
/* vim: set ts=2 sw=2 et tw=80: */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2001-04-01 01:10:59 +00:00
|
|
|
#ifndef nsDOMClassInfo_h___
|
|
|
|
#define nsDOMClassInfo_h___
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
#include "nsIDOMClassInfo.h"
|
|
|
|
#include "nsIXPCScriptable.h"
|
|
|
|
#include "jsapi.h"
|
|
|
|
#include "nsIScriptSecurityManager.h"
|
2005-07-30 20:57:07 +00:00
|
|
|
#include "nsIScriptContext.h"
|
2006-06-13 03:07:47 +00:00
|
|
|
#include "nsDOMJSUtils.h" // for GetScriptContextFromJSContext
|
2009-06-03 15:30:18 +00:00
|
|
|
#include "nsIScriptGlobalObject.h"
|
2011-06-14 08:41:15 +00:00
|
|
|
#include "xpcpublic.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2012-11-09 15:59:41 +00:00
|
|
|
#ifdef XP_WIN
|
|
|
|
#undef GetClassName
|
|
|
|
#endif
|
|
|
|
|
2012-07-01 23:45:59 +00:00
|
|
|
class nsContentList;
|
2011-04-07 22:44:03 +00:00
|
|
|
class nsGlobalWindow;
|
2012-06-04 19:41:51 +00:00
|
|
|
class nsICanvasRenderingContextInternal;
|
2011-08-20 13:53:34 +00:00
|
|
|
class nsIDOMHTMLOptionsCollection;
|
2011-04-07 22:44:03 +00:00
|
|
|
class nsIDOMWindow;
|
|
|
|
class nsIForm;
|
2004-08-26 03:49:17 +00:00
|
|
|
class nsIHTMLDocument;
|
2011-05-18 01:48:34 +00:00
|
|
|
class nsNPAPIPluginInstance;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2002-03-04 02:25:08 +00:00
|
|
|
struct nsDOMClassInfoData;
|
|
|
|
|
|
|
|
typedef nsIClassInfo* (*nsDOMClassInfoConstructorFnc)
|
|
|
|
(nsDOMClassInfoData* aData);
|
|
|
|
|
2008-11-06 06:41:52 +00:00
|
|
|
typedef nsresult (*nsDOMConstructorFunc)(nsISupports** aNewObject);
|
2002-03-04 02:25:08 +00:00
|
|
|
|
|
|
|
struct nsDOMClassInfoData
|
|
|
|
{
|
|
|
|
const char *mName;
|
2009-06-03 15:30:18 +00:00
|
|
|
const PRUnichar *mNameUTF16;
|
2002-03-04 02:25:08 +00:00
|
|
|
union {
|
|
|
|
nsDOMClassInfoConstructorFnc mConstructorFptr;
|
|
|
|
nsDOMClassInfoExternalConstructorFnc mExternalConstructorFptr;
|
2002-03-04 03:37:18 +00:00
|
|
|
} u;
|
2003-02-27 00:54:49 +00:00
|
|
|
|
2002-03-04 02:25:08 +00:00
|
|
|
nsIClassInfo *mCachedClassInfo; // low bit is set to 1 if external,
|
|
|
|
// so be sure to mask if necessary!
|
|
|
|
const nsIID *mProtoChainInterface;
|
|
|
|
const nsIID **mInterfaces;
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mScriptableFlags : 31; // flags must not use more than 31 bits!
|
|
|
|
uint32_t mHasClassInterface : 1;
|
|
|
|
uint32_t mInterfacesBitmap;
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mChromeOnly;
|
|
|
|
bool mDisabled;
|
2012-06-25 19:59:42 +00:00
|
|
|
#ifdef DEBUG
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mDebugID;
|
2002-03-04 02:25:08 +00:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
struct nsExternalDOMClassInfoData : public nsDOMClassInfoData
|
|
|
|
{
|
|
|
|
const nsCID *mConstructorCID;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// To be used with the nsDOMClassInfoData::mCachedClassInfo pointer.
|
|
|
|
// The low bit is set when we created a generic helper for an external
|
|
|
|
// (which holds on to the nsDOMClassInfoData).
|
2012-10-02 08:24:11 +00:00
|
|
|
#define GET_CLEAN_CI_PTR(_ptr) (nsIClassInfo*)(uintptr_t(_ptr) & ~0x1)
|
|
|
|
#define MARK_EXTERNAL(_ptr) (nsIClassInfo*)(uintptr_t(_ptr) | 0x1)
|
|
|
|
#define IS_EXTERNAL(_ptr) (uintptr_t(_ptr) & 0x1)
|
2002-03-04 02:25:08 +00:00
|
|
|
|
2001-04-01 01:10:59 +00:00
|
|
|
|
2009-09-28 21:00:35 +00:00
|
|
|
class nsDOMClassInfo : public nsXPCClassInfo
|
2001-04-01 01:10:59 +00:00
|
|
|
{
|
|
|
|
public:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsDOMClassInfo(nsDOMClassInfoData* aData);
|
2001-04-01 01:10:59 +00:00
|
|
|
virtual ~nsDOMClassInfo();
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_DECL_NSIXPCSCRIPTABLE
|
|
|
|
|
2001-04-01 01:10:59 +00:00
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
NS_DECL_NSICLASSINFO
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
// Helper method that returns a *non* refcounted pointer to a
|
|
|
|
// helper. So please note, don't release this pointer, if you do,
|
|
|
|
// you better make sure you've addreffed before release.
|
|
|
|
//
|
|
|
|
// Whaaaaa! I wanted to name this method GetClassInfo, but nooo,
|
|
|
|
// some of Microsoft devstudio's headers #defines GetClassInfo to
|
|
|
|
// GetClassInfoA so I can't, those $%#@^! bastards!!! What gives
|
|
|
|
// them the right to do that?
|
|
|
|
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo* GetClassInfoInstance(nsDOMClassInfoData* aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
|
|
|
static void ShutDown();
|
|
|
|
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsDOMClassInfo(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
|
2011-02-17 04:29:14 +00:00
|
|
|
/*
|
|
|
|
* The following two functions exist because of the way that Xray wrappers
|
|
|
|
* work. In order to allow scriptable helpers to define non-IDL defined but
|
|
|
|
* still "safe" properties for Xray wrappers, we call into the scriptable
|
|
|
|
* helper with |obj| being the wrapper.
|
|
|
|
*
|
|
|
|
* Ideally, that would be the end of the story, however due to complications
|
|
|
|
* dealing with document.domain, it's possible to end up in a scriptable
|
|
|
|
* helper with a wrapper, even though we should be treating the lookup as a
|
|
|
|
* transparent one.
|
2012-08-27 13:06:34 +00:00
|
|
|
*
|
|
|
|
* Note: So ObjectIsNativeWrapper(cx, obj) check usually means "through xray
|
|
|
|
* wrapper this part is not visible" while combined with
|
|
|
|
* || xpc::WrapperFactory::XrayWrapperNotShadowing(obj) it means "through
|
|
|
|
* xray wrapper it is visible only if it does not hide any native property."
|
2011-02-17 04:29:14 +00:00
|
|
|
*/
|
2011-09-29 06:19:26 +00:00
|
|
|
static bool ObjectIsNativeWrapper(JSContext* cx, JSObject* obj);
|
2010-07-02 20:54:53 +00:00
|
|
|
|
2010-03-05 00:17:05 +00:00
|
|
|
static nsISupports *GetNative(nsIXPConnectWrappedNative *wrapper, JSObject *obj);
|
2009-05-12 20:20:42 +00:00
|
|
|
|
|
|
|
static nsIXPConnect *XPConnect()
|
|
|
|
{
|
|
|
|
return sXPConnect;
|
|
|
|
}
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
protected:
|
2007-03-19 09:19:16 +00:00
|
|
|
friend nsIClassInfo* NS_GetDOMClassInfoInstance(nsDOMClassInfoID aID);
|
|
|
|
|
2002-03-04 02:25:08 +00:00
|
|
|
const nsDOMClassInfoData* mData;
|
2001-07-11 09:09:30 +00:00
|
|
|
|
2009-11-29 08:32:39 +00:00
|
|
|
virtual void PreserveWrapper(nsISupports *aNative)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual uint32_t GetInterfacesBitmap()
|
2010-01-12 14:24:00 +00:00
|
|
|
{
|
|
|
|
return mData->mInterfacesBitmap;
|
|
|
|
}
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
static nsresult Init();
|
2012-08-22 15:56:38 +00:00
|
|
|
static nsresult RegisterClassProtos(int32_t aDOMClassInfoID);
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsresult RegisterExternalClasses();
|
2003-01-22 03:22:35 +00:00
|
|
|
nsresult ResolveConstructor(JSContext *cx, JSObject *obj,
|
|
|
|
JSObject **objp);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2001-06-28 04:26:29 +00:00
|
|
|
// Checks if id is a number and returns the number, if aIsNumber is
|
|
|
|
// non-null it's set to true if the id is a number and false if it's
|
|
|
|
// not a number. If id is not a number this method returns -1
|
2012-08-22 15:56:38 +00:00
|
|
|
static int32_t GetArrayIndexFromId(JSContext *cx, jsid id,
|
2012-07-30 14:20:58 +00:00
|
|
|
bool *aIsNumber = nullptr);
|
2001-06-28 04:26:29 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
static inline bool IsReadonlyReplaceable(jsid id)
|
2001-11-18 06:45:10 +00:00
|
|
|
{
|
2011-05-10 18:24:44 +00:00
|
|
|
return (id == sParent_id ||
|
2002-08-15 21:18:20 +00:00
|
|
|
id == sScrollbars_id ||
|
|
|
|
id == sContent_id ||
|
|
|
|
id == sMenubar_id ||
|
|
|
|
id == sToolbar_id ||
|
|
|
|
id == sLocationbar_id ||
|
|
|
|
id == sPersonalbar_id ||
|
|
|
|
id == sStatusbar_id ||
|
|
|
|
id == sControllers_id ||
|
|
|
|
id == sScrollX_id ||
|
|
|
|
id == sScrollY_id ||
|
2003-04-15 13:40:46 +00:00
|
|
|
id == sScrollMaxX_id ||
|
|
|
|
id == sScrollMaxY_id ||
|
2003-02-14 01:59:52 +00:00
|
|
|
id == sLength_id ||
|
2003-02-27 00:54:49 +00:00
|
|
|
id == sFrames_id ||
|
2010-12-08 16:16:09 +00:00
|
|
|
id == sSelf_id ||
|
|
|
|
id == sURL_id);
|
2001-11-18 06:45:10 +00:00
|
|
|
}
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
static nsIXPConnect *sXPConnect;
|
|
|
|
static nsIScriptSecurityManager *sSecMan;
|
|
|
|
|
|
|
|
// nsIXPCScriptable code
|
2002-08-15 21:18:20 +00:00
|
|
|
static nsresult DefineStaticJSVals(JSContext *cx);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
static bool sIsInitialized;
|
|
|
|
static bool sDisableDocumentAllSupport;
|
|
|
|
static bool sDisableGlobalScopePollutionSupport;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2010-12-21 16:02:01 +00:00
|
|
|
public:
|
2010-07-15 06:19:36 +00:00
|
|
|
static jsid sParent_id;
|
|
|
|
static jsid sScrollbars_id;
|
|
|
|
static jsid sLocation_id;
|
|
|
|
static jsid sConstructor_id;
|
|
|
|
static jsid s_content_id;
|
|
|
|
static jsid sContent_id;
|
|
|
|
static jsid sMenubar_id;
|
|
|
|
static jsid sToolbar_id;
|
|
|
|
static jsid sLocationbar_id;
|
|
|
|
static jsid sPersonalbar_id;
|
|
|
|
static jsid sStatusbar_id;
|
|
|
|
static jsid sDialogArguments_id;
|
|
|
|
static jsid sControllers_id;
|
|
|
|
static jsid sLength_id;
|
|
|
|
static jsid sScrollX_id;
|
|
|
|
static jsid sScrollY_id;
|
|
|
|
static jsid sScrollMaxX_id;
|
|
|
|
static jsid sScrollMaxY_id;
|
|
|
|
static jsid sItem_id;
|
|
|
|
static jsid sNamedItem_id;
|
|
|
|
static jsid sEnumerate_id;
|
|
|
|
static jsid sNavigator_id;
|
2012-08-25 21:56:45 +00:00
|
|
|
static jsid sTop_id;
|
2010-07-15 06:19:36 +00:00
|
|
|
static jsid sDocument_id;
|
|
|
|
static jsid sFrames_id;
|
|
|
|
static jsid sSelf_id;
|
|
|
|
static jsid sAll_id;
|
|
|
|
static jsid sTags_id;
|
2011-09-22 03:05:42 +00:00
|
|
|
static jsid sDocumentURIObject_id;
|
2010-07-15 06:19:36 +00:00
|
|
|
static jsid sJava_id;
|
|
|
|
static jsid sPackages_id;
|
2010-09-17 21:54:40 +00:00
|
|
|
static jsid sWrappedJSObject_id;
|
2010-12-08 16:16:09 +00:00
|
|
|
static jsid sURL_id;
|
2011-08-24 19:49:25 +00:00
|
|
|
static jsid sOnload_id;
|
|
|
|
static jsid sOnerror_id;
|
2011-06-28 22:37:31 +00:00
|
|
|
|
2010-12-21 16:02:01 +00:00
|
|
|
protected:
|
2010-03-19 01:00:58 +00:00
|
|
|
static JSPropertyOp sXPCNativeWrapperGetPropertyOp;
|
2010-07-02 20:54:53 +00:00
|
|
|
static JSPropertyOp sXrayWrapperPropertyHolderGetPropertyOp;
|
2001-04-01 01:10:59 +00:00
|
|
|
};
|
|
|
|
|
2012-10-30 06:07:09 +00:00
|
|
|
// THIS ONE ISN'T SAFE!! It assumes that the private of the JSObject is
|
|
|
|
// an nsISupports.
|
2009-05-12 20:20:42 +00:00
|
|
|
inline
|
|
|
|
const nsQueryInterface
|
|
|
|
do_QueryWrappedNative(nsIXPConnectWrappedNative *wrapper, JSObject *obj)
|
|
|
|
{
|
|
|
|
return nsQueryInterface(nsDOMClassInfo::GetNative(wrapper, obj));
|
|
|
|
}
|
|
|
|
|
2012-10-30 06:07:09 +00:00
|
|
|
// THIS ONE ISN'T SAFE!! It assumes that the private of the JSObject is
|
|
|
|
// an nsISupports.
|
2009-05-12 20:20:42 +00:00
|
|
|
inline
|
|
|
|
const nsQueryInterfaceWithError
|
|
|
|
do_QueryWrappedNative(nsIXPConnectWrappedNative *wrapper, JSObject *obj,
|
|
|
|
nsresult *aError)
|
|
|
|
|
|
|
|
{
|
|
|
|
return nsQueryInterfaceWithError(nsDOMClassInfo::GetNative(wrapper, obj),
|
|
|
|
aError);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline
|
|
|
|
nsQueryInterface
|
|
|
|
do_QueryWrapper(JSContext *cx, JSObject *obj)
|
|
|
|
{
|
|
|
|
nsISupports *native =
|
|
|
|
nsDOMClassInfo::XPConnect()->GetNativeOfWrapper(cx, obj);
|
|
|
|
return nsQueryInterface(native);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline
|
|
|
|
nsQueryInterfaceWithError
|
|
|
|
do_QueryWrapper(JSContext *cx, JSObject *obj, nsresult* error)
|
|
|
|
{
|
|
|
|
nsISupports *native =
|
|
|
|
nsDOMClassInfo::XPConnect()->GetNativeOfWrapper(cx, obj);
|
|
|
|
return nsQueryInterfaceWithError(native, error);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
typedef nsDOMClassInfo nsDOMGenericSH;
|
2001-04-01 01:10:59 +00:00
|
|
|
|
2010-01-13 13:50:01 +00:00
|
|
|
// Makes sure that the wrapper is preserved if new properties are added.
|
2008-08-14 11:04:43 +00:00
|
|
|
class nsEventTargetSH : public nsDOMGenericSH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsEventTargetSH(nsDOMClassInfoData* aData) : nsDOMGenericSH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsEventTargetSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
public:
|
2008-11-13 16:54:52 +00:00
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
2008-09-25 14:40:30 +00:00
|
|
|
NS_IMETHOD AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2008-08-14 11:04:43 +00:00
|
|
|
|
2009-11-29 08:32:39 +00:00
|
|
|
virtual void PreserveWrapper(nsISupports *aNative);
|
|
|
|
|
2008-08-14 11:04:43 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsEventTargetSH(aData);
|
|
|
|
}
|
|
|
|
};
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2001-11-20 23:15:32 +00:00
|
|
|
// Window scriptable helper
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2011-08-24 19:49:25 +00:00
|
|
|
class nsWindowSH : public nsDOMGenericSH
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
protected:
|
2011-08-24 19:49:25 +00:00
|
|
|
nsWindowSH(nsDOMClassInfoData *aData) : nsDOMGenericSH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2010-09-17 21:54:40 +00:00
|
|
|
virtual ~nsWindowSH()
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2005-08-12 04:11:00 +00:00
|
|
|
static nsresult GlobalResolve(nsGlobalWindow *aWin, JSContext *cx,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject *obj, jsid id, bool *did_resolve);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
|
|
|
public:
|
2010-09-17 21:54:40 +00:00
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
2009-06-03 15:30:18 +00:00
|
|
|
#ifdef DEBUG
|
|
|
|
NS_IMETHOD PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj)
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIScriptGlobalObject> sgo(do_QueryWrappedNative(wrapper));
|
|
|
|
|
2012-07-30 14:20:58 +00:00
|
|
|
NS_ASSERTION(!sgo || sgo->GetGlobalJSObject() == nullptr,
|
2009-06-03 15:30:18 +00:00
|
|
|
"Multiple wrappers created for global object!");
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual uint32_t GetScriptableFlags()
|
2009-06-03 15:30:18 +00:00
|
|
|
{
|
2012-06-17 08:11:16 +00:00
|
|
|
return nsDOMGenericSH::GetScriptableFlags() |
|
|
|
|
nsIXPCScriptable::WANT_POSTCREATE;
|
2009-06-03 15:30:18 +00:00
|
|
|
}
|
|
|
|
#endif
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2011-04-08 20:28:05 +00:00
|
|
|
NS_IMETHOD Enumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject *obj, bool *_retval);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2012-08-22 15:56:38 +00:00
|
|
|
JSObject *obj, jsid id, uint32_t flags,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject **objp, bool *_retval);
|
2012-03-19 14:34:55 +00:00
|
|
|
NS_IMETHOD Finalize(nsIXPConnectWrappedNative *wrapper, JSFreeOp *fop,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
JSObject *obj);
|
2010-09-17 21:54:40 +00:00
|
|
|
NS_IMETHOD OuterObject(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
|
|
|
|
JSObject * obj, JSObject * *_retval);
|
2004-08-26 03:49:17 +00:00
|
|
|
|
2012-05-19 22:03:45 +00:00
|
|
|
static JSBool GlobalScopePolluterNewResolve(JSContext *cx, JSHandleObject obj,
|
|
|
|
JSHandleId id, unsigned flags,
|
2012-07-04 18:12:16 +00:00
|
|
|
JSMutableHandleObject objp);
|
2012-05-19 22:03:45 +00:00
|
|
|
static JSBool GlobalScopePolluterGetProperty(JSContext *cx, JSHandleObject obj,
|
2012-07-30 11:19:09 +00:00
|
|
|
JSHandleId id, JSMutableHandleValue vp);
|
2012-05-19 22:03:45 +00:00
|
|
|
static JSBool SecurityCheckOnAddDelProp(JSContext *cx, JSHandleObject obj, JSHandleId id,
|
2012-07-30 11:19:09 +00:00
|
|
|
JSMutableHandleValue vp);
|
2012-05-19 22:03:45 +00:00
|
|
|
static JSBool SecurityCheckOnSetProp(JSContext *cx, JSHandleObject obj, JSHandleId id,
|
2012-07-30 11:19:09 +00:00
|
|
|
JSBool strict, JSMutableHandleValue vp);
|
2012-09-03 23:42:17 +00:00
|
|
|
static JSBool InvalidateGlobalScopePolluter(JSContext *cx, JSObject *obj);
|
2004-08-26 03:49:17 +00:00
|
|
|
static nsresult InstallGlobalScopePolluter(JSContext *cx, JSObject *obj,
|
|
|
|
nsIHTMLDocument *doc);
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2010-09-17 21:54:40 +00:00
|
|
|
return new nsWindowSH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
2002-05-22 00:34:01 +00:00
|
|
|
};
|
2001-12-11 21:07:36 +00:00
|
|
|
|
2002-05-22 00:34:01 +00:00
|
|
|
// Location scriptable helper
|
|
|
|
|
|
|
|
class nsLocationSH : public nsDOMGenericSH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsLocationSH(nsDOMClassInfoData* aData) : nsDOMGenericSH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsLocationSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD CheckAccess(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2012-08-22 15:56:38 +00:00
|
|
|
JSObject *obj, jsid id, uint32_t mode,
|
2011-09-29 06:19:26 +00:00
|
|
|
jsval *vp, bool *_retval);
|
2002-05-22 00:34:01 +00:00
|
|
|
|
2005-08-23 01:42:49 +00:00
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
2012-11-21 21:20:05 +00:00
|
|
|
NS_IMETHODIMP AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2005-08-23 01:42:49 +00:00
|
|
|
|
2002-05-22 00:34:01 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsLocationSH(aData);
|
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-07-30 20:57:07 +00:00
|
|
|
// Navigator scriptable helper
|
|
|
|
|
|
|
|
class nsNavigatorSH : public nsDOMGenericSH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsNavigatorSH(nsDOMClassInfoData* aData) : nsDOMGenericSH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsNavigatorSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
2011-09-06 19:01:01 +00:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2012-08-22 15:56:38 +00:00
|
|
|
JSObject *obj, jsid id, uint32_t flags,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject **objp, bool *_retval);
|
2005-07-30 20:57:07 +00:00
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsNavigatorSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-06-15 20:25:51 +00:00
|
|
|
// scriptable helper for new-binding objects without wrapper caches
|
|
|
|
|
|
|
|
class nsNewDOMBindingNoWrapperCacheSH : public nsDOMGenericSH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsNewDOMBindingNoWrapperCacheSH(nsDOMClassInfoData* aData) : nsDOMGenericSH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsNewDOMBindingNoWrapperCacheSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsNewDOMBindingNoWrapperCacheSH(aData);
|
|
|
|
}
|
|
|
|
};
|
2005-07-30 20:57:07 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
// DOM Node helper, this class deals with setting the parent for the
|
|
|
|
// wrappers
|
|
|
|
|
2011-08-24 19:49:25 +00:00
|
|
|
class nsNodeSH : public nsDOMGenericSH
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
protected:
|
2011-08-24 19:49:25 +00:00
|
|
|
nsNodeSH(nsDOMClassInfoData* aData) : nsDOMGenericSH(aData)
|
2001-04-01 01:10:59 +00:00
|
|
|
{
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
2001-04-01 01:10:59 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
virtual ~nsNodeSH()
|
|
|
|
{
|
|
|
|
}
|
2001-04-01 01:10:59 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
public:
|
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
|
|
|
NS_IMETHOD AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2006-06-23 16:43:29 +00:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2012-08-22 15:56:38 +00:00
|
|
|
JSObject *obj, jsid id, uint32_t flags,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject **objp, bool *_retval);
|
2012-08-22 15:56:38 +00:00
|
|
|
NS_IMETHOD GetFlags(uint32_t *aFlags);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2009-11-29 08:32:39 +00:00
|
|
|
virtual void PreserveWrapper(nsISupports *aNative);
|
|
|
|
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsNodeSH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
2001-04-01 01:10:59 +00:00
|
|
|
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
// Element helper
|
2001-04-01 01:10:59 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
class nsElementSH : public nsNodeSH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsElementSH(nsDOMClassInfoData* aData) : nsNodeSH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
2001-04-01 01:10:59 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
virtual ~nsElementSH()
|
|
|
|
{
|
2001-04-01 01:10:59 +00:00
|
|
|
}
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
public:
|
2009-05-12 20:20:42 +00:00
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_IMETHOD PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2004-08-26 03:49:17 +00:00
|
|
|
JSObject *obj);
|
2012-07-13 08:55:14 +00:00
|
|
|
NS_IMETHOD PostTransplant(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj);
|
2001-04-01 01:10:59 +00:00
|
|
|
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsElementSH(aData);
|
2001-04-01 01:10:59 +00:00
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
};
|
2001-04-01 01:10:59 +00:00
|
|
|
|
|
|
|
|
2003-10-16 00:44:20 +00:00
|
|
|
// Generic array scriptable helper
|
|
|
|
|
|
|
|
class nsGenericArraySH : public nsDOMClassInfo
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsGenericArraySH(nsDOMClassInfoData* aData) : nsDOMClassInfo(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsGenericArraySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
2005-10-04 05:50:42 +00:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2012-08-22 15:56:38 +00:00
|
|
|
JSObject *obj, jsid id, uint32_t flags,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject **objp, bool *_retval);
|
2003-10-16 00:44:20 +00:00
|
|
|
NS_IMETHOD Enumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject *obj, bool *_retval);
|
2003-10-16 00:44:20 +00:00
|
|
|
|
2008-10-22 14:31:14 +00:00
|
|
|
virtual nsresult GetLength(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2012-08-22 15:56:38 +00:00
|
|
|
JSObject *obj, uint32_t *length);
|
2008-10-22 14:31:14 +00:00
|
|
|
|
2003-10-16 00:44:20 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsGenericArraySH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-10-22 14:31:14 +00:00
|
|
|
// Array scriptable helper
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2003-10-16 00:44:20 +00:00
|
|
|
class nsArraySH : public nsGenericArraySH
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
protected:
|
2003-10-16 00:44:20 +00:00
|
|
|
nsArraySH(nsDOMClassInfoData* aData) : nsGenericArraySH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsArraySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-22 14:31:14 +00:00
|
|
|
// Subclasses need to override this, if the implementation can't fail it's
|
|
|
|
// allowed to not set *aResult.
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, uint32_t aIndex,
|
2010-05-09 19:33:00 +00:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult) = 0;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2008-10-22 14:31:14 +00:00
|
|
|
private:
|
|
|
|
// Not implemented, nothing should create an instance of this class.
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
// NamedArray helper
|
|
|
|
|
|
|
|
class nsNamedArraySH : public nsArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsNamedArraySH(nsDOMClassInfoData* aData) : nsArraySH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsNamedArraySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-02-24 18:27:26 +00:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2012-08-22 15:56:38 +00:00
|
|
|
JSObject *obj, jsid id, uint32_t flags,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject **objp, bool *_retval);
|
2011-02-24 18:27:26 +00:00
|
|
|
|
2008-10-31 21:40:35 +00:00
|
|
|
virtual nsISupports* GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
2010-05-09 19:41:19 +00:00
|
|
|
nsWrapperCache **cache,
|
2008-10-31 21:40:35 +00:00
|
|
|
nsresult *aResult) = 0;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2008-10-22 14:31:14 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
// Not implemented, nothing should create an instance of this class.
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// NamedNodeMap helper
|
|
|
|
|
|
|
|
class nsNamedNodeMapSH : public nsNamedArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsNamedNodeMapSH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsNamedNodeMapSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, uint32_t aIndex,
|
2010-05-09 19:33:00 +00:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
|
|
|
// Override nsNamedArraySH::GetNamedItem()
|
2008-10-31 21:40:35 +00:00
|
|
|
virtual nsISupports* GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
2010-05-09 19:41:19 +00:00
|
|
|
nsWrapperCache **cache,
|
2008-10-31 21:40:35 +00:00
|
|
|
nsresult *aResult);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
|
|
|
public:
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsNamedNodeMapSH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
// Document helper, for document.location and document.on*
|
|
|
|
|
|
|
|
class nsDocumentSH : public nsNodeSH
|
|
|
|
{
|
|
|
|
public:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsDocumentSH(nsDOMClassInfoData* aData) : nsNodeSH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsDocumentSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
2011-09-22 01:30:27 +00:00
|
|
|
NS_IMETHOD PostCreatePrototype(JSContext * cx, JSObject * proto);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2012-08-22 15:56:38 +00:00
|
|
|
JSObject *obj, jsid id, uint32_t flags,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject **objp, bool *_retval);
|
2012-08-22 15:56:38 +00:00
|
|
|
NS_IMETHOD GetFlags(uint32_t* aFlags);
|
2005-07-28 16:15:00 +00:00
|
|
|
NS_IMETHOD PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj);
|
2012-07-13 08:55:14 +00:00
|
|
|
NS_IMETHOD PostTransplant(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsDocumentSH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// HTMLDocument helper
|
|
|
|
|
|
|
|
class nsHTMLDocumentSH : public nsDocumentSH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsHTMLDocumentSH(nsDOMClassInfoData* aData) : nsDocumentSH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsHTMLDocumentSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2004-08-24 01:31:19 +00:00
|
|
|
static JSBool GetDocumentAllNodeList(JSContext *cx, JSObject *obj,
|
2010-05-10 16:43:20 +00:00
|
|
|
nsDocument *doc,
|
|
|
|
nsContentList **nodeList);
|
2001-05-21 12:37:38 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
public:
|
2012-05-19 22:03:45 +00:00
|
|
|
static JSBool DocumentAllGetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id,
|
2012-07-30 11:19:09 +00:00
|
|
|
JSMutableHandleValue vp);
|
2012-05-19 22:03:45 +00:00
|
|
|
static JSBool DocumentAllNewResolve(JSContext *cx, JSHandleObject obj, JSHandleId id,
|
2012-07-04 18:12:16 +00:00
|
|
|
unsigned flags, JSMutableHandleObject objp);
|
2012-03-19 14:34:55 +00:00
|
|
|
static void ReleaseDocument(JSFreeOp *fop, JSObject *obj);
|
2012-02-28 23:11:11 +00:00
|
|
|
static JSBool CallToGetPropMapper(JSContext *cx, unsigned argc, jsval *vp);
|
2012-05-19 22:03:45 +00:00
|
|
|
static JSBool DocumentAllHelperGetProperty(JSContext *cx, JSHandleObject obj,
|
2012-07-30 11:19:09 +00:00
|
|
|
JSHandleId id, JSMutableHandleValue vp);
|
2012-05-19 22:03:45 +00:00
|
|
|
static JSBool DocumentAllHelperNewResolve(JSContext *cx, JSHandleObject obj,
|
|
|
|
JSHandleId id, unsigned flags,
|
2012-07-04 18:12:16 +00:00
|
|
|
JSMutableHandleObject objp);
|
2012-05-19 22:03:45 +00:00
|
|
|
static JSBool DocumentAllTagsNewResolve(JSContext *cx, JSHandleObject obj,
|
|
|
|
JSHandleId id, unsigned flags,
|
2012-07-04 18:12:16 +00:00
|
|
|
JSMutableHandleObject objp);
|
2004-07-23 00:26:02 +00:00
|
|
|
|
2001-05-21 12:37:38 +00:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2012-08-22 15:56:38 +00:00
|
|
|
JSObject *obj, jsid id, uint32_t flags,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject **objp, bool *_retval);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsHTMLDocumentSH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// HTMLFormElement helper
|
|
|
|
|
2009-08-10 14:41:12 +00:00
|
|
|
class nsHTMLFormElementSH : public nsElementSH
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
protected:
|
2009-08-10 14:41:12 +00:00
|
|
|
nsHTMLFormElementSH(nsDOMClassInfoData* aData) : nsElementSH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsHTMLFormElementSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2010-12-03 08:24:17 +00:00
|
|
|
static nsresult FindNamedItem(nsIForm *aForm, jsid id,
|
2010-05-10 16:43:20 +00:00
|
|
|
nsISupports **aResult, nsWrapperCache **aCache);
|
2001-05-12 05:26:07 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
public:
|
2001-05-12 05:26:07 +00:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2012-08-22 15:56:38 +00:00
|
|
|
JSObject *obj, jsid id, uint32_t flags,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject **objp, bool *_retval);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2010-07-15 06:19:36 +00:00
|
|
|
JSObject *obj, jsid id, jsval *vp,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool *_retval);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2002-03-13 02:56:40 +00:00
|
|
|
NS_IMETHOD NewEnumerate(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj,
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t enum_op, jsval *statep,
|
2011-09-29 06:19:26 +00:00
|
|
|
jsid *idp, bool *_retval);
|
2002-03-13 02:56:40 +00:00
|
|
|
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsHTMLFormElementSH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2001-05-12 05:26:07 +00:00
|
|
|
// HTMLSelectElement helper
|
|
|
|
|
2009-08-10 14:41:12 +00:00
|
|
|
class nsHTMLSelectElementSH : public nsElementSH
|
2001-05-12 05:26:07 +00:00
|
|
|
{
|
|
|
|
protected:
|
2009-08-10 14:41:12 +00:00
|
|
|
nsHTMLSelectElementSH(nsDOMClassInfoData* aData) : nsElementSH(aData)
|
2001-05-12 05:26:07 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsHTMLSelectElementSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
2011-02-24 18:36:33 +00:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2012-08-22 15:56:38 +00:00
|
|
|
JSObject *obj, jsid id, uint32_t flags,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject **objp, bool *_retval);
|
2001-05-12 05:26:07 +00:00
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2010-07-15 06:19:36 +00:00
|
|
|
JSObject *obj, jsid id, jsval *vp,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool *_retval);
|
2001-05-12 05:26:07 +00:00
|
|
|
NS_IMETHOD SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2001-05-12 05:26:07 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
static nsresult SetOption(JSContext *cx, jsval *vp, uint32_t aIndex,
|
2011-08-20 13:53:34 +00:00
|
|
|
nsIDOMHTMLOptionsCollection *aOptCollection);
|
2001-05-12 05:26:07 +00:00
|
|
|
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
2001-05-12 05:26:07 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsHTMLSelectElementSH(aData);
|
2001-05-12 05:26:07 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-08-29 00:28:32 +00:00
|
|
|
// HTMLEmbed/Object/AppletElement helper
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2009-08-10 14:41:12 +00:00
|
|
|
class nsHTMLPluginObjElementSH : public nsElementSH
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
protected:
|
2007-08-29 00:28:32 +00:00
|
|
|
nsHTMLPluginObjElementSH(nsDOMClassInfoData* aData)
|
2009-08-10 14:41:12 +00:00
|
|
|
: nsElementSH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-08-29 00:28:32 +00:00
|
|
|
virtual ~nsHTMLPluginObjElementSH()
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-03-14 23:08:57 +00:00
|
|
|
static nsresult GetPluginInstanceIfSafe(nsIXPConnectWrappedNative *aWrapper,
|
2009-05-12 20:20:42 +00:00
|
|
|
JSObject *obj,
|
2012-12-07 22:50:10 +00:00
|
|
|
JSContext *cx,
|
2011-05-18 01:48:34 +00:00
|
|
|
nsNPAPIPluginInstance **aResult);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2007-08-29 00:28:32 +00:00
|
|
|
static nsresult GetPluginJSObject(JSContext *cx, JSObject *obj,
|
2011-05-18 01:48:34 +00:00
|
|
|
nsNPAPIPluginInstance *plugin_inst,
|
2007-08-29 00:28:32 +00:00
|
|
|
JSObject **plugin_obj,
|
|
|
|
JSObject **plugin_proto);
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
public:
|
2009-12-25 18:16:57 +00:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2012-08-22 15:56:38 +00:00
|
|
|
JSObject *obj, jsid id, uint32_t flags,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject **objp, bool *_retval);
|
2009-05-12 20:20:42 +00:00
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_IMETHOD PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj);
|
2012-07-13 08:55:14 +00:00
|
|
|
NS_IMETHOD PostTransplant(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj);
|
2004-10-28 01:54:21 +00:00
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2004-04-02 05:11:44 +00:00
|
|
|
NS_IMETHOD SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2004-08-30 04:31:16 +00:00
|
|
|
NS_IMETHOD Call(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2012-08-22 15:56:38 +00:00
|
|
|
JSObject *obj, uint32_t argc, jsval *argv, jsval *vp,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool *_retval);
|
2001-10-10 04:04:21 +00:00
|
|
|
|
2008-03-14 23:08:57 +00:00
|
|
|
|
|
|
|
static nsresult SetupProtoChain(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj);
|
|
|
|
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsHTMLPluginObjElementSH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Plugin helper
|
|
|
|
|
|
|
|
class nsPluginSH : public nsNamedArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsPluginSH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsPluginSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, uint32_t aIndex,
|
2010-05-09 19:33:00 +00:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
|
|
|
// Override nsNamedArraySH::GetNamedItem()
|
2008-10-31 21:40:35 +00:00
|
|
|
virtual nsISupports* GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
2010-05-09 19:41:19 +00:00
|
|
|
nsWrapperCache **cache,
|
2008-10-31 21:40:35 +00:00
|
|
|
nsresult *aResult);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
|
|
|
public:
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsPluginSH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
2001-04-01 01:10:59 +00:00
|
|
|
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
// PluginArray helper
|
2001-04-01 01:10:59 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
class nsPluginArraySH : public nsNamedArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsPluginArraySH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsPluginArraySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, uint32_t aIndex,
|
2010-05-09 19:33:00 +00:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
|
|
|
// Override nsNamedArraySH::GetNamedItem()
|
2008-10-31 21:40:35 +00:00
|
|
|
virtual nsISupports* GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
2010-05-09 19:41:19 +00:00
|
|
|
nsWrapperCache **cache,
|
2008-10-31 21:40:35 +00:00
|
|
|
nsresult *aResult);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
|
|
|
public:
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsPluginArraySH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// MimeTypeArray helper
|
|
|
|
|
|
|
|
class nsMimeTypeArraySH : public nsNamedArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsMimeTypeArraySH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsMimeTypeArraySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, uint32_t aIndex,
|
2010-05-09 19:33:00 +00:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
|
|
|
// Override nsNamedArraySH::GetNamedItem()
|
2008-10-31 21:40:35 +00:00
|
|
|
virtual nsISupports* GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
2010-05-09 19:41:19 +00:00
|
|
|
nsWrapperCache **cache,
|
2008-10-31 21:40:35 +00:00
|
|
|
nsresult *aResult);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
|
|
|
public:
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsMimeTypeArraySH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2003-10-16 00:44:20 +00:00
|
|
|
// String array helper
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2003-10-16 00:44:20 +00:00
|
|
|
class nsStringArraySH : public nsGenericArraySH
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
protected:
|
2003-10-16 00:44:20 +00:00
|
|
|
nsStringArraySH(nsDOMClassInfoData* aData) : nsGenericArraySH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsStringArraySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual nsresult GetStringAt(nsISupports *aNative, int32_t aIndex,
|
2002-03-24 00:16:18 +00:00
|
|
|
nsAString& aResult) = 0;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// History helper
|
|
|
|
|
|
|
|
class nsHistorySH : public nsStringArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsHistorySH(nsDOMClassInfoData* aData) : nsStringArraySH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsHistorySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual nsresult GetStringAt(nsISupports *aNative, int32_t aIndex,
|
2002-03-24 00:16:18 +00:00
|
|
|
nsAString& aResult);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
|
|
|
public:
|
2010-10-29 19:49:32 +00:00
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
2001-08-31 02:36:45 +00:00
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2001-08-31 02:36:45 +00:00
|
|
|
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsHistorySH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2003-10-16 00:44:20 +00:00
|
|
|
// StringList scriptable helper
|
|
|
|
|
|
|
|
class nsStringListSH : public nsStringArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsStringListSH(nsDOMClassInfoData* aData) : nsStringArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsStringListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual nsresult GetStringAt(nsISupports *aNative, int32_t aIndex,
|
2003-10-16 00:44:20 +00:00
|
|
|
nsAString& aResult);
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Inherit GetProperty, Enumerate from nsStringArraySH
|
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsStringListSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
|
|
|
// MediaList helper
|
|
|
|
|
|
|
|
class nsMediaListSH : public nsStringArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsMediaListSH(nsDOMClassInfoData* aData) : nsStringArraySH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsMediaListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual nsresult GetStringAt(nsISupports *aNative, int32_t aIndex,
|
2002-03-24 00:16:18 +00:00
|
|
|
nsAString& aResult);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
|
|
|
public:
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsMediaListSH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// StyleSheetList helper
|
|
|
|
|
|
|
|
class nsStyleSheetListSH : public nsArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsStyleSheetListSH(nsDOMClassInfoData* aData) : nsArraySH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsStyleSheetListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, uint32_t aIndex,
|
2010-05-09 19:33:00 +00:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
|
|
|
public:
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsStyleSheetListSH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2001-05-13 22:16:45 +00:00
|
|
|
// CSSRuleList helper
|
|
|
|
|
|
|
|
class nsCSSRuleListSH : public nsArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsCSSRuleListSH(nsDOMClassInfoData* aData) : nsArraySH(aData)
|
2001-05-13 22:16:45 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsCSSRuleListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, uint32_t aIndex,
|
2010-05-09 19:33:00 +00:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult);
|
2001-05-13 22:16:45 +00:00
|
|
|
|
|
|
|
public:
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
2001-05-13 22:16:45 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsCSSRuleListSH(aData);
|
2001-05-13 22:16:45 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-08-02 17:41:42 +00:00
|
|
|
class nsDOMTouchListSH : public nsArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsDOMTouchListSH(nsDOMClassInfoData* aData) : nsArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsDOMTouchListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, uint32_t aIndex,
|
2012-08-02 17:41:42 +00:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult);
|
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo* doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsDOMTouchListSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2004-04-17 05:53:38 +00:00
|
|
|
#ifdef MOZ_XUL
|
|
|
|
// TreeColumns helper
|
|
|
|
|
|
|
|
class nsTreeColumnsSH : public nsNamedArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsTreeColumnsSH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsTreeColumnsSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, uint32_t aIndex,
|
2010-05-09 19:33:00 +00:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult);
|
2004-04-17 05:53:38 +00:00
|
|
|
|
|
|
|
// Override nsNamedArraySH::GetNamedItem()
|
2008-10-31 21:40:35 +00:00
|
|
|
virtual nsISupports* GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
2010-05-09 19:41:19 +00:00
|
|
|
nsWrapperCache **cache,
|
2008-10-31 21:40:35 +00:00
|
|
|
nsresult *aResult);
|
2004-04-17 05:53:38 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsTreeColumnsSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2006-05-19 05:57:36 +00:00
|
|
|
// WebApps Storage helpers
|
|
|
|
|
2009-03-18 23:43:45 +00:00
|
|
|
class nsStorage2SH : public nsDOMGenericSH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsStorage2SH(nsDOMClassInfoData* aData) : nsDOMGenericSH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsStorage2SH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2012-08-22 15:56:38 +00:00
|
|
|
JSObject *obj, jsid id, uint32_t flags,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject **objp, bool *_retval);
|
2009-03-18 23:43:45 +00:00
|
|
|
NS_IMETHOD SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2009-03-18 23:43:45 +00:00
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2009-03-18 23:43:45 +00:00
|
|
|
NS_IMETHOD DelProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2009-03-18 23:43:45 +00:00
|
|
|
NS_IMETHOD NewEnumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2012-08-22 15:56:38 +00:00
|
|
|
JSObject *obj, uint32_t enum_op, jsval *statep,
|
2011-09-29 06:19:26 +00:00
|
|
|
jsid *idp, bool *_retval);
|
2009-03-18 23:43:45 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsStorage2SH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
// Event handler 'this' translator class, this is called by XPConnect
|
|
|
|
// when a "function interface" (nsIDOMEventListener) is called, this
|
|
|
|
// class extracts 'this' fomr the first argument to the called
|
|
|
|
// function (nsIDOMEventListener::HandleEvent(in nsIDOMEvent)), this
|
|
|
|
// class will pass back nsIDOMEvent::currentTarget to be used as
|
|
|
|
// 'this'.
|
|
|
|
|
|
|
|
class nsEventListenerThisTranslator : public nsIXPCFunctionThisTranslator
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsEventListenerThisTranslator()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsEventListenerThisTranslator()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// nsISupports
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
// nsIXPCFunctionThisTranslator
|
|
|
|
NS_DECL_NSIXPCFUNCTIONTHISTRANSLATOR
|
|
|
|
};
|
|
|
|
|
2005-12-09 19:08:45 +00:00
|
|
|
class nsDOMConstructorSH : public nsDOMGenericSH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsDOMConstructorSH(nsDOMClassInfoData* aData) : nsDOMGenericSH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
2011-01-11 20:15:52 +00:00
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
2009-06-03 15:30:18 +00:00
|
|
|
NS_IMETHOD PostCreatePrototype(JSContext * cx, JSObject * proto)
|
|
|
|
{
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2011-09-22 02:16:50 +00:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2012-08-22 15:56:38 +00:00
|
|
|
JSObject *obj, jsid id, uint32_t flags,
|
2011-09-22 02:16:50 +00:00
|
|
|
JSObject **objp, bool *_retval);
|
2007-05-09 12:04:59 +00:00
|
|
|
NS_IMETHOD Call(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2012-08-22 15:56:38 +00:00
|
|
|
JSObject *obj, uint32_t argc, jsval *argv, jsval *vp,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool *_retval);
|
2007-05-09 12:04:59 +00:00
|
|
|
|
2005-12-09 19:08:45 +00:00
|
|
|
NS_IMETHOD Construct(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2012-08-22 15:56:38 +00:00
|
|
|
JSObject *obj, uint32_t argc, jsval *argv,
|
2011-09-29 06:19:26 +00:00
|
|
|
jsval *vp, bool *_retval);
|
2005-12-09 19:08:45 +00:00
|
|
|
|
|
|
|
NS_IMETHOD HasInstance(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-29 06:19:26 +00:00
|
|
|
JSObject *obj, const jsval &val, bool *bp,
|
|
|
|
bool *_retval);
|
2005-12-09 19:08:45 +00:00
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsDOMConstructorSH(aData);
|
|
|
|
}
|
|
|
|
};
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2006-02-23 03:17:11 +00:00
|
|
|
class nsNonDOMObjectSH : public nsDOMGenericSH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsNonDOMObjectSH(nsDOMClassInfoData* aData) : nsDOMGenericSH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsNonDOMObjectSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
2012-08-22 15:56:38 +00:00
|
|
|
NS_IMETHOD GetFlags(uint32_t *aFlags);
|
2006-02-23 03:17:11 +00:00
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsNonDOMObjectSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2006-06-06 15:42:41 +00:00
|
|
|
// Need this to override GetFlags() on nsNodeSH
|
|
|
|
class nsAttributeSH : public nsNodeSH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsAttributeSH(nsDOMClassInfoData* aData) : nsNodeSH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsAttributeSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
2012-08-22 15:56:38 +00:00
|
|
|
NS_IMETHOD GetFlags(uint32_t *aFlags);
|
2006-06-06 15:42:41 +00:00
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsAttributeSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2007-05-29 09:45:30 +00:00
|
|
|
class nsOfflineResourceListSH : public nsStringArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsOfflineResourceListSH(nsDOMClassInfoData* aData) : nsStringArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsOfflineResourceListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual nsresult GetStringAt(nsISupports *aNative, int32_t aIndex,
|
2007-05-29 09:45:30 +00:00
|
|
|
nsAString& aResult);
|
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsOfflineResourceListSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-01-31 13:18:08 +00:00
|
|
|
// SVGStringList helper
|
|
|
|
|
|
|
|
class nsSVGStringListSH : public nsStringArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsSVGStringListSH(nsDOMClassInfoData* aData) : nsStringArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsSVGStringListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual nsresult GetStringAt(nsISupports *aNative, int32_t aIndex,
|
2012-01-31 13:18:08 +00:00
|
|
|
nsAString& aResult);
|
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsSVGStringListSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-06-04 19:41:51 +00:00
|
|
|
template<class T, class BaseType = T>
|
|
|
|
class nsNewDOMBindingSH : public nsDOMGenericSH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsNewDOMBindingSH(nsDOMClassInfoData* aData) : nsDOMGenericSH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsNewDOMBindingSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsNewDOMBindingSH<T, BaseType>(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2001-04-01 01:10:59 +00:00
|
|
|
#endif /* nsDOMClassInfo_h___ */
|