Changed the postion of context menu to avaliable space
[framework/web/webkit-efl.git] / LayoutTests / webarchive / adopt-attribute-styled-body-webarchive.html
1 <html>
2 <head>
3
4 <script>
5
6 if (window.testRunner) {
7     testRunner.dumpDOMAsWebArchive();
8     testRunner.setCanOpenWindows();
9     testRunner.waitUntilDone();
10 }
11
12 var secondWindow = null;
13
14 function startTest()
15 {
16     secondWindow = window.open("resources/adopt-attribute-styled-body-second-window.html", "TestWindow");
17     if (!secondWindow) {
18         alert("When running this test under Safari, popup blocking must be disabled.");
19         return;
20     }
21     tryAdoptNode();
22 }
23
24 function tryAdoptNode()
25 {
26     window.bodyToAdopt = secondWindow.document.getElementById("otherBody");
27     if (!secondWindow.doneWithBody || !window.bodyToAdopt) {
28         setTimeout("tryAdoptNode()", 10);
29         return;
30     }
31     
32     secondWindow.close();
33     
34     document.getElementById("iframeSpan").innerHTML = "<iframe src='resources/adopt-attribute-styled-body-iframe.html'></iframe>";
35
36     procedeAfterClosedWindow();
37 }
38
39 function procedeAfterClosedWindow()
40 {
41     if (!secondWindow.closed || window.bodyToAdopt) {
42         setTimeout("procedeAfterClosedWindow()", 10);
43         return;
44     }
45     
46     secondWindow = null;
47     
48     if (window.GCController) {
49         GCController.collect();
50         if (window.testRunner)
51             testRunner.notifyDone();
52         else
53             alert("How strange - You have window.GCController, but no window.testRunner.  How did this happen?");
54     }
55     else
56         alert("Now wait for garbage collection to have occured, then save the current page as a WebArchive.");
57 }
58
59 </script>
60 </head>
61
62 <body onload="startTest();">
63 <span id="testSpan">This test takes a body with inline link color styling from a second window, moves it to the document of an iframe, makes sure the 
64 second window has closed, then makes a WebArchive.  The test passes if it doesn't crash.  If running the test in Safari then garbage collection might get in the
65 way of fulling testing the bug.  One should wait "awhile" before making the WebArchive.<br></span><br>
66 <span id="iframeSpan"></span>
67 </body>
68 </html>