mshtml: Don't share nscell reference with nsnode.
This commit is contained in:
parent
e5e0fc3019
commit
d2a97e73eb
|
@ -398,13 +398,44 @@ static void HTMLTableCell_destructor(HTMLDOMNode *iface)
|
||||||
HTMLElement_destructor(&This->element.node);
|
HTMLElement_destructor(&This->element.node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void HTMLTableCell_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
|
||||||
|
{
|
||||||
|
HTMLTableCell *This = impl_from_HTMLDOMNode(iface);
|
||||||
|
|
||||||
|
if(This->nscell)
|
||||||
|
note_cc_edge((nsISupports*)This->nscell, "This->nstablecell", cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void HTMLTableCell_unlink(HTMLDOMNode *iface)
|
||||||
|
{
|
||||||
|
HTMLTableCell *This = impl_from_HTMLDOMNode(iface);
|
||||||
|
|
||||||
|
if(This->nscell) {
|
||||||
|
nsIDOMHTMLTableCellElement *nscell = This->nscell;
|
||||||
|
|
||||||
|
This->nscell = NULL;
|
||||||
|
nsIDOMHTMLTableCellElement_Release(nscell);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static const NodeImplVtbl HTMLTableCellImplVtbl = {
|
static const NodeImplVtbl HTMLTableCellImplVtbl = {
|
||||||
HTMLTableCell_QI,
|
HTMLTableCell_QI,
|
||||||
HTMLTableCell_destructor,
|
HTMLTableCell_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,
|
||||||
|
HTMLTableCell_traverse,
|
||||||
|
HTMLTableCell_unlink
|
||||||
};
|
};
|
||||||
|
|
||||||
static const tid_t HTMLTableCell_iface_tids[] = {
|
static const tid_t HTMLTableCell_iface_tids[] = {
|
||||||
|
@ -435,10 +466,7 @@ HRESULT HTMLTableCell_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, H
|
||||||
HTMLElement_Init(&ret->element, doc, nselem, &HTMLTableCell_dispex);
|
HTMLElement_Init(&ret->element, doc, nselem, &HTMLTableCell_dispex);
|
||||||
|
|
||||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTableCellElement, (void**)&ret->nscell);
|
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTableCellElement, (void**)&ret->nscell);
|
||||||
|
assert(nsres == NS_OK);
|
||||||
/* Share nscell reference with nsnode */
|
|
||||||
assert(nsres == NS_OK && (nsIDOMNode*)ret->nscell == 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