Module: wine Branch: master Commit: 071f38b123c881b9356f1f17350a9be458b76e12 URL: https://gitlab.winehq.org/wine/wine/-/commit/071f38b123c881b9356f1f17350a9be...
Author: Santino Mazza smazza@codeweavers.com Date: Mon Dec 19 10:39:07 2022 -0300
mshtml: Use This->node for HTMLDocument_get_all.
---
dlls/mshtml/htmldoc.c | 30 ++---------------------------- dlls/mshtml/tests/dom.c | 8 ++++---- 2 files changed, 6 insertions(+), 32 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 90c4706abee..7b71ec1c1ae 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -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) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index e817438fa48..4e92c1c1447 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -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);