Chromium Code Reviews| 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 | |
|
Manuel Rego
2017/04/05 16:17:51
Nit: Missing ";" at the end.
| |
| 11 } | |
| 12 </style> | |
| 13 <div id="c1"> | |
|
Manuel Rego
2017/04/05 16:17:51
Nit: Use "container-1" and "target-1", etc. so the
| |
| 14 <div id="t1" 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="c2"> | |
| 18 <div class="contents"> | |
| 19 <div id="t2">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(c1); | |
| 34 assert_equals(getComputedStyle(t1).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(c2); | |
| 40 assert_equals(getComputedStyle(t2).color, "rgb(0, 128, 0)", | |
| 41 "Color should be green."); | |
| 42 }, "Hover text with :hover style on display:contents ancestor."); | |
| 43 </script> | |
| OLD | NEW |