Chromium Code Reviews| Index: LayoutTests/fast/css/nth-child-no-mutations.html |
| diff --git a/LayoutTests/fast/css/nth-child-no-mutations.html b/LayoutTests/fast/css/nth-child-no-mutations.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6759bb9d08d511b5024c7b643e92755cf3b93b70 |
| --- /dev/null |
| +++ b/LayoutTests/fast/css/nth-child-no-mutations.html |
| @@ -0,0 +1,31 @@ |
| +<!DOCTYPE html> |
| +<script src="../../resources/js-test.js"></script> |
| +<style> |
| + #test :nth-child(odd) { color: green; } |
| + #test :not(.a) { color: rgb(200, 200, 200); } |
| +</style> |
| +<div id="test"> |
| + <div></div> |
| + <div></div> |
| + <div></div> |
| + <div></div> |
| + <div></div> |
| + <div></div> |
| + <div></div> |
| + <div></div> |
| +</div> |
| +<script> |
| +description("Not necessary to recalc sibling styles for :nth-child when no mutations have happened."); |
| + |
| +if (window.internals) |
| + internals.updateStyleAndReturnAffectedElementCount(); |
|
esprehn
2014/03/18 09:31:37
Just do document.body.offsetTop if you're going to
rune
2014/03/18 11:01:47
Done.
|
| + |
| +var testElm = document.querySelector("#test div"); |
| +testElm.className = "a"; |
| + |
| +if (window.internals) |
| + shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); |
| + |
| +var green = "rgb(0, 128, 0)"; |
| +shouldBe("getComputedStyle(testElm, null).color", "green"); |
| +</script> |