OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/js-test.js"></script> |
| 3 <style> |
| 4 input { background: transparent } |
| 5 input + div { color: pink } |
| 6 #i1:read-only { background-color: green } |
| 7 #i2:read-write { background-color: green } |
| 8 </style> |
| 9 <input id="i1" type="text"></input> |
| 10 <div> |
| 11 <div></div> |
| 12 <div></div> |
| 13 <div></div> |
| 14 <div></div> |
| 15 </div> |
| 16 <input id="i2" type="text" readonly></input> |
| 17 <div> |
| 18 <div></div> |
| 19 <div></div> |
| 20 <div></div> |
| 21 <div></div> |
| 22 </div> |
| 23 <script> |
| 24 description("Use descendant invalidation sets for :read-only and :read-write pse
udo classes.") |
| 25 |
| 26 var transparent = "rgba(0, 0, 0, 0)"; |
| 27 var green = "rgb(0, 128, 0)"; |
| 28 |
| 29 shouldBe("getComputedStyle(i1, '').backgroundColor", "transparent"); |
| 30 shouldBe("getComputedStyle(i2, '').backgroundColor", "transparent"); |
| 31 |
| 32 i1.offsetTop; // Force recalc. |
| 33 i1.setAttribute("readonly", ""); |
| 34 |
| 35 if (window.internals) |
| 36 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); |
| 37 |
| 38 shouldBe("getComputedStyle(i1, '').backgroundColor", "green"); |
| 39 |
| 40 i2.offsetTop; // Force recalc. |
| 41 i2.removeAttribute("readonly"); |
| 42 |
| 43 if (window.internals) |
| 44 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); |
| 45 |
| 46 shouldBe("getComputedStyle(i2, '').backgroundColor", "green"); |
| 47 </script> |
OLD | NEW |