mshtml: Adder _parent target support to navigate_anchor.
This commit is contained in:
parent
d6bb86e84c
commit
31faed571d
|
@ -77,7 +77,7 @@ static HRESULT navigate_anchor(HTMLAnchorElement *This)
|
|||
nsresult nsres;
|
||||
HRESULT hres = E_FAIL;
|
||||
|
||||
static const WCHAR _parentW[] = {'p','a','r','e','n','t',0};
|
||||
static const WCHAR _parentW[] = {'_','p','a','r','e','n','t',0};
|
||||
static const WCHAR _selfW[] = {'_','s','e','l','f',0};
|
||||
static const WCHAR _topW[] = {'_','t','o','p',0};
|
||||
|
||||
|
@ -93,9 +93,13 @@ static HRESULT navigate_anchor(HTMLAnchorElement *This)
|
|||
TRACE("target _top\n");
|
||||
get_top_window(This->element.node.doc->basedoc.window, &window);
|
||||
}else if(!strcmpiW(target, _parentW)) {
|
||||
FIXME("Navigating to target _parent is not implemented\n");
|
||||
nsAString_Finish(&target_str);
|
||||
return S_OK;
|
||||
window = This->element.node.doc->basedoc.window;
|
||||
if(!window->parent) {
|
||||
WARN("Window has no parent\n");
|
||||
nsAString_Finish(&target_str);
|
||||
return S_OK;
|
||||
}
|
||||
window = window->parent;
|
||||
}else {
|
||||
HTMLOuterWindow *top_window;
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
<html></html>
|
|
@ -0,0 +1,42 @@
|
|||
<html>
|
||||
<head>
|
||||
<script>
|
||||
function ok(b,m) {
|
||||
return external.ok(b, m);
|
||||
}
|
||||
|
||||
function nav_back_test() {
|
||||
external.trace("Running _parent navigation tests...");
|
||||
|
||||
var iframe = document.getElementById("testframe");
|
||||
var subframe = iframe.contentWindow.document.createElement("iframe");
|
||||
|
||||
subframe.onload = function() {
|
||||
var doc = subframe.contentWindow.document;
|
||||
doc.body.innerHTML = '<a href="blank2.html" id="aid" target="_parent">test</a>';
|
||||
doc.getElementById("aid").click();
|
||||
}
|
||||
|
||||
iframe.onload = function() {
|
||||
var href = iframe.contentWindow.location.href;
|
||||
ok(/.*blank2.html/.test(href), "Unexpected href " + href);
|
||||
next_test();
|
||||
}
|
||||
|
||||
iframe.contentWindow.document.body.appendChild(subframe);
|
||||
subframe.src = "blank.html";
|
||||
}
|
||||
|
||||
var tests = [
|
||||
nav_back_test,
|
||||
function() { external.reportSuccess(); }
|
||||
];
|
||||
|
||||
function next_test() {
|
||||
window.setTimeout(tests.shift(), 0);
|
||||
}
|
||||
</script>
|
||||
<body onload="next_test()">
|
||||
<iframe src="about:blank" id="testframe"></iframe>
|
||||
</body>
|
||||
</html>
|
|
@ -31,6 +31,15 @@ events.html HTML "events.html"
|
|||
/* @makedep: externscr.js */
|
||||
externscr.js HTML "externscr.js"
|
||||
|
||||
/* @makedep: nav_test.html */
|
||||
nav_test.html HTML "nav_test.html"
|
||||
|
||||
/* @makedep: blank.html */
|
||||
blank.html HTML "blank.html"
|
||||
|
||||
/* @makedep: blank.html */
|
||||
blank2.html HTML "blank.html"
|
||||
|
||||
/* @makedep: test_tlb.tlb */
|
||||
1 TYPELIB test_tlb.tlb
|
||||
|
||||
|
|
|
@ -2831,6 +2831,7 @@ static void run_js_tests(void)
|
|||
run_js_script("exectest.html");
|
||||
run_js_script("vbtest.html");
|
||||
run_js_script("events.html");
|
||||
run_js_script("nav_test.html");
|
||||
}
|
||||
|
||||
static BOOL init_registry(BOOL init)
|
||||
|
|
Loading…
Reference in New Issue