mshtml: Don't share nsstyle reference with nsnode.
This commit is contained in:
parent
727c1ceb1e
commit
316417cc3d
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue