mshtml: Added IHTMLDocument2:toString method.

This commit is contained in:
Zhenbo Li 2014-05-31 19:51:07 +08:00 committed by Alexandre Julliard
parent 0547c0d236
commit 4719c438a9
2 changed files with 18 additions and 2 deletions

View File

@ -1578,8 +1578,17 @@ static HRESULT WINAPI HTMLDocument_get_onerrorupdate(IHTMLDocument2 *iface, VARI
static HRESULT WINAPI HTMLDocument_toString(IHTMLDocument2 *iface, BSTR *String)
{
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,

View File

@ -5243,10 +5243,17 @@ static void test_doc_elem(IHTMLDocument2 *doc)
IHTMLElement *elem;
IHTMLDocument3 *doc3;
HRESULT hres;
BSTR bstr;
hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument3, (void**)&doc3);
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);
IHTMLDocument3_Release(doc3);
ok(hres == S_OK, "get_documentElement failed: %08x\n", hres);