mshtml: Don't share nstextarea reference with nsnode.

This commit is contained in:
Jacek Caban 2014-09-25 12:11:32 +02:00 committed by Alexandre Julliard
parent 01e09bbb47
commit 556b2ad0c5
1 changed files with 30 additions and 7 deletions

View File

@ -411,6 +411,26 @@ static HRESULT HTMLTextAreaElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_
return IHTMLTextAreaElement_get_disabled(&This->IHTMLTextAreaElement_iface, p);
}
static void HTMLTextAreaElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
{
HTMLTextAreaElement *This = impl_from_HTMLDOMNode(iface);
if(This->nstextarea)
note_cc_edge((nsISupports*)This->nstextarea, "This->nstextarea", cb);
}
static void HTMLTextAreaElement_unlink(HTMLDOMNode *iface)
{
HTMLTextAreaElement *This = impl_from_HTMLDOMNode(iface);
if(This->nstextarea) {
nsIDOMHTMLTextAreaElement *nstextarea = This->nstextarea;
This->nstextarea = NULL;
nsIDOMHTMLTextAreaElement_Release(nstextarea);
}
}
static const NodeImplVtbl HTMLTextAreaElementImplVtbl = {
HTMLTextAreaElement_QI,
HTMLElement_destructor,
@ -421,7 +441,14 @@ static const NodeImplVtbl HTMLTextAreaElementImplVtbl = {
NULL,
NULL,
HTMLTextAreaElementImpl_put_disabled,
HTMLTextAreaElementImpl_get_disabled
HTMLTextAreaElementImpl_get_disabled,
NULL,
NULL,
NULL,
NULL,
NULL,
HTMLTextAreaElement_traverse,
HTMLTextAreaElement_unlink
};
static const tid_t HTMLTextAreaElement_iface_tids[] = {
@ -451,12 +478,8 @@ HRESULT HTMLTextAreaElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nse
HTMLElement_Init(&ret->element, doc, nselem, &HTMLTextAreaElement_dispex);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTextAreaElement,
(void**)&ret->nstextarea);
/* Share nstextarea reference with nsnode */
assert(nsres == NS_OK && (nsIDOMNode*)ret->nstextarea == ret->element.node.nsnode);
nsIDOMNode_Release(ret->element.node.nsnode);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTextAreaElement, (void**)&ret->nstextarea);
assert(nsres == NS_OK);
*elem = &ret->element;
return S_OK;