Commit f2b32208 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Share nsscript reference with nsnode.

parent e45c6217
......@@ -17,6 +17,7 @@
*/
#include <stdarg.h>
#include <assert.h>
#define COBJMACROS
......@@ -305,12 +306,6 @@ static HRESULT HTMLScriptElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
return HTMLElement_QI(&This->element.node, riid, ppv);
}
static void HTMLScriptElement_destructor(HTMLDOMNode *iface)
{
HTMLScriptElement *This = impl_from_HTMLDOMNode(iface);
HTMLElement_destructor(&This->element.node);
}
static HRESULT HTMLScriptElement_get_readystate(HTMLDOMNode *iface, BSTR *p)
{
HTMLScriptElement *This = impl_from_HTMLDOMNode(iface);
......@@ -320,7 +315,7 @@ static HRESULT HTMLScriptElement_get_readystate(HTMLDOMNode *iface, BSTR *p)
static const NodeImplVtbl HTMLScriptElementImplVtbl = {
HTMLScriptElement_QI,
HTMLScriptElement_destructor,
HTMLElement_destructor,
HTMLElement_clone,
HTMLElement_get_attr_col,
NULL,
......@@ -357,14 +352,13 @@ HRESULT HTMLScriptElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nsele
ret->IHTMLScriptElement_iface.lpVtbl = &HTMLScriptElementVtbl;
ret->element.node.vtbl = &HTMLScriptElementImplVtbl;
HTMLElement_Init(&ret->element, doc, nselem, &HTMLScriptElement_dispex);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLScriptElement, (void**)&ret->nsscript);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIDOMHTMLScriptElement: %08x\n", nsres);
heap_free(ret);
return E_FAIL;
}
HTMLElement_Init(&ret->element, doc, nselem, &HTMLScriptElement_dispex);
/* Share nsscript reference with nsnode */
assert(nsres == NS_OK && (nsIDOMNode*)ret->nsscript == ret->element.node.nsnode);
nsIDOMNode_Release(ret->element.node.nsnode);
*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