mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 480975 - Make document fragments participate correctly in the wrapper cache. r+sr=jst
This commit is contained in:
parent
c0d5aa90c8
commit
53cf9b6134
@ -637,8 +637,9 @@ static nsDOMClassInfoData sClassInfoData[] = {
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CLASSINFO_DATA(DOMException, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CLASSINFO_DATA(DocumentFragment, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CLASSINFO_DATA(DocumentFragment, nsDocumentFragmentSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS |
|
||||
nsIXPCScriptable::WANT_FINALIZE)
|
||||
NS_DEFINE_CLASSINFO_DATA(Element, nsElementSH,
|
||||
ELEMENT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CLASSINFO_DATA(Attr, nsAttributeSH,
|
||||
@ -7117,7 +7118,29 @@ nsNodeSH::Finalize(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
// DocumentFragment helper.
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocumentFragmentSH::PostCreate(nsIXPConnectWrappedNative *wrapper,
|
||||
JSContext *cx, JSObject *obj)
|
||||
{
|
||||
nsINode* node = static_cast<nsINode*>(wrapper->Native());
|
||||
node->SetWrapper(wrapper);
|
||||
|
||||
return nsDOMGenericSH::PostCreate(wrapper, cx, obj);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocumentFragmentSH::Finalize(nsIXPConnectWrappedNative *wrapper,
|
||||
JSContext *cx, JSObject *obj)
|
||||
{
|
||||
nsINode* node = static_cast<nsINode*>(wrapper->Native());
|
||||
node->ClearWrapper();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// EventReceiver helper
|
||||
|
||||
// static
|
||||
|
@ -354,6 +354,30 @@ public:
|
||||
|
||||
typedef nsDOMClassInfo nsDOMGenericSH;
|
||||
|
||||
class nsDocumentFragmentSH : public nsDOMGenericSH
|
||||
{
|
||||
protected:
|
||||
nsDocumentFragmentSH(nsDOMClassInfoData* aData) : nsDOMGenericSH(aData)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~nsDocumentFragmentSH()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
NS_IMETHOD PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
||||
JSObject *obj);
|
||||
NS_IMETHOD Finalize(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
||||
JSObject *obj);
|
||||
|
||||
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
||||
{
|
||||
return new nsDocumentFragmentSH(aData);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// EventProp scriptable helper, this class should be the base class of
|
||||
// all objects that should support things like
|
||||
// obj.onclick=function{...}
|
||||
|
Loading…
Reference in New Issue
Block a user