mshtml: Added IHTMLAnchorElement::get_hash implementation.

This commit is contained in:
Jacek Caban 2013-08-28 16:02:00 +02:00 committed by Alexandre Julliard
parent 774f57ca24
commit 366929f16b
2 changed files with 28 additions and 2 deletions

View File

@ -466,8 +466,14 @@ static HRESULT WINAPI HTMLAnchorElement_put_hash(IHTMLAnchorElement *iface, BSTR
static HRESULT WINAPI HTMLAnchorElement_get_hash(IHTMLAnchorElement *iface, BSTR *p) static HRESULT WINAPI HTMLAnchorElement_get_hash(IHTMLAnchorElement *iface, BSTR *p)
{ {
HTMLAnchorElement *This = impl_from_IHTMLAnchorElement(iface); HTMLAnchorElement *This = impl_from_IHTMLAnchorElement(iface);
FIXME("(%p)->(%p)\n", This, p); nsAString hash_str;
return E_NOTIMPL; nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
nsAString_Init(&hash_str, NULL);
nsres = nsIDOMHTMLAnchorElement_GetHash(This->nsanchor, &hash_str);
return return_nsstr(nsres, &hash_str, p);
} }
static HRESULT WINAPI HTMLAnchorElement_put_onblur(IHTMLAnchorElement *iface, VARIANT v) static HRESULT WINAPI HTMLAnchorElement_put_onblur(IHTMLAnchorElement *iface, VARIANT v)

View File

@ -1468,6 +1468,22 @@ static void _test_anchor_hostname(unsigned line, IUnknown *unk, const char *host
SysFreeString(str); SysFreeString(str);
} }
#define test_anchor_hash(a,h) _test_anchor_hash(__LINE__,a,h)
static void _test_anchor_hash(unsigned line, IHTMLElement *elem, const char *exhash)
{
IHTMLAnchorElement *anchor = _get_anchor_iface(line, (IUnknown*)elem);
BSTR str;
HRESULT hres;
hres = IHTMLAnchorElement_get_hash(anchor, &str);
ok_(__FILE__,line)(hres == S_OK, "get_hash failed: %08x\n", hres);
if(exhash)
ok_(__FILE__,line)(!strcmp_wa(str, exhash), "hash = %s, expected %s\n", wine_dbgstr_w(str), exhash);
else
ok_(__FILE__,line)(!str, "hash = %s, expected NULL\n", wine_dbgstr_w(str));
SysFreeString(str);
}
#define test_option_text(o,t) _test_option_text(__LINE__,o,t) #define test_option_text(o,t) _test_option_text(__LINE__,o,t)
static void _test_option_text(unsigned line, IHTMLOptionElement *option, const char *text) static void _test_option_text(unsigned line, IHTMLOptionElement *option, const char *text)
{ {
@ -6380,6 +6396,7 @@ static void test_elems(IHTMLDocument2 *doc)
test_anchor_put_href((IUnknown*)elem, "http://test/"); test_anchor_put_href((IUnknown*)elem, "http://test/");
test_anchor_href((IUnknown*)elem, "http://test/"); test_anchor_href((IUnknown*)elem, "http://test/");
test_anchor_hostname((IUnknown*)elem, "test"); test_anchor_hostname((IUnknown*)elem, "test");
test_anchor_hash(elem, NULL);
/* target */ /* target */
test_anchor_get_target((IUnknown*)elem, NULL); test_anchor_get_target((IUnknown*)elem, NULL);
@ -6401,6 +6418,9 @@ static void test_elems(IHTMLDocument2 *doc)
test_anchor_put_name((IUnknown*)elem, NULL); test_anchor_put_name((IUnknown*)elem, NULL);
test_anchor_put_name((IUnknown*)elem, "x"); test_anchor_put_name((IUnknown*)elem, "x");
test_anchor_put_href((IUnknown*)elem, "http://test/#hash");
test_anchor_hash(elem, "#hash");
IHTMLElement_Release(elem); IHTMLElement_Release(elem);
} }