| 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 .a + .b { color: green; } | 4 .a + .b { color: green; } |
| 5 .c + .d { color: green; } | 5 .c + .d { color: green; } |
| 6 .e { color: green; } | 6 .e { color: green; } |
| 7 </style> | 7 </style> |
| 8 <div id="t1"> | 8 <div id="t1"> |
| 9 <div></div> | 9 <div></div> |
| 10 <div class="b"></div> | 10 <div class="b"></div> |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "0"); | 42 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "0"); |
| 43 | 43 |
| 44 // No style invalidation or recalc scheduled for an ascendant of .e, and no affe
cted-by-adjacent | 44 // No style invalidation or recalc scheduled for an ascendant of .e, and no affe
cted-by-adjacent |
| 45 // bits set on any ascendants, hence we don't need to do a recalc even if a styl
e invalidation | 45 // bits set on any ascendants, hence we don't need to do a recalc even if a styl
e invalidation |
| 46 // is scheduled for the .c change with adjacent implications. | 46 // is scheduled for the .c change with adjacent implications. |
| 47 | 47 |
| 48 document.body.offsetTop; | 48 document.body.offsetTop; |
| 49 document.body.querySelector("#t2 > div > div").className = "c"; | 49 document.body.querySelector("#t2 > div > div").className = "c"; |
| 50 shouldBe("getComputedStyle(document.body.querySelector('#t2 .e')).color", "green
", true); | 50 shouldBe("getComputedStyle(document.body.querySelector('#t2 .e')).color", "green
", true); |
| 51 if (window.internals) | 51 if (window.internals) |
| 52 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); | 52 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); |
| 53 | 53 |
| 54 // No style invalidation or recalc scheduled for an ascendant of .b, and even if
affected-by-adjacent | 54 // No style invalidation or recalc scheduled for an ascendant of .b, and even if
affected-by-adjacent |
| 55 // bits are set on the ascendant (because of a+b), it doesn't matter since that
ascendant does | 55 // bits are set on the ascendant (because of a+b), it doesn't matter since that
ascendant does |
| 56 // not have any children that needs style recalc or invalidation. | 56 // not have any children that needs style recalc or invalidation. |
| 57 | 57 |
| 58 document.body.offsetTop; | 58 document.body.offsetTop; |
| 59 document.body.querySelector("#t3 > div > div").className = "c"; | 59 document.body.querySelector("#t3 > div > div").className = "c"; |
| 60 shouldBe("getComputedStyle(document.body.querySelector('#t3 .b')).color", "green
", true); | 60 shouldBe("getComputedStyle(document.body.querySelector('#t3 .b')).color", "green
", true); |
| 61 if (window.internals) | 61 if (window.internals) |
| 62 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); | 62 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); |
| 63 | 63 |
| 64 </script> | 64 </script> |
| OLD | NEW |