From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmldoc.c | 21 ++++++++++----------- dlls/mshtml/tests/xhr.js | 2 ++ 2 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 821edb40a26..b1286d1c19c 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -613,21 +613,20 @@ static HRESULT WINAPI HTMLDocument_get_anchors(IHTMLDocument2 *iface, IHTMLEleme return E_UNEXPECTED; }
- if(!This->html_document) { - FIXME("Not implemented for XML document\n"); - return E_NOTIMPL; - } + if(This->is_xhtml) + FIXME("Not implemented for XHTML Document, returning empty list\n");
- nsres = nsIDOMHTMLDocument_GetAnchors(This->html_document, &nscoll); - if(NS_FAILED(nsres)) { - ERR("GetAnchors failed: %08lx\n", nsres); - return E_FAIL; + if(This->html_document) { + nsres = nsIDOMHTMLDocument_GetAnchors(This->html_document, &nscoll); + if(NS_FAILED(nsres)) { + ERR("GetAnchors failed: %08lx\n", nsres); + return E_FAIL; + } }
- if(nscoll) { - *p = create_collection_from_htmlcol(nscoll, &This->node.event_target.dispex); + *p = create_collection_from_htmlcol(nscoll, &This->node.event_target.dispex); + if(nscoll) nsIDOMHTMLCollection_Release(nscoll); - }
return S_OK; } diff --git a/dlls/mshtml/tests/xhr.js b/dlls/mshtml/tests/xhr.js index 7c553dc25ea..7685a5a8486 100644 --- a/dlls/mshtml/tests/xhr.js +++ b/dlls/mshtml/tests/xhr.js @@ -49,6 +49,8 @@ async_test("async_xhr", function() { }else { ok("anchors" in x, "anchors not in returned XML document"); ok(!x.hasOwnProperty("createElement"), "createElement is a prop of returned XML document"); + r = x.anchors; + ok(r.length === 0, "anchors.length of returned XML document = " + r.length); }
if(complete_cnt++ && !("onloadend" in xhr))