Commit 727c1ceb authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Don't share nsframe and nsiframe reference with nsnode.

parent 5f149f52
......@@ -266,6 +266,26 @@ static HRESULT HTMLFrameElement_bind_to_tree(HTMLDOMNode *iface)
return hres;
}
static void HTMLFrameElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
{
HTMLFrameElement *This = impl_from_HTMLDOMNode(iface);
if(This->framebase.nsframe)
note_cc_edge((nsISupports*)This->framebase.nsframe, "This->nsframe", cb);
}
static void HTMLFrameElement_unlink(HTMLDOMNode *iface)
{
HTMLFrameElement *This = impl_from_HTMLDOMNode(iface);
if(This->framebase.nsframe) {
nsIDOMHTMLFrameElement *nsframe = This->framebase.nsframe;
This->framebase.nsframe = NULL;
nsIDOMHTMLFrameElement_Release(nsframe);
}
}
static const NodeImplVtbl HTMLFrameElementImplVtbl = {
HTMLFrameElement_QI,
HTMLFrameElement_destructor,
......@@ -281,7 +301,9 @@ static const NodeImplVtbl HTMLFrameElementImplVtbl = {
HTMLFrameElement_get_readystate,
HTMLFrameElement_get_dispid,
HTMLFrameElement_invoke,
HTMLFrameElement_bind_to_tree
HTMLFrameElement_bind_to_tree,
HTMLFrameElement_traverse,
HTMLFrameElement_unlink
};
static const tid_t HTMLFrameElement_iface_tids[] = {
......
......@@ -707,12 +707,9 @@ void HTMLFrameBase_Init(HTMLFrameBase *This, HTMLDocumentNode *doc, nsIDOMHTMLEl
if(NS_FAILED(nsres)) {
This->nsframe = NULL;
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLIFrameElement, (void**)&This->nsiframe);
assert(nsres == NS_OK && (nsIDOMNode*)This->nsiframe == This->element.node.nsnode);
assert(nsres == NS_OK);
}else {
assert((nsIDOMNode*)This->nsframe == This->element.node.nsnode);
This->nsiframe = NULL;
}
/* Share the reference with nsnode */
nsIDOMNode_Release(This->element.node.nsnode);
}
......@@ -539,6 +539,26 @@ static HRESULT HTMLIFrame_bind_to_tree(HTMLDOMNode *iface)
return hres;
}
static void HTMLIFrame_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
{
HTMLIFrame *This = impl_from_HTMLDOMNode(iface);
if(This->framebase.nsiframe)
note_cc_edge((nsISupports*)This->framebase.nsiframe, "This->nsiframe", cb);
}
static void HTMLIFrame_unlink(HTMLDOMNode *iface)
{
HTMLIFrame *This = impl_from_HTMLDOMNode(iface);
if(This->framebase.nsiframe) {
nsIDOMHTMLIFrameElement *nsiframe = This->framebase.nsiframe;
This->framebase.nsiframe = NULL;
nsIDOMHTMLIFrameElement_Release(nsiframe);
}
}
static const NodeImplVtbl HTMLIFrameImplVtbl = {
HTMLIFrame_QI,
HTMLIFrame_destructor,
......@@ -554,7 +574,9 @@ static const NodeImplVtbl HTMLIFrameImplVtbl = {
HTMLIFrame_get_readystate,
HTMLIFrame_get_dispid,
HTMLIFrame_invoke,
HTMLIFrame_bind_to_tree
HTMLIFrame_bind_to_tree,
HTMLIFrame_traverse,
HTMLIFrame_unlink
};
static const tid_t HTMLIFrame_iface_tids[] = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment