[Release] Webkit-EFL Ver. 2.0_beta_118996_0.6.22
[framework/web/webkit-efl.git] / LayoutTests / fast / images / imagemap-scroll.html
1 <html>
2 <head>
3 <script>
4 function log(message)
5 {
6     var element = document.createElement("p");
7     element.appendChild(document.createTextNode(message));
8     document.getElementById("results").appendChild(element);
9 }
10 function runTest()
11 {
12     if (window.layoutTestController)
13         layoutTestController.dumpAsText();
14     if (document.body.scrollTop == 0)
15         log("PASS: Document is starting scrolled to top.");
16     else
17         log("FAIL: Document is starting scrolled to " + document.body.scrollTop + ".");
18     document.getElementById("area").focus();
19     if (document.body.scrollTop > 4000 && document.body.scrollTop < 6000)
20         log("PASS: Focusing area element caused the image to scroll into view.");
21     else
22         log("FAIL: Document is scrolled to " + document.body.scrollTop + " after focusing area element.");
23     document.body.scrollTop = 0;
24     if (document.body.scrollTop == 0)
25         log("PASS: Document is scrolled to top once again.");
26     else
27         log("FAIL: Document should be scrolled to top but is scrolled to " + document.body.scrollTop + ".");
28     document.getElementById("area").blur();
29     if (document.body.scrollTop == 0)
30         log("PASS: Document is still scrolled to top after removing focus from area element.");
31     else
32         log("FAIL: Document is scrolled to " + document.body.scrollTop + " after removing focus from area element.");
33     document.body.scrollTop = 0;
34     document.body.removeChild(document.getElementById("test"));
35     log("TEST COMPLETE");
36 }
37 </script>
38 </head>
39 <body onload="runTest()">
40 <div id="results">
41 <p>This tests to be sure that focusing an area element triggers scrolling and removing focus from it does not.</p>
42 </div>
43 <div id="test">
44 <div style="height:5000px"></div>
45 <map name="imagemap">
46     <area id="area" shape="rect" coords="0,0,128,128" href="#dummy">
47 </map>
48 <img src="resources/mu.png" width="128" height="128" usemap="#imagemap" ismap>
49 <div style="height:5000px"></div>
50 <div>
51 </body>
52 </head>
53 </html>