OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/js-test.js"></script> |
| 3 <style> |
| 4 :out-of-range { |
| 5 background-color: red |
| 6 } |
| 7 |
| 8 :in-range, :in-range + div #descendant { |
| 9 background-color: green |
| 10 } |
| 11 |
| 12 </style> |
| 13 <input id="input" type="number" min="1" max="10" value="17"></input> |
| 14 <div> |
| 15 <div></div> |
| 16 <div id="descendant"></div> |
| 17 <div></div> |
| 18 </div> |
| 19 |
| 20 <script> |
| 21 description("Use descendant invalidation sets for :in-range and :out-of-range ps
eudo classes.") |
| 22 |
| 23 var transparent = "rgba(0, 0, 0, 0)"; |
| 24 var red = "rgb(255, 0, 0)"; |
| 25 var green = "rgb(0, 128, 0)"; |
| 26 |
| 27 shouldBe("getComputedStyle(input).backgroundColor", "red"); |
| 28 shouldBe("getComputedStyle(descendant).backgroundColor", "transparent"); |
| 29 |
| 30 document.body.offsetTop; // Force recalc. |
| 31 input.value = "5"; |
| 32 |
| 33 if (window.internals) |
| 34 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); |
| 35 shouldBe("getComputedStyle(input).backgroundColor", "green"); |
| 36 shouldBe("getComputedStyle(descendant).backgroundColor", "green"); |
| 37 |
| 38 </script> |
OLD | NEW |