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: */
|
2001-09-26 02:43:09 +04:00
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-18 01:52:36 +04:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
2001-04-01 05:10:59 +04:00
|
|
|
*
|
2004-04-18 01:52:36 +04:00
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
2001-09-26 02:43:09 +04:00
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
2001-04-01 05:10:59 +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
|
|
|
* The Original Code is mozilla.org code.
|
2001-04-01 05:10:59 +04:00
|
|
|
*
|
2004-04-18 01:52:36 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-09-26 02:43:09 +04:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2000
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
2001-04-01 05:10:59 +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
|
|
|
* Contributor(s):
|
|
|
|
* Johnny Stenback <jst@netscape.com> (original author)
|
2001-09-26 02:43:09 +04:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-18 01:52:36 +04:00
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
2001-09-26 02:43:09 +04:00
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
2004-04-18 01:52:36 +04:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-09-26 02:43:09 +04:00
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
2004-04-18 01:52:36 +04:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2001-09-26 02:43:09 +04:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
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___
|
|
|
|
|
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 "nsIDOMClassInfo.h"
|
|
|
|
#include "nsIXPCScriptable.h"
|
|
|
|
#include "jsapi.h"
|
|
|
|
#include "nsIScriptSecurityManager.h"
|
2005-07-31 00:57:07 +04:00
|
|
|
#include "nsIScriptContext.h"
|
2006-06-13 07:07:47 +04:00
|
|
|
#include "nsDOMJSUtils.h" // for GetScriptContextFromJSContext
|
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-04-27 04:03:47 +04:00
|
|
|
class nsIDOMWindow;
|
2001-05-12 09:26:07 +04:00
|
|
|
class nsIDOMNSHTMLOptionCollection;
|
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
|
|
|
class nsIPluginInstance;
|
2001-05-12 09:26:07 +04:00
|
|
|
class nsIForm;
|
2004-08-24 05:31:19 +04:00
|
|
|
class nsIDOMNodeList;
|
|
|
|
class nsIDOMDocument;
|
2004-08-26 07:49:17 +04:00
|
|
|
class nsIHTMLDocument;
|
2005-08-12 08:11:00 +04:00
|
|
|
class nsGlobalWindow;
|
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
|
|
|
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;
|
|
|
|
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;
|
|
|
|
PRUint32 mScriptableFlags : 31; // flags must not use more than 31 bits!
|
2008-09-27 02:43:31 +04:00
|
|
|
PRUint32 mHasClassInterface : 1;
|
2002-03-04 05:25:08 +03:00
|
|
|
#ifdef NS_DEBUG
|
|
|
|
PRUint32 mDebugID;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
struct nsExternalDOMClassInfoData : public nsDOMClassInfoData
|
|
|
|
{
|
|
|
|
const nsCID *mConstructorCID;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-03-15 06:19:53 +03:00
|
|
|
typedef PRUptrdiff PtrBits;
|
2002-03-04 05:25:08 +03:00
|
|
|
|
|
|
|
// 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).
|
|
|
|
#define GET_CLEAN_CI_PTR(_ptr) (nsIClassInfo*)(PtrBits(_ptr) & ~0x1)
|
|
|
|
#define MARK_EXTERNAL(_ptr) (nsIClassInfo*)(PtrBits(_ptr) | 0x1)
|
|
|
|
#define IS_EXTERNAL(_ptr) (PtrBits(_ptr) & 0x1)
|
|
|
|
|
2001-04-01 05:10:59 +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
|
|
|
class nsDOMClassInfo : public nsIXPCScriptable,
|
|
|
|
public nsIClassInfo
|
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
|
|
|
}
|
|
|
|
|
|
|
|
static nsresult WrapNative(JSContext *cx, JSObject *scope,
|
2008-12-16 18:46:18 +03:00
|
|
|
nsISupports *native, const nsIID* aIID,
|
2005-09-07 07:12:10 +04:00
|
|
|
jsval *vp,
|
2008-12-16 18:46:18 +03:00
|
|
|
// If non-null aHolder will keep the jsval alive
|
|
|
|
// while there's a ref to it
|
|
|
|
nsIXPConnectJSObjectHolder** aHolder = nsnull);
|
2008-12-16 18:46:18 +03:00
|
|
|
|
|
|
|
// Same as the WrapNative above, but use this one if aIID is nsISupports' IID.
|
|
|
|
static nsresult WrapNative(JSContext *cx, JSObject *scope,
|
|
|
|
nsISupports *native, jsval *vp,
|
|
|
|
// If non-null aHolder will keep the jsval alive
|
|
|
|
// while there's a ref to it
|
|
|
|
nsIXPConnectJSObjectHolder** aHolder = nsnull)
|
|
|
|
{
|
|
|
|
return WrapNative(cx, scope, native, nsnull, vp, aHolder);
|
|
|
|
}
|
|
|
|
|
2002-02-07 13:50:42 +03:00
|
|
|
static nsresult ThrowJSException(JSContext *cx, 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 21:42:36 +04:00
|
|
|
|
2003-01-22 06:22:35 +03:00
|
|
|
static nsresult InitDOMJSClass(JSContext *cx, JSObject *obj);
|
|
|
|
|
|
|
|
static JSClass sDOMJSClass;
|
|
|
|
|
2005-07-29 19:11:08 +04:00
|
|
|
/**
|
|
|
|
* Get our JSClass pointer for the XPCNativeWrapper class
|
|
|
|
*/
|
|
|
|
static const JSClass* GetXPCNativeWrapperClass() {
|
|
|
|
return sXPCNativeWrapperClass;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set our JSClass pointer for the XPCNativeWrapper class
|
|
|
|
*/
|
|
|
|
static void SetXPCNativeWrapperClass(JSClass* aClass) {
|
|
|
|
NS_ASSERTION(!sXPCNativeWrapperClass,
|
|
|
|
"Double set of sXPCNativeWrapperClass");
|
|
|
|
sXPCNativeWrapperClass = aClass;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PRBool ObjectIsNativeWrapper(JSContext* cx, JSObject* obj)
|
|
|
|
{
|
2005-07-31 00:57:07 +04:00
|
|
|
#ifdef DEBUG
|
|
|
|
{
|
|
|
|
nsIScriptContext *scx = GetScriptContextFromJSContext(cx);
|
|
|
|
|
|
|
|
NS_PRECONDITION(!scx || !scx->IsContextInitialized() ||
|
|
|
|
sXPCNativeWrapperClass,
|
|
|
|
"Must know what the XPCNativeWrapper class is!");
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return sXPCNativeWrapperClass &&
|
2008-02-25 11:59:20 +03:00
|
|
|
::JS_GET_CLASS(cx, obj) == sXPCNativeWrapperClass;
|
2005-07-29 19:11:08 +04:00
|
|
|
}
|
|
|
|
|
2008-11-13 19:54:52 +03:00
|
|
|
static void PreserveNodeWrapper(nsIXPConnectWrappedNative *aWrapper);
|
2005-03-30 03:26:56 +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
|
|
|
|
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();
|
2001-07-11 13:09:30 +04:00
|
|
|
static nsresult RegisterClassName(PRInt32 aDOMClassInfoID);
|
|
|
|
static nsresult RegisterClassProtos(PRInt32 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
|
|
|
|
static PRInt32 GetArrayIndexFromId(JSContext *cx, jsval id,
|
|
|
|
PRBool *aIsNumber = nsnull);
|
|
|
|
|
2002-08-16 01:18:20 +04:00
|
|
|
static inline PRBool IsReadonlyReplaceable(jsval id)
|
2001-11-18 09:45:10 +03:00
|
|
|
{
|
2002-08-16 01:18:20 +04:00
|
|
|
return (id == sTop_id ||
|
2003-04-26 07:27:21 +04:00
|
|
|
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 == sDirectories_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 ||
|
|
|
|
id == sSelf_id);
|
2001-11-18 09:45:10 +03:00
|
|
|
}
|
|
|
|
|
2002-08-16 01:18:20 +04:00
|
|
|
static inline PRBool IsWritableReplaceable(jsval id)
|
2001-11-18 09:45:10 +03:00
|
|
|
{
|
2002-08-16 01:18:20 +04:00
|
|
|
return (id == sInnerHeight_id ||
|
|
|
|
id == sInnerWidth_id ||
|
2003-07-09 04:48:25 +04:00
|
|
|
id == sOpener_id ||
|
2002-08-16 01:18:20 +04:00
|
|
|
id == sOuterHeight_id ||
|
|
|
|
id == sOuterWidth_id ||
|
|
|
|
id == sScreenX_id ||
|
|
|
|
id == sScreenY_id ||
|
|
|
|
id == sStatus_id ||
|
|
|
|
id == sName_id);
|
2001-11-18 09:45:10 +03:00
|
|
|
}
|
|
|
|
|
2001-07-11 13:09:30 +04:00
|
|
|
static JSClass sDOMConstructorProtoClass;
|
2003-01-22 06:22:35 +03:00
|
|
|
static JSFunctionSpec sDOMJSClass_methods[];
|
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
|
|
|
|
|
|
|
static PRBool sIsInitialized;
|
2004-07-23 04:26:02 +04:00
|
|
|
static PRBool sDisableDocumentAllSupport;
|
2004-08-26 07:49:17 +04:00
|
|
|
static PRBool 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 21:42:36 +04:00
|
|
|
|
2002-08-16 01:18:20 +04:00
|
|
|
static jsval sTop_id;
|
2003-04-26 07:27:21 +04:00
|
|
|
static jsval sParent_id;
|
2002-08-16 01:18:20 +04:00
|
|
|
static jsval sScrollbars_id;
|
|
|
|
static jsval sLocation_id;
|
2003-01-22 06:22:35 +03:00
|
|
|
static jsval sConstructor_id;
|
2002-08-16 01:18:20 +04:00
|
|
|
static jsval s_content_id;
|
|
|
|
static jsval sContent_id;
|
|
|
|
static jsval sMenubar_id;
|
|
|
|
static jsval sToolbar_id;
|
|
|
|
static jsval sLocationbar_id;
|
|
|
|
static jsval sPersonalbar_id;
|
|
|
|
static jsval sStatusbar_id;
|
|
|
|
static jsval sDirectories_id;
|
|
|
|
static jsval sControllers_id;
|
|
|
|
static jsval sLength_id;
|
|
|
|
static jsval sInnerHeight_id;
|
|
|
|
static jsval sInnerWidth_id;
|
|
|
|
static jsval sOuterHeight_id;
|
|
|
|
static jsval sOuterWidth_id;
|
|
|
|
static jsval sScreenX_id;
|
|
|
|
static jsval sScreenY_id;
|
|
|
|
static jsval sStatus_id;
|
|
|
|
static jsval sName_id;
|
|
|
|
static jsval sOnmousedown_id;
|
|
|
|
static jsval sOnmouseup_id;
|
|
|
|
static jsval sOnclick_id;
|
2003-06-10 22:33:58 +04:00
|
|
|
static jsval sOndblclick_id;
|
2002-08-16 01:18:20 +04:00
|
|
|
static jsval sOncontextmenu_id;
|
|
|
|
static jsval sOnmouseover_id;
|
|
|
|
static jsval sOnmouseout_id;
|
|
|
|
static jsval sOnkeydown_id;
|
|
|
|
static jsval sOnkeyup_id;
|
|
|
|
static jsval sOnkeypress_id;
|
|
|
|
static jsval sOnmousemove_id;
|
|
|
|
static jsval sOnfocus_id;
|
|
|
|
static jsval sOnblur_id;
|
|
|
|
static jsval sOnsubmit_id;
|
|
|
|
static jsval sOnreset_id;
|
|
|
|
static jsval sOnchange_id;
|
|
|
|
static jsval sOnselect_id;
|
|
|
|
static jsval sOnload_id;
|
2004-02-11 09:09:51 +03:00
|
|
|
static jsval sOnbeforeunload_id;
|
2002-08-16 01:18:20 +04:00
|
|
|
static jsval sOnunload_id;
|
2005-07-26 02:09:39 +04:00
|
|
|
static jsval sOnpageshow_id;
|
|
|
|
static jsval sOnpagehide_id;
|
2002-08-16 01:18:20 +04:00
|
|
|
static jsval sOnabort_id;
|
|
|
|
static jsval sOnerror_id;
|
|
|
|
static jsval sOnpaint_id;
|
|
|
|
static jsval sOnresize_id;
|
|
|
|
static jsval sOnscroll_id;
|
2009-02-18 16:31:31 +03:00
|
|
|
static jsval sOndrag_id;
|
|
|
|
static jsval sOndragend_id;
|
|
|
|
static jsval sOndragenter_id;
|
|
|
|
static jsval sOndragleave_id;
|
|
|
|
static jsval sOndragover_id;
|
|
|
|
static jsval sOndragstart_id;
|
|
|
|
static jsval sOndrop_id;
|
2002-08-16 01:18:20 +04:00
|
|
|
static jsval sScrollIntoView_id;
|
|
|
|
static jsval sScrollX_id;
|
|
|
|
static jsval sScrollY_id;
|
2003-04-15 17:40:46 +04:00
|
|
|
static jsval sScrollMaxX_id;
|
|
|
|
static jsval sScrollMaxY_id;
|
2002-08-16 01:18:20 +04:00
|
|
|
static jsval sOpen_id;
|
|
|
|
static jsval sItem_id;
|
2004-08-24 05:31:19 +04:00
|
|
|
static jsval sNamedItem_id;
|
2002-08-16 01:18:20 +04:00
|
|
|
static jsval sEnumerate_id;
|
|
|
|
static jsval sNavigator_id;
|
|
|
|
static jsval sDocument_id;
|
|
|
|
static jsval sWindow_id;
|
2003-02-14 04:59:52 +03:00
|
|
|
static jsval sFrames_id;
|
2003-02-27 03:54:49 +03:00
|
|
|
static jsval sSelf_id;
|
2003-07-09 04:48:25 +04:00
|
|
|
static jsval sOpener_id;
|
2004-02-07 14:40:30 +03:00
|
|
|
static jsval sAdd_id;
|
2004-07-23 04:26:02 +04:00
|
|
|
static jsval sAll_id;
|
|
|
|
static jsval sTags_id;
|
2005-04-29 03:48:28 +04:00
|
|
|
static jsval sAddEventListener_id;
|
2006-06-23 20:43:29 +04:00
|
|
|
static jsval sBaseURIObject_id;
|
|
|
|
static jsval sNodePrincipal_id;
|
|
|
|
static jsval sDocumentURIObject_id;
|
2007-07-26 08:14:33 +04:00
|
|
|
static jsval sOncopy_id;
|
|
|
|
static jsval sOncut_id;
|
|
|
|
static jsval sOnpaste_id;
|
2007-10-10 05:24:28 +04:00
|
|
|
static jsval sJava_id;
|
|
|
|
static jsval sPackages_id;
|
2008-07-12 01:28:12 +04:00
|
|
|
#ifdef OJI
|
2007-10-10 05:24:28 +04:00
|
|
|
static jsval sNetscape_id;
|
|
|
|
static jsval sSun_id;
|
|
|
|
static jsval sJavaObject_id;
|
|
|
|
static jsval sJavaClass_id;
|
|
|
|
static jsval sJavaArray_id;
|
|
|
|
static jsval sJavaMember_id;
|
|
|
|
#endif
|
2002-02-13 07:20:46 +03:00
|
|
|
|
2001-07-11 13:09:30 +04:00
|
|
|
static const JSClass *sObjectClass;
|
2005-07-29 19:11:08 +04:00
|
|
|
static const JSClass *sXPCNativeWrapperClass;
|
2002-05-22 04:34:01 +04:00
|
|
|
|
2006-06-05 11:18:02 +04:00
|
|
|
public:
|
2002-05-22 04:34:01 +04:00
|
|
|
static PRBool sDoSecurityCheckInAddProperty;
|
2001-04-01 05:10:59 +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
|
|
|
typedef nsDOMClassInfo nsDOMGenericSH;
|
2001-04-01 05:10:59 +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
|
|
|
// EventProp scriptable helper, this class should be the base class of
|
|
|
|
// all objects that should support things like
|
|
|
|
// obj.onclick=function{...}
|
2001-04-01 05:10:59 +04:00
|
|
|
|
2007-01-05 01:31:26 +03:00
|
|
|
class nsEventReceiverSH : 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:
|
2007-01-05 01:31:26 +03:00
|
|
|
nsEventReceiverSH(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
|
|
|
{
|
|
|
|
}
|
2001-04-01 05:10:59 +04:00
|
|
|
|
2003-05-31 09:39:14 +04:00
|
|
|
virtual ~nsEventReceiverSH()
|
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
|
|
|
|
2002-08-16 01:18:20 +04:00
|
|
|
static PRBool ReallyIsEventName(jsval id, jschar aFirstChar);
|
2001-04-01 05:10:59 +04:00
|
|
|
|
2002-08-16 01:18:20 +04:00
|
|
|
static inline PRBool IsEventName(jsval id)
|
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-08-16 01:18:20 +04:00
|
|
|
NS_ASSERTION(JSVAL_IS_STRING(id), "Don't pass non-string jsval's here!");
|
|
|
|
|
|
|
|
jschar *str = ::JS_GetStringChars(JSVAL_TO_STRING(id));
|
2001-04-01 05:10:59 +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
|
|
|
if (str[0] == 'o' && str[1] == 'n') {
|
2002-08-16 01:18:20 +04:00
|
|
|
return ReallyIsEventName(id, str[2]);
|
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
|
|
|
}
|
|
|
|
|
|
|
|
return PR_FALSE;
|
|
|
|
}
|
|
|
|
|
2008-09-07 02:21:43 +04:00
|
|
|
static JSBool AddEventListenerHelper(JSContext *cx, JSObject *obj,
|
|
|
|
uintN argc, jsval *argv, jsval *rval);
|
2005-04-29 03:48:28 +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
|
|
|
nsresult RegisterCompileHandler(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj, jsval id,
|
2004-11-05 18:28:17 +03:00
|
|
|
PRBool compile, PRBool remove,
|
2005-04-29 03:48:28 +04:00
|
|
|
PRBool *did_define);
|
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 NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, PRUint32 flags,
|
|
|
|
JSObject **objp, PRBool *_retval);
|
|
|
|
NS_IMETHOD SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp,
|
|
|
|
PRBool *_retval);
|
2003-11-18 04:59:51 +03:00
|
|
|
NS_IMETHOD AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
2008-08-14 15:04:43 +04:00
|
|
|
static nsresult DefineAddEventListener(JSContext *cx, JSObject *obj,
|
|
|
|
jsval id, 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
|
|
|
};
|
|
|
|
|
2008-08-14 15:04:43 +04:00
|
|
|
// Adds support for 4th parameter of addEventListener.
|
|
|
|
// Simpler than nsEventReceiverSH
|
2008-09-25 18:40:30 +04:00
|
|
|
// Makes also 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,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
|
|
|
NS_IMETHOD PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj);
|
2008-08-14 15:04:43 +04:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, PRUint32 flags,
|
|
|
|
JSObject **objp, PRBool *_retval);
|
2008-09-25 18:40:30 +04:00
|
|
|
NS_IMETHOD AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
2008-11-13 19:54:52 +03:00
|
|
|
NS_IMETHOD Finalize(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj);
|
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
|
|
|
|
2003-05-31 09:39:14 +04:00
|
|
|
class nsWindowSH : public nsEventReceiverSH
|
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-05-31 09:39:14 +04:00
|
|
|
nsWindowSH(nsDOMClassInfoData* aData) : nsEventReceiverSH(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 ~nsWindowSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2005-08-12 08:11:00 +04:00
|
|
|
static nsresult GlobalResolve(nsGlobalWindow *aWin, 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
|
|
|
JSObject *obj, JSString *str, PRUint32 flags,
|
|
|
|
PRBool *did_resolve);
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
|
|
|
NS_IMETHOD SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
2001-07-13 11:08:26 +04:00
|
|
|
NS_IMETHOD AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
|
|
|
NS_IMETHOD DelProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_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 21:42:36 +04:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, PRUint32 flags,
|
|
|
|
JSObject **objp, PRBool *_retval);
|
2005-09-30 05:18:43 +04:00
|
|
|
NS_IMETHOD NewEnumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 enum_op, jsval *statep,
|
2006-05-19 09:57:36 +04:00
|
|
|
jsid *idp, PRBool *_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 21:42:36 +04:00
|
|
|
NS_IMETHOD Finalize(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj);
|
2005-07-31 00:57:07 +04:00
|
|
|
NS_IMETHOD Equality(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
|
|
|
|
JSObject * obj, jsval val, PRBool *bp);
|
|
|
|
NS_IMETHOD OuterObject(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
|
|
|
|
JSObject * obj, JSObject * *_retval);
|
2005-10-08 04:28:45 +04:00
|
|
|
NS_IMETHOD InnerObject(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
|
|
|
|
JSObject * obj, JSObject * *_retval);
|
2004-08-26 07:49:17 +04:00
|
|
|
|
2008-09-07 02:21:43 +04:00
|
|
|
static JSBool GlobalScopePolluterNewResolve(JSContext *cx, JSObject *obj,
|
|
|
|
jsval id, uintN flags,
|
|
|
|
JSObject **objp);
|
|
|
|
static JSBool GlobalScopePolluterGetProperty(JSContext *cx, JSObject *obj,
|
|
|
|
jsval id, jsval *vp);
|
|
|
|
static JSBool SecurityCheckOnSetProp(JSContext *cx, JSObject *obj, jsval id,
|
|
|
|
jsval *vp);
|
2005-07-31 00:57:07 +04:00
|
|
|
static void InvalidateGlobalScopePolluter(JSContext *cx, JSObject *obj);
|
2004-08-26 07:49:17 +04:00
|
|
|
static nsresult InstallGlobalScopePolluter(JSContext *cx, JSObject *obj,
|
|
|
|
nsIHTMLDocument *doc);
|
2002-04-27 04:03:47 +04:00
|
|
|
|
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 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,
|
|
|
|
JSObject *obj, jsval id, PRUint32 mode,
|
|
|
|
jsval *vp, PRBool *_retval);
|
|
|
|
|
2005-08-23 05:42:49 +04:00
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
|
|
|
|
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
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-07-31 00:57:07 +04: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);
|
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsNavigatorSH(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
|
|
|
// DOM Node helper, this class deals with setting the parent for the
|
|
|
|
// wrappers
|
|
|
|
|
2003-05-31 09:39:14 +04:00
|
|
|
class nsNodeSH : public nsEventReceiverSH
|
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-05-31 09:39:14 +04:00
|
|
|
nsNodeSH(nsDOMClassInfoData* aData) : nsEventReceiverSH(aData)
|
2001-04-01 05:10:59 +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
|
|
|
}
|
2001-04-01 05:10:59 +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
|
|
|
virtual ~nsNodeSH()
|
|
|
|
{
|
|
|
|
}
|
2001-04-01 05:10:59 +04:00
|
|
|
|
2006-06-23 20:43:29 +04:00
|
|
|
// Helper to check whether a capability is enabled
|
|
|
|
PRBool IsCapabilityEnabled(const char* aCapability);
|
|
|
|
|
|
|
|
inline PRBool IsPrivilegedScript() {
|
|
|
|
return IsCapabilityEnabled("UniversalXPConnect");
|
|
|
|
}
|
|
|
|
|
|
|
|
// Helper to define a void property with JSPROP_SHARED; this can do all the
|
|
|
|
// work so it's safe to just return whatever it returns. |obj| is the object
|
|
|
|
// we're defining on, |id| is the name of the prop. This must be a string
|
|
|
|
// jsval. |objp| is the out param if we define successfully.
|
|
|
|
nsresult DefineVoidProp(JSContext* cx, JSObject* obj, jsval id,
|
|
|
|
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
|
|
|
public:
|
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
2008-11-13 19:54:52 +03:00
|
|
|
NS_IMETHOD PostCreate(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 21:42:36 +04:00
|
|
|
NS_IMETHOD AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
2006-06-23 20:43:29 +04:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, PRUint32 flags,
|
|
|
|
JSObject **objp, PRBool *_retval);
|
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
|
|
|
NS_IMETHOD SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
2002-08-29 08:05:39 +04:00
|
|
|
NS_IMETHOD GetFlags(PRUint32 *aFlags);
|
2008-11-13 19:54:52 +03:00
|
|
|
NS_IMETHOD Finalize(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 21:42:36 +04:00
|
|
|
|
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 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 21:42:36 +04:00
|
|
|
}
|
|
|
|
};
|
2001-04-01 05:10:59 +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
|
|
|
// Element helper
|
2001-04-01 05:10:59 +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
|
|
|
class nsElementSH : public nsNodeSH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 05:25:08 +03: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 21:42:36 +04:00
|
|
|
{
|
|
|
|
}
|
2001-04-01 05:10:59 +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
|
|
|
virtual ~nsElementSH()
|
|
|
|
{
|
2001-04-01 05:10:59 +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
|
|
|
public:
|
|
|
|
NS_IMETHOD PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2004-08-26 07:49:17 +04:00
|
|
|
JSObject *obj);
|
2007-09-28 17:45:01 +04:00
|
|
|
NS_IMETHOD Enumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRBool *_retval);
|
2001-04-01 05:10:59 +04:00
|
|
|
|
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 nsElementSH(aData);
|
2001-04-01 05:10:59 +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
|
|
|
};
|
2001-04-01 05:10:59 +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,
|
|
|
|
JSObject *obj, jsval id, PRUint32 flags,
|
|
|
|
JSObject **objp, PRBool *_retval);
|
2003-10-16 04:44:20 +04:00
|
|
|
NS_IMETHOD Enumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRBool *_retval);
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
virtual nsresult GetLength(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 *length);
|
|
|
|
|
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.
|
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
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,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
private:
|
|
|
|
// Not implemented, nothing should create an instance of this class.
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// NodeList scriptable helper
|
|
|
|
|
|
|
|
class nsNodeListSH : public nsArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsNodeListSH(nsDOMClassInfoData* aData) : nsArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
2008-11-13 19:54:52 +03:00
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
|
|
|
NS_IMETHOD PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj);
|
|
|
|
NS_IMETHOD Finalize(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj);
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
virtual nsresult GetLength(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 *length);
|
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
nsresult *aResult);
|
|
|
|
|
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
|
|
|
{
|
2008-10-22 18:31:14 +04:00
|
|
|
return new nsNodeListSH(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
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// NamedArray helper
|
|
|
|
|
|
|
|
class nsNamedArraySH : public nsArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 05:25:08 +03: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 21:42:36 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsNamedArraySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
virtual nsISupports* GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
|
|
|
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,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
2008-10-22 18:31:14 +04: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 21:42:36 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// NamedNodeMap helper
|
|
|
|
|
|
|
|
class nsNamedNodeMapSH : public nsNamedArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 05:25:08 +03: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 21:42:36 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsNamedNodeMapSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
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 21:42:36 +04:00
|
|
|
|
|
|
|
// Override nsNamedArraySH::GetNamedItem()
|
2008-11-01 00:40:35 +03:00
|
|
|
virtual nsISupports* GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
|
|
|
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 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 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 21:42:36 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// HTMLCollection helper
|
|
|
|
|
|
|
|
class nsHTMLCollectionSH : public nsNamedArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 05:25:08 +03:00
|
|
|
nsHTMLCollectionSH(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 21:42:36 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsHTMLCollectionSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
virtual nsresult GetLength(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 *length);
|
2008-10-22 18:31:14 +04:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
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 21:42:36 +04:00
|
|
|
|
|
|
|
// Override nsNamedArraySH::GetNamedItem()
|
2008-11-01 00:40:35 +03:00
|
|
|
virtual nsISupports* GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
|
|
|
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 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 nsHTMLCollectionSH(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-07-09 04:44:20 +04:00
|
|
|
// ContentList helper
|
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
class nsContentListSH : public nsNamedArraySH
|
2002-07-09 04:44:20 +04:00
|
|
|
{
|
|
|
|
protected:
|
2008-11-01 00:40:35 +03:00
|
|
|
nsContentListSH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
|
2002-07-09 04:44:20 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
2008-11-13 19:54:52 +03:00
|
|
|
NS_IMETHOD PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj);
|
|
|
|
NS_IMETHOD Finalize(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj);
|
2008-11-01 00:40:35 +03:00
|
|
|
|
|
|
|
virtual nsresult GetLength(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 *length);
|
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
nsresult *aResult);
|
|
|
|
virtual nsISupports* GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
|
|
|
nsresult *aResult);
|
2002-07-09 04:44:20 +04:00
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsContentListSH(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
|
|
|
// Document helper, for document.location and document.on*
|
|
|
|
|
|
|
|
class nsDocumentSH : public nsNodeSH
|
|
|
|
{
|
|
|
|
public:
|
2002-03-04 05:25:08 +03: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 21:42:36 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsDocumentSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
2002-05-22 04:34:01 +04:00
|
|
|
NS_IMETHOD AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
|
|
|
NS_IMETHOD DelProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_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 21:42:36 +04:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, PRUint32 flags,
|
|
|
|
JSObject **objp, PRBool *_retval);
|
2002-07-24 10:02:05 +04:00
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_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 21:42:36 +04:00
|
|
|
NS_IMETHOD SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
2002-08-29 08:05:39 +04:00
|
|
|
NS_IMETHOD GetFlags(PRUint32* aFlags);
|
2005-07-28 20:15:00 +04:00
|
|
|
NS_IMETHOD PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj);
|
2007-12-04 06:49:33 +03:00
|
|
|
NS_IMETHOD Finalize(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 21:42:36 +04:00
|
|
|
|
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 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 21:42:36 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// HTMLDocument helper
|
|
|
|
|
|
|
|
class nsHTMLDocumentSH : public nsDocumentSH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 05:25:08 +03: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 21:42:36 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsHTMLDocumentSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2002-02-05 09:44:04 +03:00
|
|
|
static nsresult ResolveImpl(JSContext *cx,
|
|
|
|
nsIXPConnectWrappedNative *wrapper, jsval id,
|
2001-12-20 13:16:25 +03:00
|
|
|
nsISupports **result);
|
2008-09-07 02:21:43 +04:00
|
|
|
static JSBool DocumentOpen(JSContext *cx, JSObject *obj, uintN argc,
|
|
|
|
jsval *argv, jsval *rval);
|
2004-08-24 05:31:19 +04:00
|
|
|
static JSBool GetDocumentAllNodeList(JSContext *cx, JSObject *obj,
|
|
|
|
nsIDOMDocument *doc,
|
|
|
|
nsIDOMNodeList **nodeList);
|
2001-05-21 16:37:38 +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
|
|
|
public:
|
2008-09-07 02:21:43 +04:00
|
|
|
static JSBool DocumentAllGetProperty(JSContext *cx, JSObject *obj, jsval id,
|
|
|
|
jsval *vp);
|
|
|
|
static JSBool DocumentAllNewResolve(JSContext *cx, JSObject *obj, jsval id,
|
|
|
|
uintN flags, JSObject **objp);
|
|
|
|
static void ReleaseDocument(JSContext *cx, JSObject *obj);
|
|
|
|
static JSBool CallToGetPropMapper(JSContext *cx, JSObject *obj, uintN argc,
|
|
|
|
jsval *argv, jsval *rval);
|
|
|
|
static JSBool DocumentAllHelperGetProperty(JSContext *cx, JSObject *obj,
|
|
|
|
jsval id, jsval *vp);
|
|
|
|
static JSBool DocumentAllHelperNewResolve(JSContext *cx, JSObject *obj,
|
|
|
|
jsval id, uintN flags,
|
|
|
|
JSObject **objp);
|
|
|
|
static JSBool DocumentAllTagsNewResolve(JSContext *cx, JSObject *obj,
|
|
|
|
jsval id, uintN flags,
|
|
|
|
JSObject **objp);
|
2004-07-23 04:26:02 +04:00
|
|
|
|
2001-05-21 16:37:38 +04:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, PRUint32 flags,
|
|
|
|
JSObject **objp, PRBool *_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 21:42:36 +04:00
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
|
|
|
|
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 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 21:42:36 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2001-10-17 05:17:47 +04:00
|
|
|
// HTMLElement helper
|
|
|
|
|
|
|
|
class nsHTMLElementSH : public nsElementSH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 05:25:08 +03:00
|
|
|
nsHTMLElementSH(nsDOMClassInfoData* aData) : nsElementSH(aData)
|
2001-10-17 05:17:47 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsHTMLElementSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-09-07 02:21:43 +04:00
|
|
|
static JSBool ScrollIntoView(JSContext *cx, JSObject *obj, uintN argc,
|
|
|
|
jsval *argv, jsval *rval);
|
2001-10-17 05:17:47 +04:00
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, PRUint32 flags,
|
|
|
|
JSObject **objp, PRBool *_retval);
|
|
|
|
|
2002-03-04 05:25:08 +03:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
2001-10-17 05:17:47 +04:00
|
|
|
{
|
2002-03-04 05:25:08 +03:00
|
|
|
return new nsHTMLElementSH(aData);
|
2001-10-17 05:17:47 +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
|
|
|
// HTMLFormElement helper
|
|
|
|
|
2001-10-17 05:17:47 +04:00
|
|
|
class nsHTMLFormElementSH : public nsHTMLElementSH
|
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:
|
2002-03-04 05:25:08 +03:00
|
|
|
nsHTMLFormElementSH(nsDOMClassInfoData* aData) : nsHTMLElementSH(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 ~nsHTMLFormElementSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2001-05-12 09:26:07 +04:00
|
|
|
static nsresult FindNamedItem(nsIForm *aForm, JSString *str,
|
|
|
|
nsISupports **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 21:42:36 +04:00
|
|
|
public:
|
2001-05-12 09:26:07 +04:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, PRUint32 flags,
|
|
|
|
JSObject **objp, PRBool *_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 21:42:36 +04:00
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp,
|
|
|
|
PRBool *_retval);
|
|
|
|
|
2002-03-13 05:56:40 +03:00
|
|
|
NS_IMETHOD NewEnumerate(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj,
|
|
|
|
PRUint32 enum_op, jsval *statep,
|
|
|
|
jsid *idp, PRBool *_retval);
|
|
|
|
|
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 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 21:42:36 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2001-05-12 09:26:07 +04:00
|
|
|
// HTMLSelectElement helper
|
|
|
|
|
2001-10-17 05:17:47 +04:00
|
|
|
class nsHTMLSelectElementSH : public nsHTMLElementSH
|
2001-05-12 09:26:07 +04:00
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 05:25:08 +03:00
|
|
|
nsHTMLSelectElementSH(nsDOMClassInfoData* aData) : nsHTMLElementSH(aData)
|
2001-05-12 09:26:07 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsHTMLSelectElementSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp,
|
|
|
|
PRBool *_retval);
|
|
|
|
NS_IMETHOD SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
|
|
|
|
|
|
|
static nsresult SetOption(JSContext *cx, jsval *vp, PRUint32 aIndex,
|
|
|
|
nsIDOMNSHTMLOptionCollection *aOptCollection);
|
|
|
|
|
2002-03-04 05:25:08 +03:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
2001-05-12 09:26:07 +04:00
|
|
|
{
|
2002-03-04 05:25:08 +03:00
|
|
|
return new nsHTMLSelectElementSH(aData);
|
2001-05-12 09:26:07 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-08-29 04:28:32 +04: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 21:42:36 +04:00
|
|
|
|
2007-08-29 04:28:32 +04:00
|
|
|
class nsHTMLPluginObjElementSH : public nsHTMLElementSH
|
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-08-29 04:28:32 +04:00
|
|
|
nsHTMLPluginObjElementSH(nsDOMClassInfoData* aData)
|
|
|
|
: nsHTMLElementSH(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
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-08-29 04:28:32 +04: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 21:42:36 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-03-15 02:08:57 +03:00
|
|
|
static nsresult GetPluginInstanceIfSafe(nsIXPConnectWrappedNative *aWrapper,
|
|
|
|
nsIPluginInstance **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 21:42:36 +04:00
|
|
|
|
2007-08-29 04:28:32 +04:00
|
|
|
static nsresult GetPluginJSObject(JSContext *cx, JSObject *obj,
|
|
|
|
nsIPluginInstance *plugin_inst,
|
|
|
|
JSObject **plugin_obj,
|
|
|
|
JSObject **plugin_proto);
|
|
|
|
|
|
|
|
static nsresult GetJavaPluginJSObject(JSContext *cx, JSObject *obj,
|
|
|
|
nsIPluginInstance *plugin_inst,
|
|
|
|
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 21:42:36 +04:00
|
|
|
|
|
|
|
public:
|
2007-08-29 04:28:32 +04:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, PRUint32 flags,
|
|
|
|
JSObject **objp, PRBool *_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 21:42:36 +04:00
|
|
|
NS_IMETHOD PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj);
|
2004-10-28 05:54:21 +04:00
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
2004-04-02 09:11:44 +04:00
|
|
|
NS_IMETHOD SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
2004-08-30 08:31:16 +04:00
|
|
|
NS_IMETHOD Call(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 argc, jsval *argv, jsval *vp,
|
|
|
|
PRBool *_retval);
|
2001-10-10 08:04:21 +04:00
|
|
|
|
2008-03-15 02:08:57 +03:00
|
|
|
|
|
|
|
static nsresult SetupProtoChain(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, 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
|
|
|
{
|
2002-03-04 05:25:08 +03: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 21:42:36 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2003-03-14 10:00:53 +03:00
|
|
|
// HTMLOptionsCollection 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-03-14 10:00:53 +03:00
|
|
|
class nsHTMLOptionsCollectionSH : public nsHTMLCollectionSH
|
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-03-14 10:00:53 +03:00
|
|
|
nsHTMLOptionsCollectionSH(nsDOMClassInfoData* aData)
|
|
|
|
: nsHTMLCollectionSH(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-03-14 10:00:53 +03:00
|
|
|
virtual ~nsHTMLOptionsCollectionSH()
|
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-09-07 02:21:43 +04:00
|
|
|
static JSBool Add(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|
|
|
jsval *rval);
|
2004-02-07 14:40:30 +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
|
|
|
public:
|
|
|
|
NS_IMETHOD SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
2004-02-07 14:40:30 +03:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, PRUint32 flags,
|
|
|
|
JSObject **objp, PRBool *_retval);
|
|
|
|
|
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
|
|
|
{
|
2003-03-14 10:00:53 +03:00
|
|
|
return new nsHTMLOptionsCollectionSH(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
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Plugin helper
|
|
|
|
|
|
|
|
class nsPluginSH : public nsNamedArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 05:25:08 +03: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 21:42:36 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsPluginSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
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 21:42:36 +04:00
|
|
|
|
|
|
|
// Override nsNamedArraySH::GetNamedItem()
|
2008-11-01 00:40:35 +03:00
|
|
|
virtual nsISupports* GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
|
|
|
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 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 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 21:42:36 +04:00
|
|
|
}
|
|
|
|
};
|
2001-04-01 05:10:59 +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
|
|
|
// PluginArray helper
|
2001-04-01 05:10:59 +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
|
|
|
class nsPluginArraySH : public nsNamedArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 05:25:08 +03: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 21:42:36 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsPluginArraySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
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 21:42:36 +04:00
|
|
|
|
|
|
|
// Override nsNamedArraySH::GetNamedItem()
|
2008-11-01 00:40:35 +03:00
|
|
|
virtual nsISupports* GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
|
|
|
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 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 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 21:42:36 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// MimeTypeArray helper
|
|
|
|
|
|
|
|
class nsMimeTypeArraySH : public nsNamedArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 05:25:08 +03: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 21:42:36 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsMimeTypeArraySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
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 21:42:36 +04:00
|
|
|
|
|
|
|
// Override nsNamedArraySH::GetNamedItem()
|
2008-11-01 00:40:35 +03:00
|
|
|
virtual nsISupports* GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
|
|
|
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 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 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 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()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual nsresult GetStringAt(nsISupports *aNative, PRInt32 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,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// History helper
|
|
|
|
|
|
|
|
class nsHistorySH : public nsStringArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 05:25:08 +03: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 21:42:36 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsHistorySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual nsresult GetStringAt(nsISupports *aNative, PRInt32 aIndex,
|
2002-03-24 03:16:18 +03: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 21:42:36 +04:00
|
|
|
|
|
|
|
public:
|
2001-08-31 06:36:45 +04:00
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
|
|
|
|
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 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 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()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual nsresult GetStringAt(nsISupports *aNative, PRInt32 aIndex,
|
|
|
|
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 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()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual nsresult GetStringAt(nsISupports *aNative, PRInt32 aIndex,
|
2002-03-24 03:16:18 +03: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 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()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
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 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
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2002-07-08 11:11:59 +04:00
|
|
|
// CSSValueList helper
|
|
|
|
|
|
|
|
class nsCSSValueListSH : public nsArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsCSSValueListSH(nsDOMClassInfoData* aData) : nsArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsCSSValueListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
nsresult *aResult);
|
2002-07-08 11:11:59 +04:00
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsCSSValueListSH(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
|
|
|
// CSSStyleDeclaration helper
|
|
|
|
|
|
|
|
class nsCSSStyleDeclSH : public nsStringArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 05:25:08 +03:00
|
|
|
nsCSSStyleDeclSH(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 ~nsCSSStyleDeclSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual nsresult GetStringAt(nsISupports *aNative, PRInt32 aIndex,
|
2002-03-24 03:16:18 +03: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 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 nsCSSStyleDeclSH(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()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
nsresult *aResult);
|
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
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2008-03-12 03:59:15 +03:00
|
|
|
// ClientRectList helper
|
2007-05-31 02:32:54 +04:00
|
|
|
|
2008-03-12 03:59:15 +03:00
|
|
|
class nsClientRectListSH : public nsArraySH
|
2007-05-31 02:32:54 +04:00
|
|
|
{
|
|
|
|
protected:
|
2008-03-12 03:59:15 +03:00
|
|
|
nsClientRectListSH(nsDOMClassInfoData* aData) : nsArraySH(aData)
|
2007-05-31 02:32:54 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-03-12 03:59:15 +03:00
|
|
|
virtual ~nsClientRectListSH()
|
2007-05-31 02:32:54 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
nsresult *aResult);
|
2007-05-31 02:32:54 +04:00
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
2008-03-12 03:59:15 +03:00
|
|
|
return new nsClientRectListSH(aData);
|
2007-05-31 02:32:54 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2001-05-14 02:16:45 +04:00
|
|
|
|
2004-04-17 09:53:38 +04:00
|
|
|
#ifdef MOZ_XUL
|
|
|
|
// TreeColumns helper
|
|
|
|
|
|
|
|
class nsTreeColumnsSH : public nsNamedArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsTreeColumnsSH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsTreeColumnsSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
nsresult *aResult);
|
2004-04-17 09:53:38 +04:00
|
|
|
|
|
|
|
// Override nsNamedArraySH::GetNamedItem()
|
2008-11-01 00:40:35 +03:00
|
|
|
virtual nsISupports* GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
|
|
|
nsresult *aResult);
|
2004-04-17 09:53:38 +04:00
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsTreeColumnsSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2006-05-19 09:57:36 +04:00
|
|
|
// WebApps Storage helpers
|
|
|
|
|
|
|
|
class nsStorageSH : public nsNamedArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsStorageSH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsStorageSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, PRUint32 flags,
|
|
|
|
JSObject **objp, PRBool *_retval);
|
|
|
|
NS_IMETHOD SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
|
|
|
NS_IMETHOD DelProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
|
|
|
NS_IMETHOD NewEnumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 enum_op, jsval *statep,
|
|
|
|
jsid *idp, PRBool *_retval);
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
nsresult *aResult)
|
|
|
|
{
|
|
|
|
return nsnull;
|
|
|
|
}
|
2006-05-19 09:57:36 +04:00
|
|
|
// Override nsNamedArraySH::GetNamedItem()
|
2008-11-01 00:40:35 +03:00
|
|
|
virtual nsISupports* GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
|
|
|
nsresult *aResult);
|
2006-05-19 09:57:36 +04:00
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsStorageSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class nsStorageListSH : public nsNamedArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsStorageListSH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsStorageListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
nsresult *aResult)
|
|
|
|
{
|
|
|
|
return nsnull;
|
|
|
|
}
|
2006-05-19 09:57:36 +04:00
|
|
|
// Override nsNamedArraySH::GetNamedItem()
|
2008-11-01 00:40:35 +03:00
|
|
|
virtual nsISupports* GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
|
|
|
nsresult *aResult);
|
2006-05-19 09:57:36 +04:00
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsStorageListSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2004-04-17 09:53:38 +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
|
|
|
// 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:
|
2007-05-09 16:04:59 +04:00
|
|
|
NS_IMETHOD Call(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 argc, jsval *argv, jsval *vp,
|
|
|
|
PRBool *_retval);
|
|
|
|
|
2005-12-09 22:08:45 +03:00
|
|
|
NS_IMETHOD Construct(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 argc, jsval *argv,
|
|
|
|
jsval *vp, PRBool *_retval);
|
|
|
|
|
|
|
|
NS_IMETHOD HasInstance(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval val, PRBool *bp,
|
|
|
|
PRBool *_retval);
|
|
|
|
|
|
|
|
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:
|
|
|
|
NS_IMETHOD GetFlags(PRUint32 *aFlags);
|
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsNonDOMObjectSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2006-06-06 19:42:41 +04:00
|
|
|
// Need this to override GetFlags() on nsNodeSH
|
|
|
|
class nsAttributeSH : public nsNodeSH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsAttributeSH(nsDOMClassInfoData* aData) : nsNodeSH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsAttributeSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD GetFlags(PRUint32 *aFlags);
|
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsAttributeSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2007-05-29 13:45:30 +04:00
|
|
|
class nsOfflineResourceListSH : public nsStringArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsOfflineResourceListSH(nsDOMClassInfoData* aData) : nsStringArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsOfflineResourceListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual nsresult GetStringAt(nsISupports *aNative, PRInt32 aIndex,
|
|
|
|
nsAString& aResult);
|
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsOfflineResourceListSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2007-07-25 08:29:47 +04:00
|
|
|
class nsFileListSH : public nsArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsFileListSH(nsDOMClassInfoData *aData) : nsArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsFileListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
nsresult *aResult);
|
2007-07-25 08:29:47 +04:00
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsFileListSH(aData);
|
|
|
|
}
|
|
|
|
};
|
2007-05-29 13:45:30 +04:00
|
|
|
|
2001-04-01 05:10:59 +04:00
|
|
|
#endif /* nsDOMClassInfo_h___ */
|