mshtml: Implement IHTMLScriptElement_put_src
André Hentschel
nerv at dawncrow.de
Fri Jun 15 16:45:55 CDT 2012
---
dlls/mshtml/htmlscript.c | 14 ++++++++++++--
dlls/mshtml/tests/dom.c | 6 ++++++
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmlscript.c b/dlls/mshtml/htmlscript.c
index 376db7b..1714cfe 100644
--- a/dlls/mshtml/htmlscript.c
+++ b/dlls/mshtml/htmlscript.c
@@ -101,8 +101,18 @@ static HRESULT WINAPI HTMLScriptElement_Invoke(IHTMLScriptElement *iface, DISPID
static HRESULT WINAPI HTMLScriptElement_put_src(IHTMLScriptElement *iface, BSTR v)
{
HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface);
- FIXME("(%p)->(%s)\n", This, debugstr_w(v));
- return E_NOTIMPL;
+ nsAString src_str;
+ nsresult nsres;
+
+ TRACE("(%p)->(%s)\n", This, debugstr_w(v));
+
+ nsAString_Init(&src_str, v);
+ nsres = nsIDOMHTMLScriptElement_SetSrc(This->nsscript, &src_str);
+ if (NS_FAILED(nsres))
+ ERR("SetSrc failed: %08x\n", nsres);
+ nsAString_Finish (&src_str);
+
+ return S_OK;
}
static HRESULT WINAPI HTMLScriptElement_get_src(IHTMLScriptElement *iface, BSTR *p)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index b40fe5d..90b52bf 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -5253,6 +5253,12 @@ static void test_elems(IHTMLDocument2 *doc)
hres = IHTMLScriptElement_get_src(script, &str);
ok(hres == S_OK, "get_src failed: %08x\n", hres);
ok(!str, "src = %s\n", wine_dbgstr_w(str));
+
+ hres = IHTMLScriptElement_put_src (script, NULL);
+ ok(hres == S_OK, "put_src failed: %08x\n", hres);
+
+ hres = IHTMLScriptElement_put_src (script, a2bstr ("nonexisting.js"));
+ ok(hres == S_OK, "put_src failed: %08x\n", hres);
}
IHTMLScriptElement_Release(script);
--
1.7.4.1
--
Best Regards, André Hentschel
More information about the wine-patches
mailing list