OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <style> |
| 5 .contents { |
| 6 display: contents; |
| 7 border: 1px solid red; |
| 8 } |
| 9 .contents:hover { |
| 10 color: green; |
| 11 } |
| 12 </style> |
| 13 <div id="container1"> |
| 14 <div id="target1" class="contents">Hovering this text should make it go green. |
| 15 There should be no red border at any time.</div> |
| 16 </div> |
| 17 <div id="container2"> |
| 18 <div class="contents"> |
| 19 <div id="target2">Hovering this text should make it go green. |
| 20 There should be no red border at any time.</div> |
| 21 </div> |
| 22 </div> |
| 23 <script> |
| 24 function hoverElement(element) { |
| 25 eventSender.mouseMoveTo(element.offsetLeft + 1, element.offsetTop + 1); |
| 26 } |
| 27 |
| 28 test(() => { |
| 29 assert_true(!!window.eventSender, "Check for window.eventSender"); |
| 30 }, "Tests require window.eventSender for hovering."); |
| 31 |
| 32 test(() => { |
| 33 hoverElement(container1); |
| 34 assert_equals(getComputedStyle(target1).color, "rgb(0, 128, 0)", |
| 35 "Color should be green."); |
| 36 }, "Hover text with :hover style on display:contents parent."); |
| 37 |
| 38 test(() => { |
| 39 hoverElement(container2); |
| 40 assert_equals(getComputedStyle(target2).color, "rgb(0, 128, 0)", |
| 41 "Color should be green."); |
| 42 }, "Hover text with :hover style on display:contents ancestor."); |
| 43 </script> |
OLD | NEW |