| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/js-test.js"></script> | 2 <script src="../../../resources/js-test.js"></script> |
| 3 <style> | 3 <style> |
| 4 input { background-color: transparent } | 4 input { background-color: transparent } |
| 5 #inputOptional:optional, | 5 #inputOptional:optional, |
| 6 #inputRequired:required { | 6 #inputRequired:required { |
| 7 background-color: green | 7 background-color: green |
| 8 } | 8 } |
| 9 | 9 |
| 10 input + div { | 10 input + div { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 <script> | 24 <script> |
| 25 description("Use descendant invalidation sets for :required and :optional pseudo
classes.") | 25 description("Use descendant invalidation sets for :required and :optional pseudo
classes.") |
| 26 | 26 |
| 27 var transparent = "rgba(0, 0, 0, 0)"; | 27 var transparent = "rgba(0, 0, 0, 0)"; |
| 28 var green = "rgb(0, 128, 0)"; | 28 var green = "rgb(0, 128, 0)"; |
| 29 | 29 |
| 30 shouldBe("getComputedStyle(inputOptional, '').backgroundColor", "transparent"); | 30 shouldBe("getComputedStyle(inputOptional, '').backgroundColor", "transparent"); |
| 31 document.body.offsetTop; // Force recalc. | 31 document.body.offsetTop; // Force recalc. |
| 32 inputOptional.removeAttribute("required"); | 32 inputOptional.removeAttribute("required"); |
| 33 if (window.internals) | 33 if (window.internals) |
| 34 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); | 34 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "3"); |
| 35 shouldBe("getComputedStyle(inputOptional, '').backgroundColor", "green"); | 35 shouldBe("getComputedStyle(inputOptional, '').backgroundColor", "green"); |
| 36 | 36 |
| 37 shouldBe("getComputedStyle(inputRequired, '').backgroundColor", "transparent"); | 37 shouldBe("getComputedStyle(inputRequired, '').backgroundColor", "transparent"); |
| 38 document.body.offsetTop; // Force recalc. | 38 document.body.offsetTop; // Force recalc. |
| 39 inputRequired.setAttribute("required", ""); | 39 inputRequired.setAttribute("required", ""); |
| 40 if (window.internals) | 40 if (window.internals) |
| 41 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); | 41 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "3"); |
| 42 shouldBe("getComputedStyle(inputRequired, '').backgroundColor", "green"); | 42 shouldBe("getComputedStyle(inputRequired, '').backgroundColor", "green"); |
| 43 | 43 |
| 44 </script> | 44 </script> |
| OLD | NEW |