mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-30 04:38:32 +00:00
mshtml: Implement MarkupServices_ParseString.
This commit is contained in:
parent
f9a8f2f1a3
commit
f9af971bd7
|
@ -4823,9 +4823,53 @@ static HRESULT WINAPI MarkupServices_ParseString(IMarkupServices *iface,
|
||||||
OLECHAR *pchHTML, DWORD dwFlags, IMarkupContainer **ppContainerResult,
|
OLECHAR *pchHTML, DWORD dwFlags, IMarkupContainer **ppContainerResult,
|
||||||
IMarkupPointer *pPointerStart, IMarkupPointer *pPointerFinish)
|
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);
|
HTMLDocumentNode *This = impl_from_IMarkupServices(iface);
|
||||||
FIXME("(%p)->(%s,%lx,%p,%p,%p)\n", This, debugstr_w(pchHTML), dwFlags, ppContainerResult, pPointerStart, pPointerFinish);
|
TRACE("(%p)->(%s,%lx,%p,%p,%p)\n", This, debugstr_w(pchHTML), dwFlags, ppContainerResult, pPointerStart, pPointerFinish);
|
||||||
return E_NOTIMPL;
|
|
||||||
|
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,
|
static HRESULT WINAPI MarkupServices_ParseGlobal(IMarkupServices *iface,
|
||||||
|
|
|
@ -8428,8 +8428,8 @@ static void test_MarkupServices_ParseString(IMarkupServices *markup_services, IH
|
||||||
IMarkupContainer *markup_container = NULL;
|
IMarkupContainer *markup_container = NULL;
|
||||||
|
|
||||||
hres = IMarkupServices_ParseString(markup_services, (OLECHAR*)L"<div>Hello World</div>", 0, &markup_container, NULL, 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);
|
ok(hres == S_OK, "got 0x%08lx\n", hres);
|
||||||
todo_wine ok(markup_container != NULL, "MarkupContainer is null.\n");
|
ok(markup_container != NULL, "MarkupContainer is null.\n");
|
||||||
if (!markup_container) return;
|
if (!markup_container) return;
|
||||||
|
|
||||||
hres = IMarkupContainer_QueryInterface(markup_container, &IID_IHTMLDocument2, (void**)&markup_container_doc);
|
hres = IMarkupContainer_QueryInterface(markup_container, &IID_IHTMLDocument2, (void**)&markup_container_doc);
|
||||||
|
|
Loading…
Reference in a new issue