Commit 4719c438 authored by Zhenbo Li's avatar Zhenbo Li Committed by Alexandre Julliard

mshtml: Added IHTMLDocument2:toString method.

parent 0547c0d2
...@@ -1578,8 +1578,17 @@ static HRESULT WINAPI HTMLDocument_get_onerrorupdate(IHTMLDocument2 *iface, VARI ...@@ -1578,8 +1578,17 @@ static HRESULT WINAPI HTMLDocument_get_onerrorupdate(IHTMLDocument2 *iface, VARI
static HRESULT WINAPI HTMLDocument_toString(IHTMLDocument2 *iface, BSTR *String) static HRESULT WINAPI HTMLDocument_toString(IHTMLDocument2 *iface, BSTR *String)
{ {
HTMLDocument *This = impl_from_IHTMLDocument2(iface); HTMLDocument *This = impl_from_IHTMLDocument2(iface);
FIXME("(%p)->(%p)\n", This, String);
return E_NOTIMPL; static const WCHAR objectW[] = {'[','o','b','j','e','c','t',']',0};
TRACE("(%p)->(%p)\n", This, String);
if(!String)
return E_INVALIDARG;
*String = SysAllocString(objectW);
return *String ? S_OK : E_OUTOFMEMORY;
} }
static HRESULT WINAPI HTMLDocument_createStyleSheet(IHTMLDocument2 *iface, BSTR bstrHref, static HRESULT WINAPI HTMLDocument_createStyleSheet(IHTMLDocument2 *iface, BSTR bstrHref,
......
...@@ -5243,10 +5243,17 @@ static void test_doc_elem(IHTMLDocument2 *doc) ...@@ -5243,10 +5243,17 @@ static void test_doc_elem(IHTMLDocument2 *doc)
IHTMLElement *elem; IHTMLElement *elem;
IHTMLDocument3 *doc3; IHTMLDocument3 *doc3;
HRESULT hres; HRESULT hres;
BSTR bstr;
hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument3, (void**)&doc3); hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument3, (void**)&doc3);
ok(hres == S_OK, "QueryInterface(IID_IHTMLDocument3) failed: %08x\n", hres); ok(hres == S_OK, "QueryInterface(IID_IHTMLDocument3) failed: %08x\n", hres);
hres = IHTMLDocument2_toString(doc, &bstr);
ok(hres == S_OK, "toString failed: %08x\n", hres);
ok(!strcmp_wa(bstr, "[object]"),
"toString returned %s, expected [object]\n", wine_dbgstr_w(bstr));
SysFreeString(bstr);
hres = IHTMLDocument3_get_documentElement(doc3, &elem); hres = IHTMLDocument3_get_documentElement(doc3, &elem);
IHTMLDocument3_Release(doc3); IHTMLDocument3_Release(doc3);
ok(hres == S_OK, "get_documentElement failed: %08x\n", hres); ok(hres == S_OK, "get_documentElement failed: %08x\n", hres);
......
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