tizen beta release
[framework/web/webkit-efl.git] / LayoutTests / fast / css / hover-update.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2         "http://www.w3.org/TR/html4/strict.dtd">
3 <html lang="en">
4 <head>
5 <style>
6     div { width: 60px; text-align: center;
7             position: relative; }
8     div#a { background: green; }
9     div#b { background: yellow; }
10     div#a:hover { background: red; }
11     div#b:hover { background: green; }
12     span#c:hover { color: red; }
13 </style>
14 <script src="../js/resources/js-test-pre.js"></script>
15 </head>
16 <body onload="runtest()">
17 <p><b>BUG ID:</b> <a href="http://bugs.webkit.org/show_bug.cgi?id=6821">Bugzilla bug 6821</a> Fix for 5983 will not always update hover correctly.</p>
18
19 <p>To run manually, move your mouse over the black box.  You should see a green box.  If you see any other color, the test fails.</p>
20
21 <script type="text/javascript">
22 function finish()
23 {
24     shouldBeEqualToString("window.getComputedStyle(document.getElementById('b'), null).backgroundColor", "rgb(0, 128, 0)");
25
26     if (window.layoutTestController)
27         layoutTestController.notifyDone();
28 }
29
30 function hideC()
31 {
32     c.style.display = 'none';
33     window.setTimeout(finish, 0);
34 }
35
36 function hoveredC()
37 {
38     window.setTimeout(hideC, 0);
39 }
40
41 function runtest()
42 {
43     if (!window.layoutTestController)
44         return;
45
46     debug('Hover color before test: ' + window.getComputedStyle(document.getElementById("b"), null).backgroundColor);
47
48     layoutTestController.waitUntilDone();
49     var target = document.getElementById('target');
50     var x = target.offsetParent.offsetLeft + target.offsetLeft + target.offsetWidth / 2;
51     var y = target.offsetParent.offsetTop + target.offsetTop + target.offsetHeight / 2;
52     eventSender.mouseMoveTo(x, y);
53 }
54
55 </script>
56
57 <div id="a">
58 <div style="height: 20px;"></div>
59 <span id="c" onmouseover="hoveredC()">Hover here<br><span id="target" style="background: black;">&nbsp;Wait&nbsp;</span></span>
60 </div>
61 <div id="b">
62 Only green now
63 </div>
64 <div id="console"></div>
65 </body>
66 </html>