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 21:42:36 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2005-08-23 05:42:49 +04:00
|
|
|
/* vim: set ts=2 sw=2 et tw=80: */
|
2012-05-21 15:12:37 +04: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 21:42:36 +04:00
|
|
|
|
2001-04-01 05:10:59 +04:00
|
|
|
#ifndef nsDOMClassInfo_h___
|
|
|
|
#define nsDOMClassInfo_h___
|
|
|
|
|
2013-06-05 20:15:48 +04:00
|
|
|
#include "mozilla/Attributes.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 21:42:36 +04:00
|
|
|
#include "nsIXPCScriptable.h"
|
2009-06-03 19:30:18 +04:00
|
|
|
#include "nsIScriptGlobalObject.h"
|
2013-08-15 22:17:48 +04:00
|
|
|
#include "nsIDOMScriptObjectFactory.h"
|
2013-08-22 09:26:56 +04:00
|
|
|
#include "js/Id.h"
|
2013-09-10 00:37:37 +04:00
|
|
|
#include "nsIXPConnect.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 21:42:36 +04:00
|
|
|
|
2012-11-09 19:59:41 +04:00
|
|
|
#ifdef XP_WIN
|
|
|
|
#undef GetClassName
|
|
|
|
#endif
|
|
|
|
|
2012-07-02 03:45:59 +04:00
|
|
|
class nsContentList;
|
2013-07-05 02:53:59 +04:00
|
|
|
class nsDocument;
|
2011-04-08 02:44:03 +04:00
|
|
|
class nsGlobalWindow;
|
2013-08-15 22:17:48 +04:00
|
|
|
class nsIScriptSecurityManager;
|
2013-02-17 08:43:16 +04:00
|
|
|
|
2002-03-04 05:25:08 +03:00
|
|
|
struct nsDOMClassInfoData;
|
|
|
|
|
|
|
|
typedef nsIClassInfo* (*nsDOMClassInfoConstructorFnc)
|
|
|
|
(nsDOMClassInfoData* aData);
|
|
|
|
|
2008-11-06 09:41:52 +03:00
|
|
|
typedef nsresult (*nsDOMConstructorFunc)(nsISupports** aNewObject);
|
2002-03-04 05:25:08 +03:00
|
|
|
|
|
|
|
struct nsDOMClassInfoData
|
|
|
|
{
|
|
|
|
const char *mName;
|
2009-06-03 19:30:18 +04:00
|
|
|
const PRUnichar *mNameUTF16;
|
2002-03-04 05:25:08 +03:00
|
|
|
union {
|
|
|
|
nsDOMClassInfoConstructorFnc mConstructorFptr;
|
|
|
|
nsDOMClassInfoExternalConstructorFnc mExternalConstructorFptr;
|
2002-03-04 06:37:18 +03:00
|
|
|
} u;
|
2003-02-27 03:54:49 +03:00
|
|
|
|
2002-03-04 05:25:08 +03: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 19:56:38 +04:00
|
|
|
uint32_t mScriptableFlags : 31; // flags must not use more than 31 bits!
|
|
|
|
uint32_t mHasClassInterface : 1;
|
|
|
|
uint32_t mInterfacesBitmap;
|
2013-08-09 18:35:53 +04:00
|
|
|
bool mChromeOnly : 1;
|
|
|
|
bool mAllowXBL : 1;
|
|
|
|
bool mDisabled : 1;
|
2012-06-25 23:59:42 +04:00
|
|
|
#ifdef DEBUG
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mDebugID;
|
2002-03-04 05:25:08 +03: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 12:24:11 +04: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 05:25:08 +03:00
|
|
|
|
2001-04-01 05:10:59 +04:00
|
|
|
|
2009-09-29 01:00:35 +04:00
|
|
|
class nsDOMClassInfo : public nsXPCClassInfo
|
2001-04-01 05:10:59 +04:00
|
|
|
{
|
2013-05-16 22:06:21 +04:00
|
|
|
friend class nsHTMLDocumentSH;
|
2001-04-01 05:10:59 +04:00
|
|
|
public:
|
2002-03-04 05:25:08 +03:00
|
|
|
nsDOMClassInfo(nsDOMClassInfoData* aData);
|
2001-04-01 05:10:59 +04: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 21:42:36 +04:00
|
|
|
NS_DECL_NSIXPCSCRIPTABLE
|
|
|
|
|
2001-04-01 05:10:59 +04: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 21:42:36 +04: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 05:25:08 +03: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 21:42:36 +04:00
|
|
|
|
|
|
|
static void ShutDown();
|
|
|
|
|
2002-03-04 05:25:08 +03: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 21:42:36 +04:00
|
|
|
{
|
2002-03-04 05:25:08 +03: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 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
2011-02-17 07:29:14 +03: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 17:06:34 +04: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 07:29:14 +03:00
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
static bool ObjectIsNativeWrapper(JSContext* cx, JSObject* obj);
|
2010-07-03 00:54:53 +04:00
|
|
|
|
2010-03-05 03:17:05 +03:00
|
|
|
static nsISupports *GetNative(nsIXPConnectWrappedNative *wrapper, JSObject *obj);
|
2009-05-13 00:20:42 +04:00
|
|
|
|
|
|
|
static nsIXPConnect *XPConnect()
|
|
|
|
{
|
|
|
|
return sXPConnect;
|
|
|
|
}
|
2013-07-09 18:45:13 +04:00
|
|
|
static nsIScriptSecurityManager *ScriptSecurityManager()
|
|
|
|
{
|
|
|
|
return sSecMan;
|
|
|
|
}
|
2009-05-13 00:20:42 +04: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 21:42:36 +04:00
|
|
|
protected:
|
2007-03-19 12:19:16 +03:00
|
|
|
friend nsIClassInfo* NS_GetDOMClassInfoInstance(nsDOMClassInfoID aID);
|
|
|
|
|
2002-03-04 05:25:08 +03:00
|
|
|
const nsDOMClassInfoData* mData;
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2013-06-05 20:15:48 +04:00
|
|
|
virtual void PreserveWrapper(nsISupports *aNative) MOZ_OVERRIDE
|
2009-11-29 11:32:39 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-06-05 20:15:48 +04:00
|
|
|
virtual uint32_t GetInterfacesBitmap() MOZ_OVERRIDE
|
2010-01-12 17:24:00 +03: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 21:42:36 +04:00
|
|
|
static nsresult Init();
|
2012-08-22 19:56:38 +04:00
|
|
|
static nsresult RegisterClassProtos(int32_t aDOMClassInfoID);
|
2002-03-04 05:25:08 +03:00
|
|
|
static nsresult RegisterExternalClasses();
|
2003-01-22 06:22:35 +03: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 21:42:36 +04:00
|
|
|
|
2001-06-28 08:26:29 +04: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
|
2013-05-04 11:51:53 +04:00
|
|
|
static int32_t GetArrayIndexFromId(JSContext *cx, JS::Handle<jsid> id,
|
2012-07-30 18:20:58 +04:00
|
|
|
bool *aIsNumber = nullptr);
|
2001-06-28 08:26:29 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
static inline bool IsReadonlyReplaceable(jsid id)
|
2001-11-18 09:45:10 +03:00
|
|
|
{
|
2011-05-10 22:24:44 +04:00
|
|
|
return (id == sParent_id ||
|
2002-08-16 01:18:20 +04: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 17:40:46 +04:00
|
|
|
id == sScrollMaxX_id ||
|
|
|
|
id == sScrollMaxY_id ||
|
2003-02-14 04:59:52 +03:00
|
|
|
id == sLength_id ||
|
2003-02-27 03:54:49 +03:00
|
|
|
id == sFrames_id ||
|
2013-07-10 13:55:24 +04:00
|
|
|
id == sSelf_id);
|
2001-11-18 09:45:10 +03: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 21:42:36 +04:00
|
|
|
static nsIXPConnect *sXPConnect;
|
|
|
|
static nsIScriptSecurityManager *sSecMan;
|
|
|
|
|
|
|
|
// nsIXPCScriptable code
|
2002-08-16 01:18:20 +04: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 21:42:36 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
static bool sIsInitialized;
|
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 21:42:36 +04:00
|
|
|
|
2010-12-21 19:02:01 +03:00
|
|
|
public:
|
2010-07-15 10:19:36 +04: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 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;
|
2012-08-26 01:56:45 +04:00
|
|
|
static jsid sTop_id;
|
2010-07-15 10:19:36 +04:00
|
|
|
static jsid sDocument_id;
|
|
|
|
static jsid sFrames_id;
|
|
|
|
static jsid sSelf_id;
|
|
|
|
static jsid sJava_id;
|
2010-09-18 01:54:40 +04:00
|
|
|
static jsid sWrappedJSObject_id;
|
2001-04-01 05:10:59 +04:00
|
|
|
};
|
|
|
|
|
2012-10-30 10:07:09 +04:00
|
|
|
// THIS ONE ISN'T SAFE!! It assumes that the private of the JSObject is
|
|
|
|
// an nsISupports.
|
2009-05-13 00:20:42 +04:00
|
|
|
inline
|
|
|
|
const nsQueryInterface
|
|
|
|
do_QueryWrappedNative(nsIXPConnectWrappedNative *wrapper, JSObject *obj)
|
|
|
|
{
|
|
|
|
return nsQueryInterface(nsDOMClassInfo::GetNative(wrapper, obj));
|
|
|
|
}
|
|
|
|
|
2012-10-30 10:07:09 +04:00
|
|
|
// THIS ONE ISN'T SAFE!! It assumes that the private of the JSObject is
|
|
|
|
// an nsISupports.
|
2009-05-13 00:20:42 +04: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 21:42:36 +04:00
|
|
|
typedef nsDOMClassInfo nsDOMGenericSH;
|
2001-04-01 05:10:59 +04:00
|
|
|
|
2010-01-13 16:50:01 +03:00
|
|
|
// Makes sure that the wrapper is preserved if new properties are added.
|
2008-08-14 15:04:43 +04:00
|
|
|
class nsEventTargetSH : public nsDOMGenericSH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsEventTargetSH(nsDOMClassInfoData* aData) : nsDOMGenericSH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsEventTargetSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
public:
|
2008-11-13 19:54:52 +03:00
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
2013-06-05 20:15:48 +04:00
|
|
|
JSObject *globalObj, JSObject **parentObj) MOZ_OVERRIDE;
|
2008-09-25 18:40:30 +04:00
|
|
|
NS_IMETHOD AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2013-08-18 02:50:18 +04:00
|
|
|
JSObject *obj, jsid id, JS::Value *vp, bool *_retval) MOZ_OVERRIDE;
|
2008-08-14 15:04:43 +04:00
|
|
|
|
2013-06-05 20:15:48 +04:00
|
|
|
virtual void PreserveWrapper(nsISupports *aNative) MOZ_OVERRIDE;
|
2009-11-29 11:32:39 +03:00
|
|
|
|
2008-08-14 15:04:43 +04: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 21:42:36 +04:00
|
|
|
|
2001-11-21 02:15:32 +03: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 21:42:36 +04:00
|
|
|
|
2011-08-24 23:49:25 +04: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 21:42:36 +04:00
|
|
|
{
|
|
|
|
protected:
|
2011-08-24 23:49:25 +04: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 21:42:36 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2010-09-18 01:54:40 +04: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 21:42:36 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2005-08-12 08:11:00 +04:00
|
|
|
static nsresult GlobalResolve(nsGlobalWindow *aWin, JSContext *cx,
|
2013-05-04 11:51:53 +04:00
|
|
|
JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
|
2013-05-04 03:29:08 +04:00
|
|
|
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 21:42:36 +04:00
|
|
|
|
|
|
|
public:
|
2010-09-18 01:54:40 +04:00
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
2013-06-05 20:15:48 +04:00
|
|
|
JSObject *globalObj, JSObject **parentObj) MOZ_OVERRIDE;
|
2013-07-09 18:45:13 +04:00
|
|
|
NS_IMETHOD PostCreatePrototype(JSContext * cx, JSObject * proto) MOZ_OVERRIDE;
|
2009-06-03 19:30:18 +04:00
|
|
|
#ifdef DEBUG
|
|
|
|
NS_IMETHOD PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2013-06-05 20:15:48 +04:00
|
|
|
JSObject *obj) MOZ_OVERRIDE
|
2009-06-03 19:30:18 +04:00
|
|
|
{
|
|
|
|
nsCOMPtr<nsIScriptGlobalObject> sgo(do_QueryWrappedNative(wrapper));
|
|
|
|
|
2012-07-30 18:20:58 +04:00
|
|
|
NS_ASSERTION(!sgo || sgo->GetGlobalJSObject() == nullptr,
|
2009-06-03 19:30:18 +04:00
|
|
|
"Multiple wrappers created for global object!");
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2013-06-05 20:15:48 +04:00
|
|
|
virtual uint32_t GetScriptableFlags() MOZ_OVERRIDE
|
2009-06-03 19:30:18 +04:00
|
|
|
{
|
2012-06-17 12:11:16 +04:00
|
|
|
return nsDOMGenericSH::GetScriptableFlags() |
|
|
|
|
nsIXPCScriptable::WANT_POSTCREATE;
|
2009-06-03 19:30:18 +04:00
|
|
|
}
|
|
|
|
#endif
|
2011-04-09 00:28:05 +04:00
|
|
|
NS_IMETHOD Enumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2013-06-05 20:15:48 +04:00
|
|
|
JSObject *obj, bool *_retval) MOZ_OVERRIDE;
|
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 21:42:36 +04:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2012-08-22 19:56:38 +04:00
|
|
|
JSObject *obj, jsid id, uint32_t flags,
|
2013-06-05 20:15:48 +04:00
|
|
|
JSObject **objp, bool *_retval) MOZ_OVERRIDE;
|
2012-03-19 18:34:55 +04:00
|
|
|
NS_IMETHOD Finalize(nsIXPConnectWrappedNative *wrapper, JSFreeOp *fop,
|
2013-06-05 20:15:48 +04:00
|
|
|
JSObject *obj) MOZ_OVERRIDE;
|
2010-09-18 01:54:40 +04:00
|
|
|
NS_IMETHOD OuterObject(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
|
2013-06-05 20:15:48 +04:00
|
|
|
JSObject * obj, JSObject * *_retval) MOZ_OVERRIDE;
|
2004-08-26 07:49:17 +04:00
|
|
|
|
2013-08-09 02:53:04 +04:00
|
|
|
static bool GlobalScopePolluterNewResolve(JSContext *cx, JS::Handle<JSObject*> obj,
|
|
|
|
JS::Handle<jsid> id, unsigned flags,
|
|
|
|
JS::MutableHandle<JSObject*> objp);
|
|
|
|
static bool GlobalScopePolluterGetProperty(JSContext *cx, JS::Handle<JSObject*> obj,
|
|
|
|
JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp);
|
|
|
|
static bool InvalidateGlobalScopePolluter(JSContext *cx,
|
|
|
|
JS::Handle<JSObject*> obj);
|
2013-05-03 22:53:32 +04:00
|
|
|
static nsresult InstallGlobalScopePolluter(JSContext *cx,
|
|
|
|
JS::Handle<JSObject*> obj);
|
2002-03-04 05:25:08 +03: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 21:42:36 +04:00
|
|
|
{
|
2010-09-18 01:54:40 +04: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 21:42:36 +04:00
|
|
|
}
|
2002-05-22 04:34:01 +04:00
|
|
|
};
|
2001-12-12 00:07:36 +03:00
|
|
|
|
2002-05-22 04:34:01 +04: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 19:56:38 +04:00
|
|
|
JSObject *obj, jsid id, uint32_t mode,
|
2013-08-18 02:50:18 +04:00
|
|
|
JS::Value *vp, bool *_retval) MOZ_OVERRIDE;
|
2002-05-22 04:34:01 +04:00
|
|
|
|
2005-08-23 05:42:49 +04:00
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
2013-06-05 20:15:48 +04:00
|
|
|
JSObject *globalObj, JSObject **parentObj) MOZ_OVERRIDE;
|
2012-11-22 01:20:05 +04:00
|
|
|
NS_IMETHODIMP AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2013-08-18 02:50:18 +04:00
|
|
|
JSObject *obj, jsid id, JS::Value *vp, bool *_retval);
|
2005-08-23 05:42:49 +04:00
|
|
|
|
2002-05-22 04:34:01 +04: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 21:42:36 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2003-10-16 04:44:20 +04:00
|
|
|
// Generic array scriptable helper
|
|
|
|
|
|
|
|
class nsGenericArraySH : public nsDOMClassInfo
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsGenericArraySH(nsDOMClassInfoData* aData) : nsDOMClassInfo(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsGenericArraySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
2005-10-04 09:50:42 +04:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2012-08-22 19:56:38 +04:00
|
|
|
JSObject *obj, jsid id, uint32_t flags,
|
2013-06-05 20:15:48 +04:00
|
|
|
JSObject **objp, bool *_retval) MOZ_OVERRIDE;
|
2003-10-16 04:44:20 +04:00
|
|
|
NS_IMETHOD Enumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2013-06-05 20:15:48 +04:00
|
|
|
JSObject *obj, bool *_retval) MOZ_OVERRIDE;
|
2003-10-16 04:44:20 +04:00
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
virtual nsresult GetLength(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2012-08-22 19:56:38 +04:00
|
|
|
JSObject *obj, uint32_t *length);
|
2008-10-22 18:31:14 +04:00
|
|
|
|
2003-10-16 04:44:20 +04:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsGenericArraySH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-10-22 18:31:14 +04: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 21:42:36 +04:00
|
|
|
|
2003-10-16 04:44:20 +04: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 21:42:36 +04:00
|
|
|
{
|
|
|
|
protected:
|
2003-10-16 04:44:20 +04: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 21:42:36 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsArraySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
// Subclasses need to override this, if the implementation can't fail it's
|
|
|
|
// allowed to not set *aResult.
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, uint32_t aIndex,
|
2010-05-09 23:33:00 +04: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 21:42:36 +04:00
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2013-08-18 02:50:18 +04:00
|
|
|
JSObject *obj, jsid id, JS::Value *vp, bool *_retval) MOZ_OVERRIDE;
|
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 21:42:36 +04:00
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
private:
|
|
|
|
// Not implemented, nothing should create an instance of this class.
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2013-06-12 10:55:00 +04:00
|
|
|
// HTMLAllCollection
|
|
|
|
|
2013-09-11 16:49:05 +04:00
|
|
|
extern const JSClass sHTMLDocumentAllClass;
|
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 21:42:36 +04:00
|
|
|
|
2013-05-16 22:06:21 +04:00
|
|
|
class nsHTMLDocumentSH
|
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 21:42:36 +04:00
|
|
|
{
|
|
|
|
protected:
|
2013-08-09 02:53:04 +04:00
|
|
|
static bool GetDocumentAllNodeList(JSContext *cx, JS::Handle<JSObject*> obj,
|
|
|
|
nsDocument *doc,
|
|
|
|
nsContentList **nodeList);
|
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 21:42:36 +04:00
|
|
|
public:
|
2013-08-09 02:53:04 +04:00
|
|
|
static bool DocumentAllGetProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
|
|
|
|
JS::MutableHandle<JS::Value> vp);
|
|
|
|
static bool DocumentAllNewResolve(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
|
|
|
|
unsigned flags, JS::MutableHandle<JSObject*> objp);
|
2012-03-19 18:34:55 +04:00
|
|
|
static void ReleaseDocument(JSFreeOp *fop, JSObject *obj);
|
2013-08-18 02:50:18 +04:00
|
|
|
static bool CallToGetPropMapper(JSContext *cx, unsigned argc, JS::Value *vp);
|
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 21:42:36 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2003-10-16 04:44:20 +04: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 21:42:36 +04:00
|
|
|
|
2003-10-16 04:44:20 +04: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 21:42:36 +04:00
|
|
|
{
|
|
|
|
protected:
|
2003-10-16 04:44:20 +04: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 21:42:36 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsStringArraySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual nsresult GetStringAt(nsISupports *aNative, int32_t aIndex,
|
2002-03-24 03:16:18 +03: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 21:42:36 +04:00
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2013-08-18 02:50:18 +04:00
|
|
|
JSObject *obj, jsid id, JS::Value *vp, bool *_retval) MOZ_OVERRIDE;
|
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 21:42:36 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2003-10-16 04:44:20 +04:00
|
|
|
// StringList scriptable helper
|
|
|
|
|
|
|
|
class nsStringListSH : public nsStringArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsStringListSH(nsDOMClassInfoData* aData) : nsStringArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsStringListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual nsresult GetStringAt(nsISupports *aNative, int32_t aIndex,
|
2013-06-05 20:15:48 +04:00
|
|
|
nsAString& aResult) MOZ_OVERRIDE;
|
2003-10-16 04:44:20 +04:00
|
|
|
|
|
|
|
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 21:42:36 +04:00
|
|
|
|
|
|
|
// MediaList helper
|
|
|
|
|
|
|
|
class nsMediaListSH : public nsStringArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 05:25:08 +03: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 21:42:36 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsMediaListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual nsresult GetStringAt(nsISupports *aNative, int32_t aIndex,
|
2013-06-05 20:15:48 +04:00
|
|
|
nsAString& aResult) MOZ_OVERRIDE;
|
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 21:42:36 +04:00
|
|
|
|
|
|
|
public:
|
2002-03-04 05:25:08 +03: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 21:42:36 +04:00
|
|
|
{
|
2002-03-04 05:25:08 +03: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 21:42:36 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// StyleSheetList helper
|
|
|
|
|
|
|
|
class nsStyleSheetListSH : public nsArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 05:25:08 +03: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 21:42:36 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsStyleSheetListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, uint32_t aIndex,
|
2013-06-05 20:15:48 +04:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult) MOZ_OVERRIDE;
|
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 21:42:36 +04:00
|
|
|
|
|
|
|
public:
|
2002-03-04 05:25:08 +03: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 21:42:36 +04:00
|
|
|
{
|
2002-03-04 05:25:08 +03: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 21:42:36 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2001-05-14 02:16:45 +04:00
|
|
|
// CSSRuleList helper
|
|
|
|
|
|
|
|
class nsCSSRuleListSH : public nsArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 05:25:08 +03:00
|
|
|
nsCSSRuleListSH(nsDOMClassInfoData* aData) : nsArraySH(aData)
|
2001-05-14 02:16:45 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsCSSRuleListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, uint32_t aIndex,
|
2013-06-05 20:15:48 +04:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult) MOZ_OVERRIDE;
|
2001-05-14 02:16:45 +04:00
|
|
|
|
|
|
|
public:
|
2002-03-04 05:25:08 +03:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
2001-05-14 02:16:45 +04:00
|
|
|
{
|
2002-03-04 05:25:08 +03:00
|
|
|
return new nsCSSRuleListSH(aData);
|
2001-05-14 02:16:45 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2006-05-19 09:57:36 +04:00
|
|
|
// WebApps Storage helpers
|
|
|
|
|
2009-03-19 02:43:45 +03:00
|
|
|
class nsStorage2SH : public nsDOMGenericSH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsStorage2SH(nsDOMClassInfoData* aData) : nsDOMGenericSH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsStorage2SH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2012-08-22 19:56:38 +04:00
|
|
|
JSObject *obj, jsid id, uint32_t flags,
|
2013-06-05 20:15:48 +04:00
|
|
|
JSObject **objp, bool *_retval) MOZ_OVERRIDE;
|
2009-03-19 02:43:45 +03:00
|
|
|
NS_IMETHOD SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2013-08-18 02:50:18 +04:00
|
|
|
JSObject *obj, jsid id, JS::Value *vp, bool *_retval) MOZ_OVERRIDE;
|
2009-03-19 02:43:45 +03:00
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2013-08-18 02:50:18 +04:00
|
|
|
JSObject *obj, jsid id, JS::Value *vp, bool *_retval) MOZ_OVERRIDE;
|
2009-03-19 02:43:45 +03:00
|
|
|
NS_IMETHOD DelProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2013-06-05 20:15:48 +04:00
|
|
|
JSObject *obj, jsid id, bool *_retval) MOZ_OVERRIDE;
|
2009-03-19 02:43:45 +03:00
|
|
|
NS_IMETHOD NewEnumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2013-08-18 02:50:18 +04:00
|
|
|
JSObject *obj, uint32_t enum_op, JS::Value *statep,
|
2013-06-05 20:15:48 +04:00
|
|
|
jsid *idp, bool *_retval) MOZ_OVERRIDE;
|
2009-03-19 02:43:45 +03: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 21:42:36 +04: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 22:08:45 +03:00
|
|
|
class nsDOMConstructorSH : public nsDOMGenericSH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsDOMConstructorSH(nsDOMClassInfoData* aData) : nsDOMGenericSH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
2011-01-11 23:15:52 +03:00
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
2013-06-05 20:15:48 +04:00
|
|
|
JSObject *globalObj, JSObject **parentObj) MOZ_OVERRIDE;
|
|
|
|
NS_IMETHOD PostCreatePrototype(JSContext * cx, JSObject * proto) MOZ_OVERRIDE
|
2009-06-03 19:30:18 +04:00
|
|
|
{
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2011-09-22 06:16:50 +04:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2012-08-22 19:56:38 +04:00
|
|
|
JSObject *obj, jsid id, uint32_t flags,
|
2013-06-05 20:15:48 +04:00
|
|
|
JSObject **objp, bool *_retval) MOZ_OVERRIDE;
|
2007-05-09 16:04:59 +04:00
|
|
|
NS_IMETHOD Call(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2013-06-05 20:15:48 +04:00
|
|
|
JSObject *obj, const JS::CallArgs &args, bool *_retval) MOZ_OVERRIDE;
|
2007-05-09 16:04:59 +04:00
|
|
|
|
2005-12-09 22:08:45 +03:00
|
|
|
NS_IMETHOD Construct(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2013-06-05 20:15:48 +04:00
|
|
|
JSObject *obj, const JS::CallArgs &args, bool *_retval) MOZ_OVERRIDE;
|
2005-12-09 22:08:45 +03:00
|
|
|
|
|
|
|
NS_IMETHOD HasInstance(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2013-08-18 02:50:18 +04:00
|
|
|
JSObject *obj, const JS::Value &val, bool *bp,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool *_retval);
|
2005-12-09 22:08:45 +03: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 21:42:36 +04:00
|
|
|
|
2006-02-23 06:17:11 +03:00
|
|
|
class nsNonDOMObjectSH : public nsDOMGenericSH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsNonDOMObjectSH(nsDOMClassInfoData* aData) : nsDOMGenericSH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsNonDOMObjectSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
2013-06-05 20:15:48 +04:00
|
|
|
NS_IMETHOD GetFlags(uint32_t *aFlags) MOZ_OVERRIDE;
|
2006-02-23 06:17:11 +03:00
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsNonDOMObjectSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2001-04-01 05:10:59 +04:00
|
|
|
#endif /* nsDOMClassInfo_h___ */
|