mshtml: Add IHTMLAnchorElement::get_host implementation.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
971ee04c7f
commit
4bdd24292d
|
@ -440,8 +440,15 @@ static HRESULT WINAPI HTMLAnchorElement_put_host(IHTMLAnchorElement *iface, BSTR
|
|||
static HRESULT WINAPI HTMLAnchorElement_get_host(IHTMLAnchorElement *iface, BSTR *p)
|
||||
{
|
||||
HTMLAnchorElement *This = impl_from_IHTMLAnchorElement(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
nsAString str;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
/* FIXME: IE always appends port number, even if it's implicit default number */
|
||||
nsAString_InitDepend(&str, NULL);
|
||||
nsres = nsIDOMHTMLAnchorElement_GetHost(This->nsanchor, &str);
|
||||
return return_nsstr(nsres, &str, p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLAnchorElement_put_hostname(IHTMLAnchorElement *iface, BSTR v)
|
||||
|
|
|
@ -119,6 +119,30 @@ function test_iframe() {
|
|||
});
|
||||
}
|
||||
|
||||
function test_anchor() {
|
||||
var iframe = document.body.firstChild;
|
||||
var anchor = document.createElement("a");
|
||||
|
||||
var anchor_tests = [
|
||||
{ href: "http://www.winehq.org:123/about", protocol: "http:", host: "www.winehq.org:123" },
|
||||
{ href: "https://www.winehq.org:123/about", protocol: "https:", host: "www.winehq.org:123" },
|
||||
{ href: "about:blank", protocol: "about:", host: "" },
|
||||
{ href: "file:///c:/dir/file.html", protocol: "file:", host: "" },
|
||||
{ href: "http://www.winehq.org/about", protocol: "http:", host: "www.winehq.org:80", todo_host: true },
|
||||
{ href: "https://www.winehq.org/about", protocol: "https:", host: "www.winehq.org:443", todo_host: true },
|
||||
];
|
||||
|
||||
for(var i in anchor_tests) {
|
||||
var t = anchor_tests[i];
|
||||
anchor.href = t.href;
|
||||
ok(anchor.protocol === t.protocol, "anchor(" + t.href + ").protocol = " + anchor.protocol);
|
||||
todo_wine_if("todo_host" in t).
|
||||
ok(anchor.host === t.host, "anchor(" + t.href + ").host = " + anchor.host);
|
||||
}
|
||||
|
||||
next_test();
|
||||
}
|
||||
|
||||
function test_getElementsByClassName() {
|
||||
var elems;
|
||||
|
||||
|
@ -273,6 +297,7 @@ var tests = [
|
|||
test_getElementsByClassName,
|
||||
test_head,
|
||||
test_iframe,
|
||||
test_anchor,
|
||||
test_query_selector,
|
||||
test_compare_position,
|
||||
test_document_owner,
|
||||
|
|
Loading…
Reference in New Issue