Jacek Caban : mshtml: Don' t assume that nsIDOMHTML*Element interfaces inherit from nsIDOMHTMLElement in htmlscript.c.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Oct 1 14:34:31 CDT 2014
Module: wine
Branch: master
Commit: b2c65c296f3664c78eba9665fd731c9f4c3d76ce
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b2c65c296f3664c78eba9665fd731c9f4c3d76ce
Author: Jacek Caban <jacek at codeweavers.com>
Date: Wed Oct 1 11:23:47 2014 +0200
mshtml: Don't assume that nsIDOMHTML*Element interfaces inherit from nsIDOMHTMLElement in htmlscript.c.
---
dlls/mshtml/htmlscript.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/dlls/mshtml/htmlscript.c b/dlls/mshtml/htmlscript.c
index dcab32f..1a61398 100644
--- a/dlls/mshtml/htmlscript.c
+++ b/dlls/mshtml/htmlscript.c
@@ -136,7 +136,7 @@ static HRESULT WINAPI HTMLScriptElement_put_src(IHTMLScriptElement *iface, BSTR
return S_OK;
}
- nsres = nsIDOMHTMLScriptElement_GetParentNode(This->nsscript, &parent);
+ nsres = nsIDOMHTMLElement_GetParentNode(This->element.nselem, &parent);
if(NS_FAILED(nsres) || !parent) {
TRACE("No parent, not executing\n");
This->parse_on_bind = TRUE;
@@ -214,7 +214,7 @@ static HRESULT WINAPI HTMLScriptElement_put_text(IHTMLScriptElement *iface, BSTR
return E_FAIL;
}
- nsres = nsIDOMHTMLScriptElement_GetParentNode(This->nsscript, &parent);
+ nsres = nsIDOMHTMLElement_GetParentNode(This->element.nselem, &parent);
if(NS_FAILED(nsres) || !parent) {
TRACE("No parent, not executing\n");
This->parse_on_bind = TRUE;
@@ -433,10 +433,16 @@ static const NodeImplVtbl HTMLScriptElementImplVtbl = {
HRESULT script_elem_from_nsscript(HTMLDocumentNode *doc, nsIDOMHTMLScriptElement *nsscript, HTMLScriptElement **ret)
{
+ nsIDOMNode *nsnode;
HTMLDOMNode *node;
+ nsresult nsres;
HRESULT hres;
- hres = get_node(doc, (nsIDOMNode*)nsscript, TRUE, &node);
+ nsres = nsIDOMHTMLScriptElement_QueryInterface(nsscript, &IID_nsIDOMNode, (void**)&nsnode);
+ assert(nsres == NS_OK);
+
+ hres = get_node(doc, nsnode, TRUE, &node);
+ nsIDOMNode_Release(nsnode);
if(FAILED(hres))
return hres;
More information about the wine-cvs
mailing list