OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" | 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
2 "http://www.w3.org/TR/html4/strict.dtd"> | 2 "http://www.w3.org/TR/html4/strict.dtd"> |
3 <html lang="en"> | 3 <html lang="en"> |
4 <head> | 4 <head> |
5 <style> | 5 <style> |
6 div { width: 60px; text-align: center; | 6 div { width: 60px; text-align: center; |
7 position: relative; } | 7 position: relative; } |
8 div#a { background: green; } | 8 div#a { background: green; } |
9 div#b { background: yellow; } | 9 div#b { background: yellow; } |
10 div#a:hover { background: red; } | 10 div#a:hover { background: red; } |
(...skipping 11 matching lines...) Expand all Loading... |
22 function finish() | 22 function finish() |
23 { | 23 { |
24 var expectedBackgroundColor = "rgb(0, 128, 0)"; | 24 var expectedBackgroundColor = "rgb(0, 128, 0)"; |
25 // This test was failing on slower machines, so we give it more time to try
to apply the hover state. | 25 // This test was failing on slower machines, so we give it more time to try
to apply the hover state. |
26 var timeSinceStartedCheckingMs = Date.now() - window.startCheckingForHoverMs
; | 26 var timeSinceStartedCheckingMs = Date.now() - window.startCheckingForHoverMs
; |
27 if (timeSinceStartedCheckingMs < 200 && getComputedStyle(document.getElement
ById('b')).backgroundColor != expectedBackgroundColor) { | 27 if (timeSinceStartedCheckingMs < 200 && getComputedStyle(document.getElement
ById('b')).backgroundColor != expectedBackgroundColor) { |
28 setTimeout(finish, 10); | 28 setTimeout(finish, 10); |
29 return; | 29 return; |
30 } | 30 } |
31 shouldBeEqualToString("window.getComputedStyle(document.getElementById('b'),
null).backgroundColor", expectedBackgroundColor); | 31 shouldBeEqualToString("window.getComputedStyle(document.getElementById('b'),
null).backgroundColor", expectedBackgroundColor); |
| 32 shouldBeEqualToString("window.getComputedStyle(document.getElementById('a'),
null).backgroundColor", expectedBackgroundColor); |
32 | 33 |
33 if (window.testRunner) | 34 if (window.testRunner) |
34 testRunner.notifyDone(); | 35 testRunner.notifyDone(); |
35 } | 36 } |
36 | 37 |
37 function hideC() | 38 function hideC() |
38 { | 39 { |
39 c.style.display = 'none'; | 40 c.style.display = 'none'; |
40 document.body.offsetLeft; | 41 document.body.offsetLeft; |
41 window.startCheckingForHoverMs = Date.now(); | 42 window.startCheckingForHoverMs = Date.now(); |
(...skipping 24 matching lines...) Expand all Loading... |
66 <div id="a"> | 67 <div id="a"> |
67 <div style="height: 20px;"></div> | 68 <div style="height: 20px;"></div> |
68 <span id="c" onmouseover="hoveredC()">Hover here<br><span id="target" style="bac
kground: black;"> Wait </span></span> | 69 <span id="c" onmouseover="hoveredC()">Hover here<br><span id="target" style="bac
kground: black;"> Wait </span></span> |
69 </div> | 70 </div> |
70 <div id="b"> | 71 <div id="b"> |
71 Only green now | 72 Only green now |
72 </div> | 73 </div> |
73 <div id="console"></div> | 74 <div id="console"></div> |
74 </body> | 75 </body> |
75 </html> | 76 </html> |
OLD | NEW |