mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 08:53:26 +00:00
mshtml: Implement HTMLAnchorElement_get_pathname().
Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
9e9509f307
commit
3a196ef613
|
@ -476,8 +476,15 @@ static HRESULT WINAPI HTMLAnchorElement_put_pathname(IHTMLAnchorElement *iface,
|
|||
static HRESULT WINAPI HTMLAnchorElement_get_pathname(IHTMLAnchorElement *iface, BSTR *p)
|
||||
{
|
||||
HTMLAnchorElement *This = impl_from_IHTMLAnchorElement(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
nsAString pathname_str;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
/* FIXME: IE prepends a slash for some protocols */
|
||||
nsAString_Init(&pathname_str, NULL);
|
||||
nsres = nsIDOMHTMLAnchorElement_GetPathname(This->nsanchor, &pathname_str);
|
||||
return return_nsstr(nsres, &pathname_str, p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLAnchorElement_put_port(IHTMLAnchorElement *iface, BSTR v)
|
||||
|
|
|
@ -137,24 +137,39 @@ async_test("iframe_location", function() {
|
|||
});
|
||||
|
||||
sync_test("anchor", function() {
|
||||
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 },
|
||||
{ href: "http://www.winehq.org:123/about",
|
||||
protocol: "http:", host: "www.winehq.org:123", path: "/about" },
|
||||
{ href: "https://www.winehq.org:123/about",
|
||||
protocol: "https:", host: "www.winehq.org:123", path: "/about" },
|
||||
{ href: "about:blank",
|
||||
protocol: "about:", host: "", path: "/blank", todo_pathname: 1 },
|
||||
{ href: "unknown:path",
|
||||
protocol: "unknown:", host: "", path: "path" },
|
||||
{ href: "ftp:path",
|
||||
protocol: "ftp:", host: "", path: "path" },
|
||||
{ href: "mailto:path",
|
||||
protocol: "mailto:", host: "", path: "path" },
|
||||
{ href: "ws:path",
|
||||
protocol: "ws:", host: "", path: "path" },
|
||||
{ href: "file:path",
|
||||
protocol: "file:", host: "", path: "/path", todo_pathname: 1 },
|
||||
{ href: "file:///c:/dir/file.html",
|
||||
protocol: "file:", host: "", path: "/c:/dir/file.html" },
|
||||
{ href: "http://www.winehq.org/about",
|
||||
protocol: "http:", host: "www.winehq.org", path: "/about" },
|
||||
{ href: "https://www.winehq.org/about",
|
||||
protocol: "https:", host: "www.winehq.org", path: "/about" },
|
||||
];
|
||||
|
||||
for(var i in anchor_tests) {
|
||||
var t = anchor_tests[i];
|
||||
anchor.href = t.href;
|
||||
document.body.innerHTML = '<a href="' + t.href + '">';
|
||||
var anchor = document.body.firstChild;
|
||||
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);
|
||||
todo_wine_if("todo_pathname" in t).
|
||||
ok(anchor.pathname === t.path, "anchor(" + t.href + ").pathname = " + anchor.pathname);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue