diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index b8a7e8a3603..862d2812c4f 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -42,7 +42,7 @@ static const char range_test2_str[] =
static const char elem_test_str[] =
"
test"
"text test"
- "link"
+ "link"
""
""
""
@@ -610,6 +610,17 @@ static IHTMLImgElement *_get_img_iface(unsigned line, IUnknown *unk)
return img;
}
+#define get_anchor_iface(u) _get_anchor_iface(__LINE__,u)
+static IHTMLAnchorElement *_get_anchor_iface(unsigned line, IUnknown *unk)
+{
+ IHTMLAnchorElement *anchor;
+ HRESULT hres;
+
+ hres = IUnknown_QueryInterface(unk, &IID_IHTMLAnchorElement, (void**)&anchor);
+ ok_(__FILE__,line) (hres == S_OK, "Could not get IHTMLAnchorElement: %08x\n", hres);
+ return anchor;
+}
+
#define test_node_name(u,n) _test_node_name(__LINE__,u,n)
static void _test_node_name(unsigned line, IUnknown *unk, const char *exname)
{
@@ -898,6 +909,21 @@ static IHTMLElement *_get_doc_elem(unsigned line, IHTMLDocument2 *doc)
return elem;
}
+#define test_anchor_href(a,h) _test_anchor_href(__LINE__,a,h)
+static void _test_anchor_href(unsigned line, IUnknown *unk, const char *exhref)
+{
+ IHTMLAnchorElement *anchor = _get_anchor_iface(line, unk);
+ BSTR str;
+ HRESULT hres;
+
+ hres = IHTMLAnchorElement_get_href(anchor, &str);
+ ok_(__FILE__,line)(hres == S_OK, "get_href failed: %08x\n", hres);
+ ok_(__FILE__,line)(!strcmp_wa(str, exhref), "href = %s, expected %s\n", wine_dbgstr_w(str), exhref);
+ SysFreeString(str);
+
+ _test_disp_value(line, unk, exhref);
+}
+
#define test_option_text(o,t) _test_option_text(__LINE__,o,t)
static void _test_option_text(unsigned line, IHTMLOptionElement *option, const char *text)
{
@@ -4932,6 +4958,12 @@ static void test_elems(IHTMLDocument2 *doc)
IHTMLElement_Release(elem);
}
+ elem = get_elem_by_id(doc, "a", TRUE);
+ if(elem) {
+ test_anchor_href((IUnknown*)elem, "http://test/");
+ IHTMLElement_Release(elem);
+ }
+
hres = IHTMLDocument2_get_body(doc, &elem);
ok(hres == S_OK, "get_body failed: %08x\n", hres);