3 <head><title>Click nocontent link
</title>
5 function simulateClick(target
) {
6 var evt
= document
.createEvent("MouseEvents");
7 evt
.initMouseEvent("click", true, true, window
,
8 0, 0, 0, 0, 0, false, false,
9 false, false, 0, null);
11 return target
.dispatchEvent(evt
);
14 function clickNoContentTargetedLink() {
15 return simulateClick(document
.getElementById("nocontent_targeted_link"));
18 function clickNoContentScriptedTargetedLink() {
19 return simulateClick(document
.getElementById(
20 "nocontent_scripted_targeted_link"));
24 function modifyNewWindow() {
25 // Grab a reference to the existing foo window and modify its content.
26 w
= window
.open("", "foo");
27 w
.document
.body
.innerHTML
+= "Modified";
29 // Also modify the title to give the test a notification to listen for.
30 // Use a timeout so that the didAccessInitialDocument notification arrives
32 setTimeout('w.document.title = "Modified Title"');
38 <a href=
"/nocontent" id=
"nocontent_targeted_link" target=
"foo">
39 /nocontent target=foo
</a><br>
40 <button onclick=
"modifyNewWindow()">Modify New Window
</button><br>
42 <a href=
"/nocontent" id=
"nocontent_scripted_targeted_link" target=
"foo"
43 onclick=
"modifyNewWindow()">
44 /nocontent scripted target=foo
</a><br>