mshtml: Don't share nsoption reference with nsnode.
This commit is contained in:
parent
cac39acbe3
commit
01e09bbb47
|
@ -311,13 +311,44 @@ static HRESULT HTMLOptionElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
||||||
return HTMLElement_QI(&This->element.node, riid, ppv);
|
return HTMLElement_QI(&This->element.node, riid, ppv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void HTMLOptionElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
|
||||||
|
{
|
||||||
|
HTMLOptionElement *This = impl_from_HTMLDOMNode(iface);
|
||||||
|
|
||||||
|
if(This->nsoption)
|
||||||
|
note_cc_edge((nsISupports*)This->nsoption, "This->nsoption", cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void HTMLOptionElement_unlink(HTMLDOMNode *iface)
|
||||||
|
{
|
||||||
|
HTMLOptionElement *This = impl_from_HTMLDOMNode(iface);
|
||||||
|
|
||||||
|
if(This->nsoption) {
|
||||||
|
nsIDOMHTMLOptionElement *nsoption = This->nsoption;
|
||||||
|
|
||||||
|
This->nsoption = NULL;
|
||||||
|
nsIDOMHTMLOptionElement_Release(nsoption);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static const NodeImplVtbl HTMLOptionElementImplVtbl = {
|
static const NodeImplVtbl HTMLOptionElementImplVtbl = {
|
||||||
HTMLOptionElement_QI,
|
HTMLOptionElement_QI,
|
||||||
HTMLElement_destructor,
|
HTMLElement_destructor,
|
||||||
HTMLElement_cpc,
|
HTMLElement_cpc,
|
||||||
HTMLElement_clone,
|
HTMLElement_clone,
|
||||||
HTMLElement_handle_event,
|
HTMLElement_handle_event,
|
||||||
HTMLElement_get_attr_col
|
HTMLElement_get_attr_col,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
HTMLOptionElement_traverse,
|
||||||
|
HTMLOptionElement_unlink
|
||||||
};
|
};
|
||||||
|
|
||||||
static const tid_t HTMLOptionElement_iface_tids[] = {
|
static const tid_t HTMLOptionElement_iface_tids[] = {
|
||||||
|
@ -347,10 +378,7 @@ HRESULT HTMLOptionElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nsele
|
||||||
HTMLElement_Init(&ret->element, doc, nselem, &HTMLOptionElement_dispex);
|
HTMLElement_Init(&ret->element, doc, nselem, &HTMLOptionElement_dispex);
|
||||||
|
|
||||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLOptionElement, (void**)&ret->nsoption);
|
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLOptionElement, (void**)&ret->nsoption);
|
||||||
|
assert(nsres == NS_OK);
|
||||||
/* Share nsoption reference with nsnode */
|
|
||||||
assert(nsres == NS_OK && (nsIDOMNode*)ret->nsoption == ret->element.node.nsnode);
|
|
||||||
nsIDOMNode_Release(ret->element.node.nsnode);
|
|
||||||
|
|
||||||
*elem = &ret->element;
|
*elem = &ret->element;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
Loading…
Reference in New Issue