1
0
mirror of https://github.com/wine-mirror/wine synced 2024-06-29 06:14:34 +00:00

mshtml: Implement MarkupServices_ParseString.

This commit is contained in:
Santino Mazza 2022-12-20 13:22:58 -03:00 committed by Alexandre Julliard
parent f9a8f2f1a3
commit f9af971bd7
2 changed files with 48 additions and 4 deletions

View File

@ -4823,9 +4823,53 @@ static HRESULT WINAPI MarkupServices_ParseString(IMarkupServices *iface,
OLECHAR *pchHTML, DWORD dwFlags, IMarkupContainer **ppContainerResult,
IMarkupPointer *pPointerStart, IMarkupPointer *pPointerFinish)
{
HRESULT hres;
IMarkupContainer *container;
IHTMLDocument2 *doc;
IHTMLDOMNode *node, *html_node, *new_html_node = NULL;
IHTMLElement *html, *body;
HTMLDocumentNode *This = impl_from_IMarkupServices(iface);
FIXME("(%p)->(%s,%lx,%p,%p,%p)\n", This, debugstr_w(pchHTML), dwFlags, ppContainerResult, pPointerStart, pPointerFinish);
return E_NOTIMPL;
TRACE("(%p)->(%s,%lx,%p,%p,%p)\n", This, debugstr_w(pchHTML), dwFlags, ppContainerResult, pPointerStart, pPointerFinish);
if(dwFlags != 0)
FIXME("flags %lx not implemented.\n", dwFlags);
if(pPointerStart || pPointerFinish) {
FIXME("Pointers not implemented.\n");
return E_NOTIMPL;
}
hres = IMarkupServices_CreateMarkupContainer(iface, &container);
if(FAILED(hres))
return hres;
IMarkupContainer_QueryInterface(container, &IID_IHTMLDocument2, (void**)&doc);
IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDOMNode, (void**)&node);
IHTMLDocument2_createElement(&This->IHTMLDocument2_iface, (BSTR)L"html", &html);
IHTMLElement_put_innerHTML(html, (BSTR)L"<head><title></title></head><body></body>");
IHTMLElement_QueryInterface(html, &IID_IHTMLDOMNode, (void**)&html_node);
IHTMLElement_Release(html);
IHTMLDOMNode_appendChild(node, html_node, &new_html_node);
IHTMLDOMNode_Release(node);
IHTMLDOMNode_Release(html_node);
IHTMLDOMNode_Release(new_html_node);
IHTMLDocument2_get_body(doc, &body);
hres = IHTMLElement_put_innerHTML(body, pchHTML);
if (FAILED(hres))
{
ERR("Failed put_innerHTML hr %#lx\n", hres);
IMarkupContainer_Release(container);
container = NULL;
}
IHTMLDocument2_Release(doc);
IHTMLElement_Release(body);
*ppContainerResult = container;
return hres;
}
static HRESULT WINAPI MarkupServices_ParseGlobal(IMarkupServices *iface,

View File

@ -8428,8 +8428,8 @@ static void test_MarkupServices_ParseString(IMarkupServices *markup_services, IH
IMarkupContainer *markup_container = NULL;
hres = IMarkupServices_ParseString(markup_services, (OLECHAR*)L"<div>Hello World</div>", 0, &markup_container, NULL, NULL);
todo_wine ok(hres == S_OK, "got 0x%08lx\n", hres);
todo_wine ok(markup_container != NULL, "MarkupContainer is null.\n");
ok(hres == S_OK, "got 0x%08lx\n", hres);
ok(markup_container != NULL, "MarkupContainer is null.\n");
if (!markup_container) return;
hres = IMarkupContainer_QueryInterface(markup_container, &IID_IHTMLDocument2, (void**)&markup_container_doc);