Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2001-09-25 22:43:09 +00:00
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
2001-04-01 01:10:59 +00:00
|
|
|
*
|
2001-09-25 22:43:09 +00:00
|
|
|
* The contents of this file are subject to the Netscape 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/NPL/
|
|
|
|
*
|
|
|
|
* 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 01:10:59 +00:00
|
|
|
*
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
* The Original Code is mozilla.org code.
|
2001-04-01 01:10:59 +00:00
|
|
|
*
|
2001-09-25 22:43:09 +00:00
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2000
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
2001-04-01 01:10:59 +00:00
|
|
|
*
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
* Contributor(s):
|
|
|
|
* Johnny Stenback <jst@netscape.com> (original author)
|
2001-09-25 22:43:09 +00:00
|
|
|
*
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either 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"),
|
|
|
|
* 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
|
|
|
|
* use your version of this file under the terms of the NPL, indicate your
|
|
|
|
* 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
|
|
|
|
* the terms of any one of the NPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** 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 17:42:36 +00:00
|
|
|
|
2001-04-01 01:10:59 +00:00
|
|
|
#ifndef nsDOMClassInfo_h___
|
|
|
|
#define nsDOMClassInfo_h___
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
#include "nsIDOMClassInfo.h"
|
|
|
|
#include "nsIXPCScriptable.h"
|
|
|
|
#include "jsapi.h"
|
|
|
|
#include "nsIScriptSecurityManager.h"
|
|
|
|
|
2001-05-12 05:26:07 +00: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 17:42:36 +00:00
|
|
|
class nsIPluginInstance;
|
2001-05-12 05:26:07 +00:00
|
|
|
class nsIForm;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2002-03-04 02:25:08 +00:00
|
|
|
struct nsDOMClassInfoData;
|
|
|
|
|
|
|
|
typedef nsIClassInfo* (*nsDOMClassInfoConstructorFnc)
|
|
|
|
(nsDOMClassInfoData* aData);
|
|
|
|
|
|
|
|
|
|
|
|
struct nsDOMClassInfoData
|
|
|
|
{
|
|
|
|
const char *mName;
|
|
|
|
union {
|
|
|
|
nsDOMClassInfoConstructorFnc mConstructorFptr;
|
|
|
|
nsDOMClassInfoExternalConstructorFnc mExternalConstructorFptr;
|
2002-03-04 03:37:18 +00:00
|
|
|
} u;
|
2002-03-04 02:25:08 +00:00
|
|
|
nsIClassInfo *mCachedClassInfo; // low bit is set to 1 if external,
|
|
|
|
// so be sure to mask if necessary!
|
|
|
|
const nsIID *mProtoChainInterface;
|
|
|
|
const nsIID **mInterfaces;
|
|
|
|
PRUint32 mScriptableFlags : 31; // flags must not use more than 31 bits!
|
|
|
|
PRBool mHasClassInterface : 1;
|
|
|
|
#ifdef NS_DEBUG
|
|
|
|
PRUint32 mDebugID;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
struct nsExternalDOMClassInfoData : public nsDOMClassInfoData
|
|
|
|
{
|
|
|
|
const nsCID *mConstructorCID;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
typedef unsigned long PtrBits;
|
|
|
|
|
|
|
|
// 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 01:10:59 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
class nsDOMClassInfo : public nsIXPCScriptable,
|
|
|
|
public nsIClassInfo
|
2001-04-01 01:10:59 +00:00
|
|
|
{
|
|
|
|
public:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsDOMClassInfo(nsDOMClassInfoData* aData);
|
2001-04-01 01:10:59 +00:00
|
|
|
virtual ~nsDOMClassInfo();
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_DECL_NSIXPCSCRIPTABLE
|
|
|
|
|
2001-04-01 01:10:59 +00:00
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
NS_DECL_NSICLASSINFO
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
// Helper method that returns a *non* refcounted pointer to a
|
|
|
|
// helper. So please note, don't release this pointer, if you do,
|
|
|
|
// you better make sure you've addreffed before release.
|
|
|
|
//
|
|
|
|
// Whaaaaa! I wanted to name this method GetClassInfo, but nooo,
|
|
|
|
// some of Microsoft devstudio's headers #defines GetClassInfo to
|
|
|
|
// GetClassInfoA so I can't, those $%#@^! bastards!!! What gives
|
|
|
|
// them the right to do that?
|
|
|
|
|
2001-07-11 09:09:30 +00:00
|
|
|
static nsIClassInfo* GetClassInfoInstance(nsDOMClassInfoID aID);
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo* GetClassInfoInstance(nsDOMClassInfoData* aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
|
|
|
static void ShutDown();
|
|
|
|
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsDOMClassInfo(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static nsresult WrapNative(JSContext *cx, JSObject *scope,
|
|
|
|
nsISupports *native, const nsIID& aIID,
|
|
|
|
jsval *vp);
|
2002-02-07 10:50:42 +00: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 17:42:36 +00:00
|
|
|
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
const nsDOMClassInfoData* mData;
|
2001-07-11 09:09:30 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
static nsresult Init();
|
2001-07-11 09:09:30 +00:00
|
|
|
static nsresult RegisterClassName(PRInt32 aDOMClassInfoID);
|
|
|
|
static nsresult RegisterClassProtos(PRInt32 aDOMClassInfoID);
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsresult RegisterExternalClasses();
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2001-06-28 04:26:29 +00:00
|
|
|
// Checks if id is a number and returns the number, if aIsNumber is
|
|
|
|
// non-null it's set to true if the id is a number and false if it's
|
|
|
|
// not a number. If id is not a number this method returns -1
|
|
|
|
static PRInt32 GetArrayIndexFromId(JSContext *cx, jsval id,
|
|
|
|
PRBool *aIsNumber = nsnull);
|
|
|
|
|
2001-11-18 12:05:57 +00:00
|
|
|
static inline PRBool IsReadonlyReplaceable(JSString *str)
|
2001-11-18 06:45:10 +00:00
|
|
|
{
|
|
|
|
return (str == sTop_id ||
|
|
|
|
str == sScrollbars_id ||
|
|
|
|
str == sContent_id ||
|
|
|
|
str == sSidebar_id ||
|
|
|
|
str == sMenubar_id ||
|
|
|
|
str == sToolbar_id ||
|
|
|
|
str == sLocationbar_id ||
|
|
|
|
str == sPersonalbar_id ||
|
|
|
|
str == sStatusbar_id ||
|
|
|
|
str == sDirectories_id ||
|
|
|
|
str == sControllers_id ||
|
|
|
|
str == sLength_id);
|
|
|
|
}
|
|
|
|
|
2001-11-18 12:05:57 +00:00
|
|
|
static inline PRBool IsWritableReplaceable(JSString *str)
|
2001-11-18 06:45:10 +00:00
|
|
|
{
|
|
|
|
return (str == sInnerHeight_id ||
|
|
|
|
str == sInnerWidth_id ||
|
|
|
|
str == sOuterHeight_id ||
|
|
|
|
str == sOuterWidth_id ||
|
|
|
|
str == sScreenX_id ||
|
|
|
|
str == sScreenY_id ||
|
|
|
|
str == sStatus_id ||
|
|
|
|
str == sName_id);
|
|
|
|
}
|
|
|
|
|
2001-07-11 09:09:30 +00:00
|
|
|
static JSClass sDOMConstructorProtoClass;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
|
|
|
static nsIXPConnect *sXPConnect;
|
|
|
|
static nsIScriptSecurityManager *sSecMan;
|
|
|
|
|
|
|
|
// nsIXPCScriptable code
|
|
|
|
static nsresult DefineStaticJSStrings(JSContext *cx);
|
|
|
|
|
|
|
|
static PRBool sIsInitialized;
|
|
|
|
|
|
|
|
static JSString *sTop_id;
|
|
|
|
static JSString *sScrollbars_id;
|
|
|
|
static JSString *sLocation_id;
|
|
|
|
static JSString *sComponents_id;
|
|
|
|
static JSString *s_content_id;
|
|
|
|
static JSString *sContent_id;
|
|
|
|
static JSString *sSidebar_id;
|
|
|
|
static JSString *sMenubar_id;
|
|
|
|
static JSString *sToolbar_id;
|
|
|
|
static JSString *sLocationbar_id;
|
|
|
|
static JSString *sPersonalbar_id;
|
|
|
|
static JSString *sStatusbar_id;
|
|
|
|
static JSString *sDirectories_id;
|
|
|
|
static JSString *sControllers_id;
|
|
|
|
static JSString *sLength_id;
|
2001-11-18 06:45:10 +00:00
|
|
|
static JSString *sInnerHeight_id;
|
|
|
|
static JSString *sInnerWidth_id;
|
|
|
|
static JSString *sOuterHeight_id;
|
|
|
|
static JSString *sOuterWidth_id;
|
|
|
|
static JSString *sScreenX_id;
|
|
|
|
static JSString *sScreenY_id;
|
|
|
|
static JSString *sStatus_id;
|
|
|
|
static JSString *sName_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 17:42:36 +00:00
|
|
|
static JSString *sOnmousedown_id;
|
|
|
|
static JSString *sOnmouseup_id;
|
|
|
|
static JSString *sOnclick_id;
|
|
|
|
static JSString *sOncontextmenu_id;
|
|
|
|
static JSString *sOnmouseover_id;
|
|
|
|
static JSString *sOnmouseout_id;
|
|
|
|
static JSString *sOnkeydown_id;
|
|
|
|
static JSString *sOnkeyup_id;
|
|
|
|
static JSString *sOnkeypress_id;
|
|
|
|
static JSString *sOnmousemove_id;
|
|
|
|
static JSString *sOnfocus_id;
|
|
|
|
static JSString *sOnblur_id;
|
|
|
|
static JSString *sOnsubmit_id;
|
|
|
|
static JSString *sOnreset_id;
|
|
|
|
static JSString *sOnchange_id;
|
|
|
|
static JSString *sOnselect_id;
|
|
|
|
static JSString *sOnload_id;
|
|
|
|
static JSString *sOnunload_id;
|
|
|
|
static JSString *sOnabort_id;
|
|
|
|
static JSString *sOnerror_id;
|
|
|
|
static JSString *sOnpaint_id;
|
|
|
|
static JSString *sOnresize_id;
|
|
|
|
static JSString *sOnscroll_id;
|
2001-10-17 01:17:47 +00:00
|
|
|
static JSString *sScrollIntoView_id;
|
2001-12-20 10:16:25 +00:00
|
|
|
static JSString *sOpen_id;
|
2002-02-13 04:20:46 +00:00
|
|
|
static JSString *sItem_id;
|
|
|
|
static JSString *sEnumerate_id;
|
|
|
|
|
2001-07-11 09:09:30 +00:00
|
|
|
|
|
|
|
static const JSClass *sObjectClass;
|
2001-04-01 01:10:59 +00:00
|
|
|
};
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
typedef nsDOMClassInfo nsDOMGenericSH;
|
2001-04-01 01:10:59 +00:00
|
|
|
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
// EventProp scriptable helper, this class should be the base class of
|
|
|
|
// all objects that should support things like
|
|
|
|
// obj.onclick=function{...}
|
2001-04-01 01:10:59 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
class nsEventRecieverSH : public nsDOMGenericSH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsEventRecieverSH(nsDOMClassInfoData* aData) : nsDOMGenericSH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
2001-04-01 01:10:59 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
virtual ~nsEventRecieverSH()
|
|
|
|
{
|
|
|
|
}
|
2001-04-01 01:10:59 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
static PRBool ReallyIsEventName(JSString *jsstr, jschar aFirstChar);
|
2001-04-01 01:10:59 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
static inline PRBool IsEventName(JSString *jsstr)
|
|
|
|
{
|
|
|
|
jschar *str = ::JS_GetStringChars(jsstr);
|
2001-04-01 01:10:59 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
if (str[0] == 'o' && str[1] == 'n') {
|
|
|
|
return ReallyIsEventName(jsstr, str[2]);
|
|
|
|
}
|
|
|
|
|
|
|
|
return PR_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult RegisterCompileHandler(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj, jsval id,
|
|
|
|
PRBool compile, PRBool *did_compile);
|
|
|
|
|
|
|
|
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);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2001-11-20 23:15:32 +00:00
|
|
|
// Window scriptable helper
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
|
|
|
class nsWindowSH : public nsEventRecieverSH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsWindowSH(nsDOMClassInfoData* aData) : nsEventRecieverSH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsWindowSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static nsresult GlobalResolve(nsISupports *aNative, JSContext *cx,
|
|
|
|
JSObject *obj, JSString *str, PRUint32 flags,
|
|
|
|
PRBool *did_resolve);
|
|
|
|
static nsresult DefineInterfaceProperty(JSContext *cx, JSObject *obj,
|
|
|
|
JSString *str);
|
|
|
|
|
2001-11-20 23:15:32 +00:00
|
|
|
nsresult doCheckPropertyAccess(JSContext *cx, JSObject *obj, jsval id,
|
|
|
|
nsIXPConnectWrappedNative *wrapper,
|
|
|
|
PRUint32 accessMode);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
|
|
|
NS_IMETHOD 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 07:08:26 +00: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 17:42:36 +00:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, PRUint32 flags,
|
|
|
|
JSObject **objp, PRBool *_retval);
|
|
|
|
NS_IMETHOD Finalize(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj);
|
|
|
|
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsWindowSH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
2001-12-11 21:07:36 +00:00
|
|
|
|
|
|
|
static PRBool sDoSecurityCheckInAddProperty;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// DOM Node helper, this class deals with setting the parent for the
|
|
|
|
// wrappers
|
|
|
|
|
|
|
|
class nsNodeSH : public nsEventRecieverSH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsNodeSH(nsDOMClassInfoData* aData) : nsEventRecieverSH(aData)
|
2001-04-01 01:10:59 +00:00
|
|
|
{
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
2001-04-01 01:10:59 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
virtual ~nsNodeSH()
|
|
|
|
{
|
|
|
|
}
|
2001-04-01 01:10:59 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
public:
|
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
|
|
|
NS_IMETHOD AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
|
|
|
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsNodeSH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
2001-04-01 01:10:59 +00:00
|
|
|
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
// Element helper
|
2001-04-01 01:10:59 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
class nsElementSH : public nsNodeSH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsElementSH(nsDOMClassInfoData* aData) : nsNodeSH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
2001-04-01 01:10:59 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
virtual ~nsElementSH()
|
|
|
|
{
|
2001-04-01 01:10:59 +00:00
|
|
|
}
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
public:
|
|
|
|
NS_IMETHOD PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj);
|
2001-04-01 01:10:59 +00:00
|
|
|
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsElementSH(aData);
|
2001-04-01 01:10:59 +00:00
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
};
|
2001-04-01 01:10:59 +00:00
|
|
|
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
// NodeList scriptable helper
|
|
|
|
|
|
|
|
class nsArraySH : public nsDOMClassInfo
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsArraySH(nsDOMClassInfoData* aData) : nsDOMClassInfo(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsArraySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual nsresult GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
nsISupports **aResult);
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
|
|
|
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsArraySH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// NamedArray helper
|
|
|
|
|
|
|
|
class nsNamedArraySH : public nsArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsNamedArraySH(nsDOMClassInfoData* aData) : nsArraySH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsNamedArraySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual nsresult GetNamedItem(nsISupports *aNative, nsAReadableString& aName,
|
|
|
|
nsISupports **aResult) = 0;
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// NamedNodeMap helper
|
|
|
|
|
|
|
|
class nsNamedNodeMapSH : public nsNamedArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsNamedNodeMapSH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsNamedNodeMapSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// Override nsArraySH::GetItemAt() since our list isn't a
|
|
|
|
// nsIDOMNodeList
|
|
|
|
virtual nsresult GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
nsISupports **aResult);
|
|
|
|
|
|
|
|
// Override nsNamedArraySH::GetNamedItem()
|
|
|
|
virtual nsresult GetNamedItem(nsISupports *aNative, nsAReadableString& aName,
|
|
|
|
nsISupports **aResult);
|
|
|
|
|
|
|
|
public:
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsNamedNodeMapSH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// HTMLCollection helper
|
|
|
|
|
|
|
|
class nsHTMLCollectionSH : public nsNamedArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00: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 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsHTMLCollectionSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// Override nsArraySH::GetItemAt() since our list isn't a
|
|
|
|
// nsIDOMNodeList
|
|
|
|
virtual nsresult GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
nsISupports **aResult);
|
|
|
|
|
|
|
|
// Override nsNamedArraySH::GetNamedItem()
|
|
|
|
virtual nsresult GetNamedItem(nsISupports *aNative, nsAReadableString& aName,
|
|
|
|
nsISupports **aResult);
|
|
|
|
|
|
|
|
public:
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new 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 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// FomrControlList helper
|
|
|
|
|
|
|
|
class nsFormControlListSH : public nsHTMLCollectionSH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsFormControlListSH(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 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsFormControlListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// Override nsNamedArraySH::GetNamedItem() since our NamedItem() can
|
|
|
|
// return either a nsIDOMNode or a nsIHTMLCollection
|
|
|
|
virtual nsresult GetNamedItem(nsISupports *aNative, nsAReadableString& aName,
|
|
|
|
nsISupports **aResult);
|
|
|
|
|
|
|
|
public:
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsFormControlListSH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Document helper, for document.location and document.on*
|
|
|
|
|
|
|
|
class nsDocumentSH : public nsNodeSH
|
|
|
|
{
|
|
|
|
public:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsDocumentSH(nsDOMClassInfoData* aData) : nsNodeSH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsDocumentSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
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);
|
|
|
|
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsDocumentSH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// HTMLDocument helper
|
|
|
|
|
|
|
|
class nsHTMLDocumentSH : public nsDocumentSH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsHTMLDocumentSH(nsDOMClassInfoData* aData) : nsDocumentSH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsHTMLDocumentSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2002-02-05 06:44:04 +00:00
|
|
|
static nsresult ResolveImpl(JSContext *cx,
|
|
|
|
nsIXPConnectWrappedNative *wrapper, jsval id,
|
2001-12-20 10:16:25 +00:00
|
|
|
nsISupports **result);
|
2002-02-05 06:44:04 +00:00
|
|
|
static JSBool JS_DLL_CALLBACK DocumentOpen(JSContext *cx, JSObject *obj,
|
|
|
|
uintN argc, jsval *argv,
|
|
|
|
jsval *rval);
|
2001-05-21 12:37:38 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
public:
|
2001-05-21 12:37:38 +00: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 17:42:36 +00:00
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
|
|
|
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsHTMLDocumentSH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2001-10-17 01:17:47 +00:00
|
|
|
// HTMLElement helper
|
|
|
|
|
|
|
|
class nsHTMLElementSH : public nsElementSH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsHTMLElementSH(nsDOMClassInfoData* aData) : nsElementSH(aData)
|
2001-10-17 01:17:47 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsHTMLElementSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2002-02-05 06:44:04 +00:00
|
|
|
static JSBool JS_DLL_CALLBACK ScrollIntoView(JSContext *cx, JSObject *obj,
|
|
|
|
uintN argc, jsval *argv,
|
|
|
|
jsval *rval);
|
2001-10-17 01:17:47 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, PRUint32 flags,
|
|
|
|
JSObject **objp, PRBool *_retval);
|
|
|
|
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
2001-10-17 01:17:47 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsHTMLElementSH(aData);
|
2001-10-17 01:17:47 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
// HTMLFormElement helper
|
|
|
|
|
2001-10-17 01:17:47 +00: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 17:42:36 +00:00
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00: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 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsHTMLFormElementSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2001-05-12 05:26:07 +00: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 17:42:36 +00:00
|
|
|
public:
|
2001-05-12 05:26:07 +00: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 17:42:36 +00:00
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp,
|
|
|
|
PRBool *_retval);
|
|
|
|
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsHTMLFormElementSH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2001-05-12 05:26:07 +00:00
|
|
|
// HTMLSelectElement helper
|
|
|
|
|
2001-10-17 01:17:47 +00:00
|
|
|
class nsHTMLSelectElementSH : public nsHTMLElementSH
|
2001-05-12 05:26:07 +00:00
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsHTMLSelectElementSH(nsDOMClassInfoData* aData) : nsHTMLElementSH(aData)
|
2001-05-12 05:26:07 +00: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 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
2001-05-12 05:26:07 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsHTMLSelectElementSH(aData);
|
2001-05-12 05:26:07 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
// Base helper for external HTML object (such as a plugin or an
|
|
|
|
// applet)
|
|
|
|
|
2001-10-17 01:17:47 +00:00
|
|
|
class nsHTMLExternalObjSH : 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 17:42:36 +00:00
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsHTMLExternalObjSH(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 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsHTMLExternalObjSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult GetPluginInstance(nsIXPConnectWrappedNative *aWrapper,
|
|
|
|
nsIPluginInstance **aResult);
|
|
|
|
|
|
|
|
virtual nsresult GetPluginJSObject(JSContext *cx, JSObject *obj,
|
|
|
|
nsIPluginInstance *plugin_inst,
|
|
|
|
JSObject **plugin_obj,
|
|
|
|
JSObject **plugin_proto) = 0;
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2001-10-10 04:04:21 +00:00
|
|
|
// HTMLAppletElement helper
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2001-10-10 04:04:21 +00:00
|
|
|
class nsHTMLAppletElementSH : public nsHTMLExternalObjSH
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsHTMLAppletElementSH(nsDOMClassInfoData* aData) : nsHTMLExternalObjSH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2001-10-10 04:04:21 +00:00
|
|
|
virtual ~nsHTMLAppletElementSH()
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual nsresult GetPluginJSObject(JSContext *cx, JSObject *obj,
|
|
|
|
nsIPluginInstance *plugin_inst,
|
|
|
|
JSObject **plugin_obj,
|
|
|
|
JSObject **plugin_proto);
|
|
|
|
|
|
|
|
public:
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsHTMLAppletElementSH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2001-10-10 04:04:21 +00:00
|
|
|
// HTMLEmbed/ObjectElement helper
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2001-10-10 04:04:21 +00:00
|
|
|
class nsHTMLPluginObjElementSH : public nsHTMLAppletElementSH
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsHTMLPluginObjElementSH(nsDOMClassInfoData* aData) : nsHTMLAppletElementSH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2001-10-10 04:04:21 +00:00
|
|
|
virtual ~nsHTMLPluginObjElementSH()
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual nsresult GetPluginJSObject(JSContext *cx, JSObject *obj,
|
|
|
|
nsIPluginInstance *plugin_inst,
|
|
|
|
JSObject **plugin_obj,
|
|
|
|
JSObject **plugin_proto);
|
|
|
|
|
|
|
|
public:
|
2001-10-10 04:04:21 +00:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, PRUint32 flags,
|
|
|
|
JSObject **objp, PRBool *_retval);
|
|
|
|
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsHTMLPluginObjElementSH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// HTMLOptionCollection helper
|
|
|
|
|
|
|
|
class nsHTMLOptionCollectionSH : public nsHTMLCollectionSH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsHTMLOptionCollectionSH(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 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsHTMLOptionCollectionSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
|
|
|
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsHTMLOptionCollectionSH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Plugin helper
|
|
|
|
|
|
|
|
class nsPluginSH : public nsNamedArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsPluginSH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsPluginSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// Override nsArraySH::GetItemAt() since our list isn't a
|
|
|
|
// nsIDOMNodeList
|
|
|
|
virtual nsresult GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
nsISupports **aResult);
|
|
|
|
|
|
|
|
// Override nsNamedArraySH::GetNamedItem()
|
|
|
|
virtual nsresult GetNamedItem(nsISupports *aNative, nsAReadableString& aName,
|
|
|
|
nsISupports **aResult);
|
|
|
|
|
|
|
|
public:
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsPluginSH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
2001-04-01 01:10:59 +00:00
|
|
|
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
// PluginArray helper
|
2001-04-01 01:10:59 +00:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
class nsPluginArraySH : public nsNamedArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsPluginArraySH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsPluginArraySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// Override nsArraySH::GetItemAt() since our list isn't a
|
|
|
|
// nsIDOMNodeList
|
|
|
|
virtual nsresult GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
nsISupports **aResult);
|
|
|
|
|
|
|
|
// Override nsNamedArraySH::GetNamedItem()
|
|
|
|
virtual nsresult GetNamedItem(nsISupports *aNative, nsAReadableString& aName,
|
|
|
|
nsISupports **aResult);
|
|
|
|
|
|
|
|
public:
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsPluginArraySH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// MimeTypeArray helper
|
|
|
|
|
|
|
|
class nsMimeTypeArraySH : public nsNamedArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsMimeTypeArraySH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsMimeTypeArraySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// Override nsArraySH::GetItemAt() since our list isn't a
|
|
|
|
// nsIDOMNodeList
|
|
|
|
virtual nsresult GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
nsISupports **aResult);
|
|
|
|
|
|
|
|
// Override nsNamedArraySH::GetNamedItem()
|
|
|
|
virtual nsresult GetNamedItem(nsISupports *aNative, nsAReadableString& aName,
|
|
|
|
nsISupports **aResult);
|
|
|
|
|
|
|
|
public:
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsMimeTypeArraySH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// History helper
|
|
|
|
|
|
|
|
class nsStringArraySH : public nsDOMClassInfo
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsStringArraySH(nsDOMClassInfoData* aData) : nsDOMClassInfo(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsStringArraySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual nsresult GetStringAt(nsISupports *aNative, PRInt32 aIndex,
|
|
|
|
nsAWritableString& aResult) = 0;
|
|
|
|
|
|
|
|
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 02:25:08 +00:00
|
|
|
nsHistorySH(nsDOMClassInfoData* aData) : nsStringArraySH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsHistorySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual nsresult GetStringAt(nsISupports *aNative, PRInt32 aIndex,
|
|
|
|
nsAWritableString& aResult);
|
|
|
|
|
|
|
|
public:
|
2001-08-31 02:36:45 +00:00
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
|
|
|
|
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsHistorySH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// MediaList helper
|
|
|
|
|
|
|
|
class nsMediaListSH : public nsStringArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsMediaListSH(nsDOMClassInfoData* aData) : nsStringArraySH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsMediaListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual nsresult GetStringAt(nsISupports *aNative, PRInt32 aIndex,
|
|
|
|
nsAWritableString& aResult);
|
|
|
|
|
|
|
|
public:
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsMediaListSH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// StyleSheetList helper
|
|
|
|
|
|
|
|
class nsStyleSheetListSH : public nsArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsStyleSheetListSH(nsDOMClassInfoData* aData) : nsArraySH(aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsStyleSheetListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// Override nsArraySH::GetItemAt() since our list isn't a
|
|
|
|
// nsIDOMNodeList
|
|
|
|
virtual nsresult GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
nsISupports **aResult);
|
|
|
|
|
|
|
|
public:
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsStyleSheetListSH(aData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// CSSStyleDeclaration helper
|
|
|
|
|
|
|
|
class nsCSSStyleDeclSH : public nsStringArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00: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 17:42:36 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsCSSStyleDeclSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual nsresult GetStringAt(nsISupports *aNative, PRInt32 aIndex,
|
|
|
|
nsAWritableString& aResult);
|
|
|
|
|
|
|
|
public:
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new 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 17:42:36 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2001-05-13 22:16:45 +00:00
|
|
|
// CSSRuleList helper
|
|
|
|
|
|
|
|
class nsCSSRuleListSH : public nsArraySH
|
|
|
|
{
|
|
|
|
protected:
|
2002-03-04 02:25:08 +00:00
|
|
|
nsCSSRuleListSH(nsDOMClassInfoData* aData) : nsArraySH(aData)
|
2001-05-13 22:16:45 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsCSSRuleListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// Override nsArraySH::GetItemAt() since our list isn't a
|
|
|
|
// nsIDOMNodeList
|
|
|
|
virtual nsresult GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
nsISupports **aResult);
|
|
|
|
|
|
|
|
public:
|
2002-03-04 02:25:08 +00:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
2001-05-13 22:16:45 +00:00
|
|
|
{
|
2002-03-04 02:25:08 +00:00
|
|
|
return new nsCSSRuleListSH(aData);
|
2001-05-13 22:16:45 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
// Event handler 'this' translator class, this is called by XPConnect
|
|
|
|
// when a "function interface" (nsIDOMEventListener) is called, this
|
|
|
|
// class extracts 'this' fomr the first argument to the called
|
|
|
|
// function (nsIDOMEventListener::HandleEvent(in nsIDOMEvent)), this
|
|
|
|
// class will pass back nsIDOMEvent::currentTarget to be used as
|
|
|
|
// 'this'.
|
|
|
|
|
|
|
|
class nsEventListenerThisTranslator : public nsIXPCFunctionThisTranslator
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsEventListenerThisTranslator()
|
|
|
|
{
|
|
|
|
NS_INIT_ISUPPORTS();
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsEventListenerThisTranslator()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// nsISupports
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
// nsIXPCFunctionThisTranslator
|
|
|
|
NS_DECL_NSIXPCFUNCTIONTHISTRANSLATOR
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2001-09-05 04:29:13 +00:00
|
|
|
void InvalidateContextAndWrapperCache();
|
|
|
|
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
/**
|
|
|
|
* nsIClassInfo helper macros
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(_class) \
|
|
|
|
if (aIID.Equals(NS_GET_IID(nsIClassInfo))) { \
|
|
|
|
foundInterface = \
|
2001-07-11 09:09:30 +00:00
|
|
|
nsDOMClassInfo::GetClassInfoInstance(eDOMClassInfo_##_class##_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 17:42:36 +00:00
|
|
|
NS_ENSURE_TRUE(foundInterface, NS_ERROR_OUT_OF_MEMORY); \
|
|
|
|
\
|
|
|
|
*aInstancePtr = foundInterface; \
|
|
|
|
\
|
|
|
|
return NS_OK; \
|
|
|
|
} else
|
2001-04-01 01:10:59 +00:00
|
|
|
|
|
|
|
#endif /* nsDOMClassInfo_h___ */
|