Commit 071f38b1 authored by Santino Mazza's avatar Santino Mazza Committed by Alexandre Julliard

mshtml: Use This->node for HTMLDocument_get_all.

parent d8030d15
......@@ -487,37 +487,11 @@ static HRESULT WINAPI HTMLDocument_get_Script(IHTMLDocument2 *iface, IDispatch *
static HRESULT WINAPI HTMLDocument_get_all(IHTMLDocument2 *iface, IHTMLElementCollection **p)
{
HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface);
nsIDOMElement *nselem = NULL;
HTMLDOMNode *node;
nsresult nsres;
HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
*p = create_all_collection(&This->node, FALSE);
if(!This->dom_document) {
WARN("NULL dom_document\n");
return E_UNEXPECTED;
}
nsres = nsIDOMDocument_GetDocumentElement(This->dom_document, &nselem);
if(NS_FAILED(nsres)) {
ERR("GetDocumentElement failed: %08lx\n", nsres);
return E_FAIL;
}
if(!nselem) {
*p = NULL;
return S_OK;
}
hres = get_node((nsIDOMNode*)nselem, TRUE, &node);
nsIDOMElement_Release(nselem);
if(FAILED(hres))
return hres;
*p = create_all_collection(node, TRUE);
node_release(node);
return hres;
return S_OK;
}
static HRESULT WINAPI HTMLDocument_get_body(IHTMLDocument2 *iface, IHTMLElement **p)
......
......@@ -11026,8 +11026,8 @@ static void test_docfrag(IHTMLDocument2 *doc)
col = NULL;
hres = IHTMLDocument2_get_all(frag, &col);
todo_wine ok(hres == S_OK, "get_all failed: %08lx\n", hres);
todo_wine ok(col != NULL, "got null elements collection\n");
ok(hres == S_OK, "get_all failed: %08lx\n", hres);
ok(col != NULL, "got null elements collection\n");
if (col) {
test_elem_collection((IUnknown *) col, empty_types, ARRAY_SIZE(empty_types));
IHTMLElementCollection_Release(col);
......@@ -11090,8 +11090,8 @@ static void test_docfrag(IHTMLDocument2 *doc)
col = NULL;
hres = IHTMLDocument2_get_all(frag, &col);
todo_wine ok(hres == S_OK, "get_all failed: %08lx\n", hres);
todo_wine ok(col != NULL, "got null elements collection\n");
ok(hres == S_OK, "get_all failed: %08lx\n", hres);
ok(col != NULL, "got null elements collection\n");
if (col) {
test_elem_collection((IUnknown *) col, frag_types, ARRAY_SIZE(frag_types));
IHTMLElementCollection_Release(col);
......
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