OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/js-test.js"></script> |
| 3 <style> |
| 4 #outer { |
| 5 position: absolute; |
| 6 left: 0; |
| 7 top: 0 |
| 8 } |
| 9 |
| 10 #outer div { |
| 11 width: 100px; |
| 12 height: 100px |
| 13 } |
| 14 |
| 15 #hover:hover + #test { |
| 16 background-color: black |
| 17 } |
| 18 </style> |
| 19 <div id="outer"> |
| 20 <div id="hover"></div> |
| 21 <div id="test"></div> |
| 22 </div> |
| 23 <script> |
| 24 description("Check that childrenAffectedByHover is intact after a re-attach."); |
| 25 |
| 26 function mouseOver(x, y) { |
| 27 if (window.eventSender) |
| 28 eventSender.mouseMoveTo(x, y); |
| 29 document.body.offsetTop; // force style recalc |
| 30 } |
| 31 |
| 32 var black = "rgb(0, 0, 0)"; |
| 33 var transparent = "rgba(0, 0, 0, 0)"; |
| 34 |
| 35 var test = document.getElementById('test'); |
| 36 |
| 37 shouldBe("getComputedStyle(test, '').backgroundColor", "transparent"); |
| 38 |
| 39 // Hover #hover |
| 40 mouseOver(50, 50); |
| 41 shouldBe("getComputedStyle(test, '').backgroundColor", "black"); |
| 42 |
| 43 // Hover body |
| 44 mouseOver(0, 200); |
| 45 shouldBe("getComputedStyle(test, '').backgroundColor", "transparent"); |
| 46 |
| 47 // Force re-attach |
| 48 document.getElementById("hover").style.display = "inline-block"; |
| 49 |
| 50 // Hover #hover |
| 51 mouseOver(50, 50); |
| 52 shouldBe("getComputedStyle(test, '').backgroundColor", "black"); |
| 53 </script> |
OLD | NEW |