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 #inputValid:valid, | 5 #inputValid:valid, |
6 #inputInvalid:invalid, | 6 #inputInvalid:invalid, |
7 #formValid:valid, | 7 #formValid:valid, |
8 #formInvalid:invalid { | 8 #formInvalid:invalid { |
9 background-color: green | 9 background-color: green |
10 } | 10 } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 <script> | 46 <script> |
47 description("Use descendant invalidation sets for :valid and :invalid pseudo cla
sses.") | 47 description("Use descendant invalidation sets for :valid and :invalid pseudo cla
sses.") |
48 | 48 |
49 var transparent = "rgba(0, 0, 0, 0)"; | 49 var transparent = "rgba(0, 0, 0, 0)"; |
50 var green = "rgb(0, 128, 0)"; | 50 var green = "rgb(0, 128, 0)"; |
51 | 51 |
52 shouldBe("getComputedStyle(inputValid, '').backgroundColor", "transparent"); | 52 shouldBe("getComputedStyle(inputValid, '').backgroundColor", "transparent"); |
53 document.body.offsetTop; // Force recalc. | 53 document.body.offsetTop; // Force recalc. |
54 inputValid.removeAttribute("required"); | 54 inputValid.removeAttribute("required"); |
55 if (window.internals) | 55 if (window.internals) |
56 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); | 56 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "3"); |
57 shouldBe("getComputedStyle(inputValid, '').backgroundColor", "green"); | 57 shouldBe("getComputedStyle(inputValid, '').backgroundColor", "green"); |
58 | 58 |
59 shouldBe("getComputedStyle(inputInvalid, '').backgroundColor", "transparent"); | 59 shouldBe("getComputedStyle(inputInvalid, '').backgroundColor", "transparent"); |
60 document.body.offsetTop; // Force recalc. | 60 document.body.offsetTop; // Force recalc. |
61 inputInvalid.setAttribute("required", ""); | 61 inputInvalid.setAttribute("required", ""); |
62 if (window.internals) | 62 if (window.internals) |
63 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); | 63 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "3"); |
64 shouldBe("getComputedStyle(inputInvalid, '').backgroundColor", "green"); | 64 shouldBe("getComputedStyle(inputInvalid, '').backgroundColor", "green"); |
65 | 65 |
66 shouldBe("getComputedStyle(formInvalid, '').backgroundColor", "transparent"); | 66 shouldBe("getComputedStyle(formInvalid, '').backgroundColor", "transparent"); |
67 document.body.offsetTop; // Force recalc. | 67 document.body.offsetTop; // Force recalc. |
68 inputInFormValid.removeAttribute("required"); | 68 inputInFormValid.removeAttribute("required"); |
69 if (window.internals) | 69 if (window.internals) |
70 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); | 70 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "4"); |
71 shouldBe("getComputedStyle(formValid, '').backgroundColor", "green"); | 71 shouldBe("getComputedStyle(formValid, '').backgroundColor", "green"); |
72 | 72 |
73 shouldBe("getComputedStyle(formInvalid, '').backgroundColor", "transparent"); | 73 shouldBe("getComputedStyle(formInvalid, '').backgroundColor", "transparent"); |
74 document.body.offsetTop; // Force recalc. | 74 document.body.offsetTop; // Force recalc. |
75 inputInFormInvalid.setAttribute("required", ""); | 75 inputInFormInvalid.setAttribute("required", ""); |
76 if (window.internals) | 76 if (window.internals) |
77 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); | 77 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "4"); |
78 shouldBe("getComputedStyle(formInvalid, '').backgroundColor", "green"); | 78 shouldBe("getComputedStyle(formInvalid, '').backgroundColor", "green"); |
79 | 79 |
80 </script> | 80 </script> |
OLD | NEW |