mshtml: Added support for _self target in IHTMLWindow2::open.
This commit is contained in:
parent
fdda480df5
commit
679ddf24d4
|
@ -932,6 +932,8 @@ static HRESULT WINAPI HTMLWindow2_open(IHTMLWindow2 *iface, BSTR url, BSTR name,
|
|||
IUri *uri;
|
||||
HRESULT hres;
|
||||
|
||||
static const WCHAR _selfW[] = {'_','s','e','l','f',0};
|
||||
|
||||
TRACE("(%p)->(%s %s %s %x %p)\n", This, debugstr_w(url), debugstr_w(name),
|
||||
debugstr_w(features), replace, pomWindowResult);
|
||||
|
||||
|
@ -939,6 +941,23 @@ static HRESULT WINAPI HTMLWindow2_open(IHTMLWindow2 *iface, BSTR url, BSTR name,
|
|||
return E_UNEXPECTED;
|
||||
|
||||
if(name && *name == '_') {
|
||||
if(!strcmpW(name, _selfW)) {
|
||||
if((features && *features) || replace)
|
||||
FIXME("Unsupported arguments for _self target\n");
|
||||
|
||||
hres = IHTMLWindow2_navigate(&This->IHTMLWindow2_iface, url);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
if(pomWindowResult) {
|
||||
FIXME("Returning this window for _self target\n");
|
||||
*pomWindowResult = &This->IHTMLWindow2_iface;
|
||||
IHTMLWindow2_AddRef(*pomWindowResult);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
FIXME("Unsupported name %s\n", debugstr_w(name));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ function ok(b,m) {
|
|||
return external.ok(b, m);
|
||||
}
|
||||
|
||||
function nav_back_test() {
|
||||
function nav_parent_test() {
|
||||
external.trace("Running _parent navigation tests...");
|
||||
|
||||
var iframe = document.getElementById("testframe");
|
||||
|
@ -29,7 +29,7 @@ function nav_back_test() {
|
|||
}
|
||||
|
||||
function window_navigate_test() {
|
||||
external.trace("Runnint window.navigate() tests...");
|
||||
external.trace("Running window.navigate() tests...");
|
||||
|
||||
var iframe = document.getElementById("testframe");
|
||||
|
||||
|
@ -43,6 +43,23 @@ function window_navigate_test() {
|
|||
iframe.contentWindow.navigate("about:blank");
|
||||
}
|
||||
|
||||
function window_open_self_test() {
|
||||
external.trace("Running window.open(_self) tests...");
|
||||
|
||||
var iframe = document.getElementById("testframe");
|
||||
var iframe_window = iframe.contentWindow;
|
||||
|
||||
iframe.onload = function() {
|
||||
iframe.onload = null;
|
||||
var href = iframe.contentWindow.location.href;
|
||||
ok(/.*blank.html\?window_open_self/.test(href), "Unexpected href " + href);
|
||||
ok(iframe.contentWindow === iframe_window, "iframe.contentWindow !== iframe_window");
|
||||
next_test();
|
||||
}
|
||||
|
||||
iframe_window.open("blank.html?window_open_self", "_self");
|
||||
}
|
||||
|
||||
function detached_src_test() {
|
||||
var iframe = document.createElement("iframe");
|
||||
var onload_called = false;
|
||||
|
@ -58,8 +75,9 @@ function detached_src_test() {
|
|||
}
|
||||
|
||||
var tests = [
|
||||
nav_back_test,
|
||||
nav_parent_test,
|
||||
window_navigate_test,
|
||||
window_open_self_test,
|
||||
detached_src_test,
|
||||
function() { external.reportSuccess(); }
|
||||
];
|
||||
|
|
Loading…
Reference in New Issue