| 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 .a1 #b1 { background-color: green } | 4 .a1 #b1 { background-color: green } |
| 5 .a2 div + #b2 { background-color: green } | 5 .a2 div + #b2 { background-color: green } |
| 6 </style> | 6 </style> |
| 7 <div id="t1"> | 7 <div id="t1"> |
| 8 <div></div> | 8 <div></div> |
| 9 <div id="b1"></div> | 9 <div id="b1"></div> |
| 10 </div> | 10 </div> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 var b1 = document.getElementById("b1"); | 21 var b1 = document.getElementById("b1"); |
| 22 var b2 = document.getElementById("b2"); | 22 var b2 = document.getElementById("b2"); |
| 23 | 23 |
| 24 shouldBe("getComputedStyle(b1, null).backgroundColor", "transparent"); | 24 shouldBe("getComputedStyle(b1, null).backgroundColor", "transparent"); |
| 25 shouldBe("getComputedStyle(b2, null).backgroundColor", "transparent"); | 25 shouldBe("getComputedStyle(b2, null).backgroundColor", "transparent"); |
| 26 | 26 |
| 27 document.body.offsetTop; // Force style recalc. | 27 document.body.offsetTop; // Force style recalc. |
| 28 | 28 |
| 29 document.getElementById("t1").className = "a1"; | 29 document.getElementById("t1").className = "a1"; |
| 30 if (window.internals) | 30 if (window.internals) |
| 31 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); | 31 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); |
| 32 shouldBe("getComputedStyle(b1, null).backgroundColor", "green"); | 32 shouldBe("getComputedStyle(b1, null).backgroundColor", "green"); |
| 33 | 33 |
| 34 document.body.offsetLeft; // force style recalc. | 34 document.body.offsetLeft; // force style recalc. |
| 35 | 35 |
| 36 document.getElementById("t2").className = "a2"; | 36 document.getElementById("t2").className = "a2"; |
| 37 if (window.internals) | 37 if (window.internals) |
| 38 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); | 38 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); |
| 39 shouldBe("getComputedStyle(b2, null).backgroundColor", "green"); | 39 shouldBe("getComputedStyle(b2, null).backgroundColor", "green"); |
| 40 | 40 |
| 41 </script> | 41 </script> |
| OLD | NEW |