| 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 body { color: black; } | 4 body { color: black; } |
| 5 .match + .sibling div+div { color: green; } | 5 .match + .sibling div+div { color: green; } |
| 6 </style> | 6 </style> |
| 7 <div> | 7 <div> |
| 8 <div id="top"></div> | 8 <div id="top"></div> |
| 9 <div class="sibling"> | 9 <div class="sibling"> |
| 10 <div></div> | 10 <div></div> |
| 11 <div id="green"></div> | 11 <div id="green"></div> |
| 12 </div> | 12 </div> |
| 13 <div> | 13 <div> |
| 14 <div></div> | 14 <div></div> |
| 15 </div> | 15 </div> |
| 16 </div> | 16 </div> |
| 17 <script> | 17 <script> |
| 18 if (window.testRunner) | 18 if (window.testRunner) |
| 19 testRunner.dumpAsText(); | 19 testRunner.dumpAsText(); |
| 20 | 20 |
| 21 description("Check that we don't do unnecessary style recalcs for sibling trees.
"); | 21 description("Check that we don't do unnecessary style recalcs for sibling trees.
"); |
| 22 | 22 |
| 23 if (window.internals) | 23 if (window.internals) |
| 24 internals.updateStyleAndReturnAffectedElementCount(); | 24 internals.updateStyleAndReturnAffectedElementCount(); |
| 25 | 25 |
| 26 document.getElementById("top").className = "match"; | 26 document.getElementById("top").className = "match"; |
| 27 | 27 |
| 28 if (window.internals) | 28 if (window.internals) |
| 29 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "4"); | 29 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); |
| 30 | 30 |
| 31 shouldBe("getComputedStyle(document.getElementById('green'), null).color", "'rgb
(0, 128, 0)'"); | 31 shouldBe("getComputedStyle(document.getElementById('green'), null).color", "'rgb
(0, 128, 0)'"); |
| 32 | 32 |
| 33 successfullyParsed = true; | 33 successfullyParsed = true; |
| 34 </script> | 34 </script> |
| OLD | NEW |