Commit 316417cc authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Don't share nsstyle reference with nsnode.

parent 727c1ceb
......@@ -319,13 +319,44 @@ static void HTMLStyleElement_destructor(HTMLDOMNode *iface)
HTMLElement_destructor(iface);
}
static void HTMLStyleElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
{
HTMLStyleElement *This = impl_from_HTMLDOMNode(iface);
if(This->nsstyle)
note_cc_edge((nsISupports*)This->nsstyle, "This->nsstyle", cb);
}
static void HTMLStyleElement_unlink(HTMLDOMNode *iface)
{
HTMLStyleElement *This = impl_from_HTMLDOMNode(iface);
if(This->nsstyle) {
nsIDOMHTMLStyleElement *nsstyle = This->nsstyle;
This->nsstyle = NULL;
nsIDOMHTMLStyleElement_Release(nsstyle);
}
}
static const NodeImplVtbl HTMLStyleElementImplVtbl = {
HTMLStyleElement_QI,
HTMLStyleElement_destructor,
HTMLElement_cpc,
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col
HTMLElement_get_attr_col,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
HTMLStyleElement_traverse,
HTMLStyleElement_unlink
};
static const tid_t HTMLStyleElement_iface_tids[] = {
......@@ -355,10 +386,7 @@ HRESULT HTMLStyleElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem
HTMLElement_Init(&ret->element, doc, nselem, &HTMLStyleElement_dispex);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLStyleElement, (void**)&ret->nsstyle);
/* Share nsstyle reference with nsnode */
assert(nsres == NS_OK && (nsIDOMNode*)ret->nsstyle == ret->element.node.nsnode);
nsIDOMNode_Release(ret->element.node.nsnode);
assert(nsres == NS_OK);
*elem = &ret->element;
return S_OK;
......
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