2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=2 sw=2 et tw=80: */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* 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/
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Johnny Stenback <jst@netscape.com> (original author)
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* 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"),
|
|
|
|
* 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 MPL, 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 MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
|
|
|
#ifndef nsDOMClassInfo_h___
|
|
|
|
#define nsDOMClassInfo_h___
|
|
|
|
|
|
|
|
#include "nsIDOMClassInfo.h"
|
|
|
|
#include "nsIXPCScriptable.h"
|
|
|
|
#include "jsapi.h"
|
|
|
|
#include "nsIScriptSecurityManager.h"
|
|
|
|
#include "nsIScriptContext.h"
|
|
|
|
#include "nsDOMJSUtils.h" // for GetScriptContextFromJSContext
|
2009-06-03 08:30:18 -07:00
|
|
|
#include "nsIScriptGlobalObject.h"
|
2009-08-14 12:00:24 -07:00
|
|
|
#include "nsContentUtils.h"
|
2011-06-14 01:41:15 -07:00
|
|
|
#include "xpcpublic.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-04-07 15:44:03 -07:00
|
|
|
namespace mozilla {
|
|
|
|
class DOMSVGLengthList;
|
|
|
|
class DOMSVGNumberList;
|
|
|
|
class DOMSVGPathSegList;
|
|
|
|
class DOMSVGPointList;
|
2011-12-31 01:44:03 -08:00
|
|
|
class DOMSVGStringList;
|
2011-09-25 14:04:32 -07:00
|
|
|
class DOMSVGTransformList;
|
2011-04-07 15:44:03 -07:00
|
|
|
}
|
|
|
|
class nsGlobalWindow;
|
|
|
|
class nsIDOMDocument;
|
2011-08-20 06:53:34 -07:00
|
|
|
class nsIDOMHTMLOptionsCollection;
|
2007-03-22 10:30:00 -07:00
|
|
|
class nsIDOMNodeList;
|
2011-04-07 15:44:03 -07:00
|
|
|
class nsIDOMSVGLength;
|
|
|
|
class nsIDOMSVGLengthList;
|
|
|
|
class nsIDOMSVGNumber;
|
|
|
|
class nsIDOMSVGNumberList;
|
|
|
|
class nsIDOMSVGPathSeg;
|
|
|
|
class nsIDOMSVGPathSegList;
|
|
|
|
class nsIDOMSVGPoint;
|
|
|
|
class nsIDOMSVGPointList;
|
2011-12-31 01:44:03 -08:00
|
|
|
class nsIDOMSVGStringList;
|
|
|
|
class nsIDOMSVGTests;
|
2011-04-07 15:44:03 -07:00
|
|
|
class nsIDOMSVGTransform;
|
|
|
|
class nsIDOMSVGTransformList;
|
|
|
|
class nsIDOMWindow;
|
|
|
|
class nsIForm;
|
2007-03-22 10:30:00 -07:00
|
|
|
class nsIHTMLDocument;
|
2011-05-17 18:48:34 -07:00
|
|
|
class nsNPAPIPluginInstance;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
struct nsDOMClassInfoData;
|
|
|
|
|
|
|
|
typedef nsIClassInfo* (*nsDOMClassInfoConstructorFnc)
|
|
|
|
(nsDOMClassInfoData* aData);
|
|
|
|
|
2008-11-05 22:41:52 -08:00
|
|
|
typedef nsresult (*nsDOMConstructorFunc)(nsISupports** aNewObject);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
struct nsDOMClassInfoData
|
|
|
|
{
|
|
|
|
const char *mName;
|
2009-06-03 08:30:18 -07:00
|
|
|
const PRUnichar *mNameUTF16;
|
2007-03-22 10:30:00 -07:00
|
|
|
union {
|
|
|
|
nsDOMClassInfoConstructorFnc mConstructorFptr;
|
|
|
|
nsDOMClassInfoExternalConstructorFnc mExternalConstructorFptr;
|
|
|
|
} u;
|
|
|
|
|
|
|
|
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-26 15:43:31 -07:00
|
|
|
PRUint32 mHasClassInterface : 1;
|
2010-01-12 06:24:00 -08:00
|
|
|
PRUint32 mInterfacesBitmap;
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mChromeOnly;
|
|
|
|
bool mDisabled;
|
2011-06-14 01:41:15 -07:00
|
|
|
// For new style DOM bindings.
|
2011-08-20 06:53:32 -07:00
|
|
|
mozilla::dom::binding::DefineInterface mDefineDOMInterface;
|
2007-03-22 10:30:00 -07:00
|
|
|
#ifdef NS_DEBUG
|
|
|
|
PRUint32 mDebugID;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
struct nsExternalDOMClassInfoData : public nsDOMClassInfoData
|
|
|
|
{
|
|
|
|
const nsCID *mConstructorCID;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-03-14 20:19:53 -07:00
|
|
|
typedef PRUptrdiff PtrBits;
|
2007-03-22 10:30:00 -07: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)
|
|
|
|
|
|
|
|
|
2009-09-28 14:00:35 -07:00
|
|
|
class nsDOMClassInfo : public nsXPCClassInfo
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsDOMClassInfo(nsDOMClassInfoData* aData);
|
|
|
|
virtual ~nsDOMClassInfo();
|
|
|
|
|
|
|
|
NS_DECL_NSIXPCSCRIPTABLE
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
NS_DECL_NSICLASSINFO
|
|
|
|
|
|
|
|
// 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?
|
|
|
|
|
|
|
|
static nsIClassInfo* GetClassInfoInstance(nsDOMClassInfoData* aData);
|
|
|
|
|
|
|
|
static void ShutDown();
|
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsDOMClassInfo(aData);
|
|
|
|
}
|
|
|
|
|
|
|
|
static nsresult ThrowJSException(JSContext *cx, nsresult aResult);
|
|
|
|
|
2011-02-16 20:29:14 -08:00
|
|
|
/*
|
|
|
|
* The following two functions exist because of the way that Xray wrappers
|
|
|
|
* work. In order to allow scriptable helpers to define non-IDL defined but
|
|
|
|
* still "safe" properties for Xray wrappers, we call into the scriptable
|
|
|
|
* helper with |obj| being the wrapper.
|
|
|
|
*
|
|
|
|
* Ideally, that would be the end of the story, however due to complications
|
|
|
|
* dealing with document.domain, it's possible to end up in a scriptable
|
|
|
|
* helper with a wrapper, even though we should be treating the lookup as a
|
|
|
|
* transparent one.
|
|
|
|
*/
|
2011-09-28 23:19:26 -07:00
|
|
|
static bool ObjectIsNativeWrapper(JSContext* cx, JSObject* obj);
|
2010-07-02 13:54:53 -07:00
|
|
|
|
2010-03-04 16:17:05 -08:00
|
|
|
static nsISupports *GetNative(nsIXPConnectWrappedNative *wrapper, JSObject *obj);
|
2009-05-12 13:20:42 -07:00
|
|
|
|
|
|
|
static nsIXPConnect *XPConnect()
|
|
|
|
{
|
|
|
|
return sXPConnect;
|
|
|
|
}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
protected:
|
|
|
|
friend nsIClassInfo* NS_GetDOMClassInfoInstance(nsDOMClassInfoID aID);
|
|
|
|
|
|
|
|
const nsDOMClassInfoData* mData;
|
|
|
|
|
2009-11-29 00:32:39 -08:00
|
|
|
virtual void PreserveWrapper(nsISupports *aNative)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2010-01-12 06:24:00 -08:00
|
|
|
virtual PRUint32 GetInterfacesBitmap()
|
|
|
|
{
|
|
|
|
return mData->mInterfacesBitmap;
|
|
|
|
}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
static nsresult Init();
|
|
|
|
static nsresult RegisterClassName(PRInt32 aDOMClassInfoID);
|
|
|
|
static nsresult RegisterClassProtos(PRInt32 aDOMClassInfoID);
|
|
|
|
static nsresult RegisterExternalClasses();
|
|
|
|
nsresult ResolveConstructor(JSContext *cx, JSObject *obj,
|
|
|
|
JSObject **objp);
|
|
|
|
|
|
|
|
// 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
|
2010-07-14 23:19:36 -07:00
|
|
|
static PRInt32 GetArrayIndexFromId(JSContext *cx, jsid id,
|
2011-09-28 23:19:26 -07:00
|
|
|
bool *aIsNumber = nsnull);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
static inline bool IsReadonlyReplaceable(jsid id)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2011-05-10 11:24:44 -07:00
|
|
|
return (id == sParent_id ||
|
2007-03-22 10:30:00 -07:00
|
|
|
id == sScrollbars_id ||
|
|
|
|
id == sContent_id ||
|
|
|
|
id == sMenubar_id ||
|
|
|
|
id == sToolbar_id ||
|
|
|
|
id == sLocationbar_id ||
|
|
|
|
id == sPersonalbar_id ||
|
|
|
|
id == sStatusbar_id ||
|
|
|
|
id == sControllers_id ||
|
|
|
|
id == sScrollX_id ||
|
|
|
|
id == sScrollY_id ||
|
|
|
|
id == sScrollMaxX_id ||
|
|
|
|
id == sScrollMaxY_id ||
|
|
|
|
id == sLength_id ||
|
|
|
|
id == sFrames_id ||
|
2010-12-08 08:16:09 -08:00
|
|
|
id == sSelf_id ||
|
|
|
|
id == sURL_id);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
static inline bool IsWritableReplaceable(jsid id)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
return (id == sInnerHeight_id ||
|
|
|
|
id == sInnerWidth_id ||
|
|
|
|
id == sOpener_id ||
|
|
|
|
id == sOuterHeight_id ||
|
|
|
|
id == sOuterWidth_id ||
|
|
|
|
id == sScreenX_id ||
|
|
|
|
id == sScreenY_id ||
|
|
|
|
id == sStatus_id ||
|
|
|
|
id == sName_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
static nsIXPConnect *sXPConnect;
|
|
|
|
static nsIScriptSecurityManager *sSecMan;
|
|
|
|
|
|
|
|
// nsIXPCScriptable code
|
|
|
|
static nsresult DefineStaticJSVals(JSContext *cx);
|
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
static bool sIsInitialized;
|
|
|
|
static bool sDisableDocumentAllSupport;
|
|
|
|
static bool sDisableGlobalScopePollutionSupport;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-12-21 08:02:01 -08:00
|
|
|
public:
|
2010-07-14 23:19:36 -07:00
|
|
|
static jsid sParent_id;
|
|
|
|
static jsid sScrollbars_id;
|
|
|
|
static jsid sLocation_id;
|
|
|
|
static jsid sConstructor_id;
|
|
|
|
static jsid s_content_id;
|
|
|
|
static jsid sContent_id;
|
|
|
|
static jsid sMenubar_id;
|
|
|
|
static jsid sToolbar_id;
|
|
|
|
static jsid sLocationbar_id;
|
|
|
|
static jsid sPersonalbar_id;
|
|
|
|
static jsid sStatusbar_id;
|
|
|
|
static jsid sDialogArguments_id;
|
|
|
|
static jsid sControllers_id;
|
|
|
|
static jsid sLength_id;
|
|
|
|
static jsid sInnerHeight_id;
|
|
|
|
static jsid sInnerWidth_id;
|
|
|
|
static jsid sOuterHeight_id;
|
|
|
|
static jsid sOuterWidth_id;
|
|
|
|
static jsid sScreenX_id;
|
|
|
|
static jsid sScreenY_id;
|
|
|
|
static jsid sStatus_id;
|
|
|
|
static jsid sName_id;
|
|
|
|
static jsid sScrollX_id;
|
|
|
|
static jsid sScrollY_id;
|
|
|
|
static jsid sScrollMaxX_id;
|
|
|
|
static jsid sScrollMaxY_id;
|
|
|
|
static jsid sItem_id;
|
|
|
|
static jsid sNamedItem_id;
|
|
|
|
static jsid sEnumerate_id;
|
|
|
|
static jsid sNavigator_id;
|
|
|
|
static jsid sDocument_id;
|
|
|
|
static jsid sFrames_id;
|
|
|
|
static jsid sSelf_id;
|
|
|
|
static jsid sOpener_id;
|
|
|
|
static jsid sAll_id;
|
|
|
|
static jsid sTags_id;
|
|
|
|
static jsid sAddEventListener_id;
|
2011-09-21 20:05:42 -07:00
|
|
|
static jsid sBaseURIObject_id;
|
|
|
|
static jsid sNodePrincipal_id;
|
|
|
|
static jsid sDocumentURIObject_id;
|
2010-07-14 23:19:36 -07:00
|
|
|
static jsid sJava_id;
|
|
|
|
static jsid sPackages_id;
|
2010-09-17 14:54:40 -07:00
|
|
|
static jsid sWrappedJSObject_id;
|
2010-12-08 08:16:09 -08:00
|
|
|
static jsid sURL_id;
|
2010-12-21 08:02:01 -08:00
|
|
|
static jsid sKeyPath_id;
|
|
|
|
static jsid sAutoIncrement_id;
|
|
|
|
static jsid sUnique_id;
|
2011-12-04 09:39:01 -08:00
|
|
|
static jsid sMultiEntry_id;
|
2011-08-24 12:49:25 -07:00
|
|
|
static jsid sOnload_id;
|
|
|
|
static jsid sOnerror_id;
|
2011-06-28 15:37:31 -07:00
|
|
|
|
2010-12-21 08:02:01 -08:00
|
|
|
protected:
|
2010-03-18 18:00:58 -07:00
|
|
|
static JSPropertyOp sXPCNativeWrapperGetPropertyOp;
|
2010-07-02 13:54:53 -07:00
|
|
|
static JSPropertyOp sXrayWrapperPropertyHolderGetPropertyOp;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
2009-05-12 13:20:42 -07:00
|
|
|
|
|
|
|
inline
|
|
|
|
const nsQueryInterface
|
|
|
|
do_QueryWrappedNative(nsIXPConnectWrappedNative *wrapper, JSObject *obj)
|
|
|
|
{
|
|
|
|
return nsQueryInterface(nsDOMClassInfo::GetNative(wrapper, obj));
|
|
|
|
}
|
|
|
|
|
|
|
|
inline
|
|
|
|
const nsQueryInterfaceWithError
|
|
|
|
do_QueryWrappedNative(nsIXPConnectWrappedNative *wrapper, JSObject *obj,
|
|
|
|
nsresult *aError)
|
|
|
|
|
|
|
|
{
|
|
|
|
return nsQueryInterfaceWithError(nsDOMClassInfo::GetNative(wrapper, obj),
|
|
|
|
aError);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline
|
|
|
|
nsQueryInterface
|
|
|
|
do_QueryWrapper(JSContext *cx, JSObject *obj)
|
|
|
|
{
|
|
|
|
nsISupports *native =
|
|
|
|
nsDOMClassInfo::XPConnect()->GetNativeOfWrapper(cx, obj);
|
|
|
|
return nsQueryInterface(native);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline
|
|
|
|
nsQueryInterfaceWithError
|
|
|
|
do_QueryWrapper(JSContext *cx, JSObject *obj, nsresult* error)
|
|
|
|
{
|
|
|
|
nsISupports *native =
|
|
|
|
nsDOMClassInfo::XPConnect()->GetNativeOfWrapper(cx, obj);
|
|
|
|
return nsQueryInterfaceWithError(native, error);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
typedef nsDOMClassInfo nsDOMGenericSH;
|
|
|
|
|
2010-01-13 05:50:01 -08:00
|
|
|
// Makes sure that the wrapper is preserved if new properties are added.
|
2008-08-14 04:04:43 -07:00
|
|
|
class nsEventTargetSH : public nsDOMGenericSH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsEventTargetSH(nsDOMClassInfoData* aData) : nsDOMGenericSH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsEventTargetSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
public:
|
2008-11-13 08:54:52 -08:00
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
2008-09-25 07:40:30 -07:00
|
|
|
NS_IMETHOD AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2008-08-14 04:04:43 -07:00
|
|
|
|
2009-11-29 00:32:39 -08:00
|
|
|
virtual void PreserveWrapper(nsISupports *aNative);
|
|
|
|
|
2008-08-14 04:04:43 -07:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsEventTargetSH(aData);
|
|
|
|
}
|
|
|
|
};
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// Window scriptable helper
|
|
|
|
|
2011-08-24 12:49:25 -07:00
|
|
|
class nsWindowSH : public nsDOMGenericSH
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
protected:
|
2011-08-24 12:49:25 -07:00
|
|
|
nsWindowSH(nsDOMClassInfoData *aData) : nsDOMGenericSH(aData)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2010-09-17 14:54:40 -07:00
|
|
|
virtual ~nsWindowSH()
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static nsresult GlobalResolve(nsGlobalWindow *aWin, JSContext *cx,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject *obj, jsid id, bool *did_resolve);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
public:
|
2010-09-17 14:54:40 -07:00
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
2009-06-03 08:30:18 -07:00
|
|
|
#ifdef DEBUG
|
|
|
|
NS_IMETHOD PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj)
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIScriptGlobalObject> sgo(do_QueryWrappedNative(wrapper));
|
|
|
|
|
|
|
|
NS_ASSERTION(!sgo || sgo->GetGlobalJSObject() == nsnull,
|
|
|
|
"Multiple wrappers created for global object!");
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
NS_IMETHOD GetScriptableFlags(PRUint32 *aFlags)
|
|
|
|
{
|
|
|
|
PRUint32 flags;
|
2011-08-24 12:49:25 -07:00
|
|
|
nsresult rv = nsDOMGenericSH::GetScriptableFlags(&flags);
|
2009-06-03 08:30:18 -07:00
|
|
|
if (NS_SUCCEEDED(rv)) {
|
|
|
|
*aFlags = flags | nsIXPCScriptable::WANT_POSTCREATE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
#endif
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2011-04-08 13:28:05 -07:00
|
|
|
NS_IMETHOD Enumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject *obj, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2010-07-14 23:19:36 -07:00
|
|
|
JSObject *obj, jsid id, PRUint32 flags,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject **objp, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD Finalize(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj);
|
2010-09-17 14:54:40 -07:00
|
|
|
NS_IMETHOD OuterObject(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
|
|
|
|
JSObject * obj, JSObject * *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-09-06 15:21:43 -07:00
|
|
|
static JSBool GlobalScopePolluterNewResolve(JSContext *cx, JSObject *obj,
|
2010-07-14 23:19:36 -07:00
|
|
|
jsid id, uintN flags,
|
2008-09-06 15:21:43 -07:00
|
|
|
JSObject **objp);
|
|
|
|
static JSBool GlobalScopePolluterGetProperty(JSContext *cx, JSObject *obj,
|
2010-07-14 23:19:36 -07:00
|
|
|
jsid id, jsval *vp);
|
2011-02-09 11:31:40 -08:00
|
|
|
static JSBool SecurityCheckOnAddDelProp(JSContext *cx, JSObject *obj, jsid id,
|
|
|
|
jsval *vp);
|
2010-07-14 23:19:36 -07:00
|
|
|
static JSBool SecurityCheckOnSetProp(JSContext *cx, JSObject *obj, jsid id,
|
2011-02-09 11:31:40 -08:00
|
|
|
JSBool strict, jsval *vp);
|
2007-03-22 10:30:00 -07:00
|
|
|
static void InvalidateGlobalScopePolluter(JSContext *cx, JSObject *obj);
|
|
|
|
static nsresult InstallGlobalScopePolluter(JSContext *cx, JSObject *obj,
|
|
|
|
nsIHTMLDocument *doc);
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
2010-09-17 14:54:40 -07:00
|
|
|
return new nsWindowSH(aData);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
// Location scriptable helper
|
|
|
|
|
|
|
|
class nsLocationSH : public nsDOMGenericSH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsLocationSH(nsDOMClassInfoData* aData) : nsDOMGenericSH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsLocationSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD CheckAccess(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2010-07-14 23:19:36 -07:00
|
|
|
JSObject *obj, jsid id, PRUint32 mode,
|
2011-09-28 23:19:26 -07:00
|
|
|
jsval *vp, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsLocationSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Navigator scriptable helper
|
|
|
|
|
|
|
|
class nsNavigatorSH : public nsDOMGenericSH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsNavigatorSH(nsDOMClassInfoData* aData) : nsDOMGenericSH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsNavigatorSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
2011-09-06 12:01:01 -07:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsid id, PRUint32 flags,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject **objp, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsNavigatorSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// DOM Node helper, this class deals with setting the parent for the
|
|
|
|
// wrappers
|
|
|
|
|
2011-08-24 12:49:25 -07:00
|
|
|
class nsNodeSH : public nsDOMGenericSH
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
protected:
|
2011-08-24 12:49:25 -07:00
|
|
|
nsNodeSH(nsDOMClassInfoData* aData) : nsDOMGenericSH(aData)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsNodeSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// Helper to check whether a capability is enabled
|
2011-09-28 23:19:26 -07:00
|
|
|
bool IsCapabilityEnabled(const char* aCapability);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
inline bool IsPrivilegedScript() {
|
2007-03-22 10:30:00 -07:00
|
|
|
return IsCapabilityEnabled("UniversalXPConnect");
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
2011-09-21 18:30:27 -07:00
|
|
|
NS_IMETHOD PostCreatePrototype(JSContext * cx, JSObject * proto);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2010-07-14 23:19:36 -07:00
|
|
|
JSObject *obj, jsid id, PRUint32 flags,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject **objp, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD GetFlags(PRUint32 *aFlags);
|
|
|
|
|
2009-11-29 00:32:39 -08:00
|
|
|
virtual void PreserveWrapper(nsISupports *aNative);
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsNodeSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Element helper
|
|
|
|
|
|
|
|
class nsElementSH : public nsNodeSH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsElementSH(nsDOMClassInfoData* aData) : nsNodeSH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsElementSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
2009-05-12 13:20:42 -07:00
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj);
|
2007-09-28 06:45:01 -07:00
|
|
|
NS_IMETHOD Enumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject *obj, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsElementSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Generic array scriptable helper
|
|
|
|
|
|
|
|
class nsGenericArraySH : public nsDOMClassInfo
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsGenericArraySH(nsDOMClassInfoData* aData) : nsDOMClassInfo(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsGenericArraySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2010-07-14 23:19:36 -07:00
|
|
|
JSObject *obj, jsid id, PRUint32 flags,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject **objp, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD Enumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject *obj, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-10-22 07:31:14 -07:00
|
|
|
virtual nsresult GetLength(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 *length);
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsGenericArraySH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-10-22 07:31:14 -07:00
|
|
|
// Array scriptable helper
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
class nsArraySH : public nsGenericArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsArraySH(nsDOMClassInfoData* aData) : nsGenericArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsArraySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-22 07:31:14 -07: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,
|
2010-05-09 12:33:00 -07:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult) = 0;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-10-22 07:31:14 -07: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 08:54:52 -08:00
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
|
|
|
|
2008-10-22 07:31:14 -07:00
|
|
|
virtual nsresult GetLength(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 *length);
|
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2010-05-09 12:33:00 -07:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult);
|
2008-10-22 07:31:14 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
2008-10-22 07:31:14 -07:00
|
|
|
return new nsNodeListSH(aData);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// NamedArray helper
|
|
|
|
|
|
|
|
class nsNamedArraySH : public nsArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsNamedArraySH(nsDOMClassInfoData* aData) : nsArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsNamedArraySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-02-24 10:27:26 -08:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsid id, PRUint32 flags,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject **objp, bool *_retval);
|
2011-02-24 10:27:26 -08:00
|
|
|
|
2008-10-31 14:40:35 -07:00
|
|
|
virtual nsISupports* GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
2010-05-09 12:41:19 -07:00
|
|
|
nsWrapperCache **cache,
|
2008-10-31 14:40:35 -07:00
|
|
|
nsresult *aResult) = 0;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2008-10-22 07:31:14 -07:00
|
|
|
|
|
|
|
private:
|
|
|
|
// Not implemented, nothing should create an instance of this class.
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData);
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// NamedNodeMap helper
|
|
|
|
|
|
|
|
class nsNamedNodeMapSH : public nsNamedArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsNamedNodeMapSH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsNamedNodeMapSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-22 07:31:14 -07:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2010-05-09 12:33:00 -07:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// Override nsNamedArraySH::GetNamedItem()
|
2008-10-31 14:40:35 -07:00
|
|
|
virtual nsISupports* GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
2010-05-09 12:41:19 -07:00
|
|
|
nsWrapperCache **cache,
|
2008-10-31 14:40:35 -07:00
|
|
|
nsresult *aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsNamedNodeMapSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// HTMLCollection helper
|
|
|
|
|
|
|
|
class nsHTMLCollectionSH : public nsNamedArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsHTMLCollectionSH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsHTMLCollectionSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-31 14:40:35 -07:00
|
|
|
virtual nsresult GetLength(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 *length);
|
2008-10-22 07:31:14 -07:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2010-05-09 12:33:00 -07:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// Override nsNamedArraySH::GetNamedItem()
|
2008-10-31 14:40:35 -07:00
|
|
|
virtual nsISupports* GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
2010-05-09 12:41:19 -07:00
|
|
|
nsWrapperCache **cache,
|
2008-10-31 14:40:35 -07:00
|
|
|
nsresult *aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
public:
|
2011-10-13 06:36:09 -07:00
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsHTMLCollectionSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// ContentList helper
|
|
|
|
|
2008-10-31 14:40:35 -07:00
|
|
|
class nsContentListSH : public nsNamedArraySH
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
protected:
|
2008-10-31 14:40:35 -07:00
|
|
|
nsContentListSH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
2008-10-31 14:40:35 -07:00
|
|
|
|
|
|
|
virtual nsresult GetLength(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 *length);
|
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2010-05-09 12:33:00 -07:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult);
|
2008-10-31 14:40:35 -07:00
|
|
|
virtual nsISupports* GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
2010-05-09 12:41:19 -07:00
|
|
|
nsWrapperCache **cache,
|
2008-10-31 14:40:35 -07:00
|
|
|
nsresult *aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsContentListSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-05-20 10:23:49 -07:00
|
|
|
// DOMStringMap helper for .dataset property on elements.
|
|
|
|
|
|
|
|
class nsDOMStringMapSH : public nsDOMGenericSH
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsDOMStringMapSH(nsDOMClassInfoData* aData) : nsDOMGenericSH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsDOMStringMapSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsid id, PRUint32 flags,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject **objp, bool *_retval);
|
2011-05-20 10:23:49 -07:00
|
|
|
NS_IMETHOD Enumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject *obj, bool *_retval);
|
2011-05-20 10:23:49 -07:00
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
|
|
|
NS_IMETHOD DelProperty(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj, jsid id,
|
2011-09-28 23:19:26 -07:00
|
|
|
jsval *vp, bool *_retval);
|
2011-05-20 10:23:49 -07:00
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2011-05-20 10:23:49 -07:00
|
|
|
NS_IMETHOD SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2011-05-20 10:23:49 -07:00
|
|
|
|
2011-05-23 15:53:12 -07:00
|
|
|
bool JSIDToProp(const jsid& aId, nsAString& aResult);
|
|
|
|
|
2011-05-20 10:23:49 -07:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsDOMStringMapSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// Document helper, for document.location and document.on*
|
|
|
|
|
|
|
|
class nsDocumentSH : public nsNodeSH
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsDocumentSH(nsDOMClassInfoData* aData) : nsNodeSH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsDocumentSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
2011-09-21 18:30:27 -07:00
|
|
|
NS_IMETHOD PostCreatePrototype(JSContext * cx, JSObject * proto);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2010-07-14 23:19:36 -07:00
|
|
|
JSObject *obj, jsid id, PRUint32 flags,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject **objp, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD GetFlags(PRUint32* aFlags);
|
|
|
|
NS_IMETHOD PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj);
|
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsDocumentSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// HTMLDocument helper
|
|
|
|
|
|
|
|
class nsHTMLDocumentSH : public nsDocumentSH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsHTMLDocumentSH(nsDOMClassInfoData* aData) : nsDocumentSH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsHTMLDocumentSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static JSBool GetDocumentAllNodeList(JSContext *cx, JSObject *obj,
|
2010-05-10 09:43:20 -07:00
|
|
|
nsDocument *doc,
|
|
|
|
nsContentList **nodeList);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
public:
|
2010-07-14 23:19:36 -07:00
|
|
|
static JSBool DocumentAllGetProperty(JSContext *cx, JSObject *obj, jsid id,
|
2008-09-06 15:21:43 -07:00
|
|
|
jsval *vp);
|
2010-07-14 23:19:36 -07:00
|
|
|
static JSBool DocumentAllNewResolve(JSContext *cx, JSObject *obj, jsid id,
|
2008-09-06 15:21:43 -07:00
|
|
|
uintN flags, JSObject **objp);
|
|
|
|
static void ReleaseDocument(JSContext *cx, JSObject *obj);
|
2010-08-16 12:35:04 -07:00
|
|
|
static JSBool CallToGetPropMapper(JSContext *cx, uintN argc, jsval *vp);
|
2008-09-06 15:21:43 -07:00
|
|
|
static JSBool DocumentAllHelperGetProperty(JSContext *cx, JSObject *obj,
|
2010-07-14 23:19:36 -07:00
|
|
|
jsid id, jsval *vp);
|
2008-09-06 15:21:43 -07:00
|
|
|
static JSBool DocumentAllHelperNewResolve(JSContext *cx, JSObject *obj,
|
2010-07-14 23:19:36 -07:00
|
|
|
jsid id, uintN flags,
|
2008-09-06 15:21:43 -07:00
|
|
|
JSObject **objp);
|
|
|
|
static JSBool DocumentAllTagsNewResolve(JSContext *cx, JSObject *obj,
|
2010-07-14 23:19:36 -07:00
|
|
|
jsid id, uintN flags,
|
2008-09-06 15:21:43 -07:00
|
|
|
JSObject **objp);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2010-07-14 23:19:36 -07:00
|
|
|
JSObject *obj, jsid id, PRUint32 flags,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject **objp, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsHTMLDocumentSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// HTMLFormElement helper
|
|
|
|
|
2009-08-10 07:41:12 -07:00
|
|
|
class nsHTMLFormElementSH : public nsElementSH
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
protected:
|
2009-08-10 07:41:12 -07:00
|
|
|
nsHTMLFormElementSH(nsDOMClassInfoData* aData) : nsElementSH(aData)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsHTMLFormElementSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2010-12-03 00:24:17 -08:00
|
|
|
static nsresult FindNamedItem(nsIForm *aForm, jsid id,
|
2010-05-10 09:43:20 -07:00
|
|
|
nsISupports **aResult, nsWrapperCache **aCache);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2010-07-14 23:19:36 -07:00
|
|
|
JSObject *obj, jsid id, PRUint32 flags,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject **objp, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2010-07-14 23:19:36 -07:00
|
|
|
JSObject *obj, jsid id, jsval *vp,
|
2011-09-28 23:19:26 -07:00
|
|
|
bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
NS_IMETHOD NewEnumerate(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj,
|
|
|
|
PRUint32 enum_op, jsval *statep,
|
2011-09-28 23:19:26 -07:00
|
|
|
jsid *idp, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsHTMLFormElementSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// HTMLSelectElement helper
|
|
|
|
|
2009-08-10 07:41:12 -07:00
|
|
|
class nsHTMLSelectElementSH : public nsElementSH
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
protected:
|
2009-08-10 07:41:12 -07:00
|
|
|
nsHTMLSelectElementSH(nsDOMClassInfoData* aData) : nsElementSH(aData)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsHTMLSelectElementSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
2011-02-24 10:36:33 -08:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsid id, PRUint32 flags,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject **objp, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2010-07-14 23:19:36 -07:00
|
|
|
JSObject *obj, jsid id, jsval *vp,
|
2011-09-28 23:19:26 -07:00
|
|
|
bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
static nsresult SetOption(JSContext *cx, jsval *vp, PRUint32 aIndex,
|
2011-08-20 06:53:34 -07:00
|
|
|
nsIDOMHTMLOptionsCollection *aOptCollection);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsHTMLSelectElementSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-08-28 17:28:32 -07:00
|
|
|
// HTMLEmbed/Object/AppletElement helper
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2009-08-10 07:41:12 -07:00
|
|
|
class nsHTMLPluginObjElementSH : public nsElementSH
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
protected:
|
2007-08-28 17:28:32 -07:00
|
|
|
nsHTMLPluginObjElementSH(nsDOMClassInfoData* aData)
|
2009-08-10 07:41:12 -07:00
|
|
|
: nsElementSH(aData)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-08-28 17:28:32 -07:00
|
|
|
virtual ~nsHTMLPluginObjElementSH()
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-03-14 16:08:57 -07:00
|
|
|
static nsresult GetPluginInstanceIfSafe(nsIXPConnectWrappedNative *aWrapper,
|
2009-05-12 13:20:42 -07:00
|
|
|
JSObject *obj,
|
2011-05-17 18:48:34 -07:00
|
|
|
nsNPAPIPluginInstance **aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-08-28 17:28:32 -07:00
|
|
|
static nsresult GetPluginJSObject(JSContext *cx, JSObject *obj,
|
2011-05-17 18:48:34 -07:00
|
|
|
nsNPAPIPluginInstance *plugin_inst,
|
2007-08-28 17:28:32 -07:00
|
|
|
JSObject **plugin_obj,
|
|
|
|
JSObject **plugin_proto);
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
public:
|
2009-12-25 10:16:57 -08:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2010-07-14 23:19:36 -07:00
|
|
|
JSObject *obj, jsid id, PRUint32 flags,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject **objp, bool *_retval);
|
2009-05-12 13:20:42 -07:00
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj);
|
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD Call(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 argc, jsval *argv, jsval *vp,
|
2011-09-28 23:19:26 -07:00
|
|
|
bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-03-14 16:08:57 -07:00
|
|
|
|
|
|
|
static nsresult SetupProtoChain(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj);
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsHTMLPluginObjElementSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// HTMLOptionsCollection helper
|
|
|
|
|
|
|
|
class nsHTMLOptionsCollectionSH : public nsHTMLCollectionSH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsHTMLOptionsCollectionSH(nsDOMClassInfoData* aData)
|
|
|
|
: nsHTMLCollectionSH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsHTMLOptionsCollectionSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsHTMLOptionsCollectionSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Plugin helper
|
|
|
|
|
|
|
|
class nsPluginSH : public nsNamedArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsPluginSH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsPluginSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-22 07:31:14 -07:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2010-05-09 12:33:00 -07:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// Override nsNamedArraySH::GetNamedItem()
|
2008-10-31 14:40:35 -07:00
|
|
|
virtual nsISupports* GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
2010-05-09 12:41:19 -07:00
|
|
|
nsWrapperCache **cache,
|
2008-10-31 14:40:35 -07:00
|
|
|
nsresult *aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsPluginSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// PluginArray helper
|
|
|
|
|
|
|
|
class nsPluginArraySH : public nsNamedArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsPluginArraySH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsPluginArraySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-22 07:31:14 -07:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2010-05-09 12:33:00 -07:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// Override nsNamedArraySH::GetNamedItem()
|
2008-10-31 14:40:35 -07:00
|
|
|
virtual nsISupports* GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
2010-05-09 12:41:19 -07:00
|
|
|
nsWrapperCache **cache,
|
2008-10-31 14:40:35 -07:00
|
|
|
nsresult *aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsPluginArraySH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// MimeTypeArray helper
|
|
|
|
|
|
|
|
class nsMimeTypeArraySH : public nsNamedArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsMimeTypeArraySH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsMimeTypeArraySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-22 07:31:14 -07:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2010-05-09 12:33:00 -07:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// Override nsNamedArraySH::GetNamedItem()
|
2008-10-31 14:40:35 -07:00
|
|
|
virtual nsISupports* GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
2010-05-09 12:41:19 -07:00
|
|
|
nsWrapperCache **cache,
|
2008-10-31 14:40:35 -07:00
|
|
|
nsresult *aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsMimeTypeArraySH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// String array helper
|
|
|
|
|
|
|
|
class nsStringArraySH : public nsGenericArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsStringArraySH(nsDOMClassInfoData* aData) : nsGenericArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsStringArraySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual nsresult GetStringAt(nsISupports *aNative, PRInt32 aIndex,
|
|
|
|
nsAString& aResult) = 0;
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// History helper
|
|
|
|
|
|
|
|
class nsHistorySH : public nsStringArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsHistorySH(nsDOMClassInfoData* aData) : nsStringArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsHistorySH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual nsresult GetStringAt(nsISupports *aNative, PRInt32 aIndex,
|
|
|
|
nsAString& aResult);
|
|
|
|
|
|
|
|
public:
|
2010-10-29 12:49:32 -07:00
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsHistorySH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
// 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);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-08-12 01:55:14 -07:00
|
|
|
// DOMTokenList scriptable helper
|
|
|
|
|
|
|
|
class nsDOMTokenListSH : public nsStringArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsDOMTokenListSH(nsDOMClassInfoData* aData) : nsStringArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsDOMTokenListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual nsresult GetStringAt(nsISupports *aNative, PRInt32 aIndex,
|
|
|
|
nsAString& aResult);
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsDOMTokenListSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
// MediaList helper
|
|
|
|
|
|
|
|
class nsMediaListSH : public nsStringArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsMediaListSH(nsDOMClassInfoData* aData) : nsStringArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsMediaListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual nsresult GetStringAt(nsISupports *aNative, PRInt32 aIndex,
|
|
|
|
nsAString& aResult);
|
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsMediaListSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// StyleSheetList helper
|
|
|
|
|
|
|
|
class nsStyleSheetListSH : public nsArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsStyleSheetListSH(nsDOMClassInfoData* aData) : nsArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsStyleSheetListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-22 07:31:14 -07:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2010-05-09 12:33:00 -07:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsStyleSheetListSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// CSSValueList helper
|
|
|
|
|
|
|
|
class nsCSSValueListSH : public nsArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsCSSValueListSH(nsDOMClassInfoData* aData) : nsArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsCSSValueListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-22 07:31:14 -07:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2010-05-09 12:33:00 -07:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsCSSValueListSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// CSSStyleDeclaration helper
|
|
|
|
|
|
|
|
class nsCSSStyleDeclSH : public nsStringArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsCSSStyleDeclSH(nsDOMClassInfoData* aData) : nsStringArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsCSSStyleDeclSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual nsresult GetStringAt(nsISupports *aNative, PRInt32 aIndex,
|
|
|
|
nsAString& aResult);
|
|
|
|
|
|
|
|
public:
|
2009-07-13 04:14:57 -07:00
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsCSSStyleDeclSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// CSSRuleList helper
|
|
|
|
|
|
|
|
class nsCSSRuleListSH : public nsArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsCSSRuleListSH(nsDOMClassInfoData* aData) : nsArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsCSSRuleListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-22 07:31:14 -07:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2010-05-09 12:33:00 -07:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsCSSRuleListSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2008-03-11 17:59:15 -07:00
|
|
|
// ClientRectList helper
|
2007-05-30 15:32:54 -07:00
|
|
|
|
2008-03-11 17:59:15 -07:00
|
|
|
class nsClientRectListSH : public nsArraySH
|
2007-05-30 15:32:54 -07:00
|
|
|
{
|
|
|
|
protected:
|
2008-03-11 17:59:15 -07:00
|
|
|
nsClientRectListSH(nsDOMClassInfoData* aData) : nsArraySH(aData)
|
2007-05-30 15:32:54 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-03-11 17:59:15 -07:00
|
|
|
virtual ~nsClientRectListSH()
|
2007-05-30 15:32:54 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-22 07:31:14 -07:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2010-05-09 12:33:00 -07:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult);
|
2007-05-30 15:32:54 -07:00
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
2008-03-11 17:59:15 -07:00
|
|
|
return new nsClientRectListSH(aData);
|
2007-05-30 15:32:54 -07:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2009-09-03 21:49:18 -07:00
|
|
|
// PaintRequestList helper
|
|
|
|
|
|
|
|
class nsPaintRequestListSH : public nsArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsPaintRequestListSH(nsDOMClassInfoData* aData) : nsArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsPaintRequestListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2010-05-09 12:33:00 -07:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult);
|
2009-09-03 21:49:18 -07:00
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsPaintRequestListSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2011-04-26 05:30:17 -07:00
|
|
|
class nsDOMTouchListSH : public nsArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsDOMTouchListSH(nsDOMClassInfoData* aData) : nsArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsDOMTouchListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
nsWrapperCache **aCache, nsresult *aResult);
|
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo* doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsDOMTouchListSH(aData);
|
|
|
|
}
|
|
|
|
};
|
2009-09-03 21:49:18 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
#ifdef MOZ_XUL
|
|
|
|
// TreeColumns helper
|
|
|
|
|
|
|
|
class nsTreeColumnsSH : public nsNamedArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsTreeColumnsSH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsTreeColumnsSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-22 07:31:14 -07:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2010-05-09 12:33:00 -07:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// Override nsNamedArraySH::GetNamedItem()
|
2008-10-31 14:40:35 -07:00
|
|
|
virtual nsISupports* GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
2010-05-09 12:41:19 -07:00
|
|
|
nsWrapperCache **cache,
|
2008-10-31 14:40:35 -07:00
|
|
|
nsresult *aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsTreeColumnsSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// WebApps Storage helpers
|
|
|
|
|
|
|
|
class nsStorageSH : public nsNamedArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsStorageSH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsStorageSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2010-07-14 23:19:36 -07:00
|
|
|
JSObject *obj, jsid id, PRUint32 flags,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject **objp, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD DelProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD NewEnumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 enum_op, jsval *statep,
|
2011-09-28 23:19:26 -07:00
|
|
|
jsid *idp, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-10-22 07:31:14 -07:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2010-05-09 12:33:00 -07:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult)
|
2008-10-22 07:31:14 -07:00
|
|
|
{
|
|
|
|
return nsnull;
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
// Override nsNamedArraySH::GetNamedItem()
|
2008-10-31 14:40:35 -07:00
|
|
|
virtual nsISupports* GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
2010-05-09 12:41:19 -07:00
|
|
|
nsWrapperCache **cache,
|
2008-10-31 14:40:35 -07:00
|
|
|
nsresult *aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsStorageSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2009-03-18 16:43:45 -07:00
|
|
|
|
|
|
|
class nsStorage2SH : public nsDOMGenericSH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsStorage2SH(nsDOMClassInfoData* aData) : nsDOMGenericSH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsStorage2SH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2010-07-14 23:19:36 -07:00
|
|
|
JSObject *obj, jsid id, PRUint32 flags,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject **objp, bool *_retval);
|
2009-03-18 16:43:45 -07:00
|
|
|
NS_IMETHOD SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2009-03-18 16:43:45 -07:00
|
|
|
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2009-03-18 16:43:45 -07:00
|
|
|
NS_IMETHOD DelProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
2009-03-18 16:43:45 -07:00
|
|
|
NS_IMETHOD NewEnumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 enum_op, jsval *statep,
|
2011-09-28 23:19:26 -07:00
|
|
|
jsid *idp, bool *_retval);
|
2009-03-18 16:43:45 -07:00
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsStorage2SH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
class nsStorageListSH : public nsNamedArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsStorageListSH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsStorageListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-22 07:31:14 -07:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2010-05-09 12:33:00 -07:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult)
|
2008-10-22 07:31:14 -07:00
|
|
|
{
|
|
|
|
return nsnull;
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
// Override nsNamedArraySH::GetNamedItem()
|
2008-10-31 14:40:35 -07:00
|
|
|
virtual nsISupports* GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
2010-05-09 12:41:19 -07:00
|
|
|
nsWrapperCache **cache,
|
2008-10-31 14:40:35 -07:00
|
|
|
nsresult *aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsStorageListSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 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
|
|
|
|
};
|
|
|
|
|
|
|
|
class nsDOMConstructorSH : public nsDOMGenericSH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsDOMConstructorSH(nsDOMClassInfoData* aData) : nsDOMGenericSH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
2011-01-11 12:15:52 -08:00
|
|
|
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj);
|
2009-06-03 08:30:18 -07:00
|
|
|
NS_IMETHOD PostCreatePrototype(JSContext * cx, JSObject * proto)
|
|
|
|
{
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2011-09-21 19:16:50 -07:00
|
|
|
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsid id, PRUint32 flags,
|
|
|
|
JSObject **objp, bool *_retval);
|
2007-05-09 05:04:59 -07:00
|
|
|
NS_IMETHOD Call(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 argc, jsval *argv, jsval *vp,
|
2011-09-28 23:19:26 -07:00
|
|
|
bool *_retval);
|
2007-05-09 05:04:59 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD Construct(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 argc, jsval *argv,
|
2011-09-28 23:19:26 -07:00
|
|
|
jsval *vp, bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
NS_IMETHOD HasInstance(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
2011-09-28 23:19:26 -07:00
|
|
|
JSObject *obj, const jsval &val, bool *bp,
|
|
|
|
bool *_retval);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsDOMConstructorSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
// 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 02:45:30 -07: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-24 21:29:47 -07:00
|
|
|
class nsFileListSH : public nsArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsFileListSH(nsDOMClassInfoData *aData) : nsArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsFileListSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-10-22 07:31:14 -07:00
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2010-05-09 12:33:00 -07:00
|
|
|
nsWrapperCache **aCache, nsresult *aResult);
|
2007-07-24 21:29:47 -07:00
|
|
|
|
|
|
|
public:
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsFileListSH(aData);
|
|
|
|
}
|
|
|
|
};
|
2007-05-29 02:45:30 -07:00
|
|
|
|
2010-12-20 20:08:03 -08:00
|
|
|
class nsWebGLViewportHandlerSH : public nsDOMGenericSH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsWebGLViewportHandlerSH(nsDOMClassInfoData *aData) : nsDOMGenericSH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~nsWebGLViewportHandlerSH()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_IMETHOD PostCreatePrototype(JSContext * cx, JSObject * proto) {
|
|
|
|
nsresult rv = nsDOMGenericSH::PostCreatePrototype(cx, proto);
|
|
|
|
if (NS_SUCCEEDED(rv)) {
|
|
|
|
if (!::JS_DefineProperty(cx, proto, "VIEWPORT", INT_TO_JSVAL(0x0BA2),
|
|
|
|
nsnull, nsnull, JSPROP_ENUMERATE))
|
|
|
|
{
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsWebGLViewportHandlerSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2011-04-07 15:44:03 -07:00
|
|
|
|
|
|
|
// Template for SVGXXXList helpers
|
|
|
|
|
|
|
|
template<class ListInterfaceType, class ListType>
|
|
|
|
class nsSVGListSH : public nsArraySH
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
nsSVGListSH(nsDOMClassInfoData* aData) : nsArraySH(aData)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual nsISupports* GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
nsWrapperCache **aCache, nsresult *aResult);
|
|
|
|
|
|
|
|
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
return new nsSVGListSH(aData);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef nsSVGListSH<nsIDOMSVGLengthList, mozilla::DOMSVGLengthList> nsSVGLengthListSH;
|
|
|
|
typedef nsSVGListSH<nsIDOMSVGNumberList, mozilla::DOMSVGNumberList> nsSVGNumberListSH;
|
|
|
|
typedef nsSVGListSH<nsIDOMSVGPathSegList, mozilla::DOMSVGPathSegList> nsSVGPathSegListSH;
|
|
|
|
typedef nsSVGListSH<nsIDOMSVGPointList, mozilla::DOMSVGPointList> nsSVGPointListSH;
|
2011-09-25 14:04:32 -07:00
|
|
|
typedef nsSVGListSH<nsIDOMSVGTransformList, mozilla::DOMSVGTransformList> nsSVGTransformListSH;
|
2011-04-07 15:44:03 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
#endif /* nsDOMClassInfo_h___ */
|