Chromium Code Reviews| Index: LayoutTests/fast/css/invalidation/invalidation-set-with-adjacent-combinators.html |
| diff --git a/LayoutTests/fast/css/invalidation/invalidation-set-with-adjacent-combinators.html b/LayoutTests/fast/css/invalidation/invalidation-set-with-adjacent-combinators.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7b2bccd5b973eac472cc0bd9b44ff7df67225eaf |
| --- /dev/null |
| +++ b/LayoutTests/fast/css/invalidation/invalidation-set-with-adjacent-combinators.html |
| @@ -0,0 +1,75 @@ |
| +<!DOCTYPE html> |
| +<script src="../../../resources/js-test.js"></script> |
| +<style> |
| +.c5 > .c4 ~ .c3 .c2 + .c1 { background-color: green } |
| +<!-- |
|
esprehn
2014/04/03 22:58:05
Can you put this comment not inside the <style> ?
rune
2014/04/04 09:29:37
Oh. That was not intentional. Moved it out of <sty
|
| +Expected sets |
| + |
| +.c1 { } |
| +.c2 { subtree } |
| +.c3 { c1 } |
| +.c4 { subtree } |
| +.c5 { c1 } |
| + |
| +--> |
| +</style> |
| +<div id="i5"> |
| + <div id="i4"></div> |
| + <div></div> |
| + <div></div> |
| + <div></div> |
| + <div id="i3"> |
| + <div> |
| + <div id="i2"></div> |
| + <div id="i1"> |
| + <div>This text should have a green background.</div> |
| + <span></span> |
| + <span></span> |
| + </div> |
| + </div> |
| + </div> |
| +</div> |
| +<script> |
| +description("Check that targeted class invalidation works with when adjacent combinators are present."); |
| + |
| +var transparent = "rgba(0, 0, 0, 0)"; |
| +var green = "rgb(0, 128, 0)"; |
| + |
| +var i1 = document.getElementById("i1"); |
| +var i2 = document.getElementById("i2"); |
| +var i3 = document.getElementById("i3"); |
| +var i4 = document.getElementById("i4"); |
| +var i5 = document.getElementById("i5"); |
| + |
| +shouldBe("getComputedStyle(i1, null).backgroundColor", "transparent"); |
| + |
| +document.body.offsetTop; // Force style recalc. |
| +i1.className = "c1"; |
| +if (window.internals) |
| + shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); |
| + |
| +document.body.offsetTop; // Force style recalc. |
| +i2.className = "c2"; |
| +if (window.internals) |
| + shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); |
| + |
| +document.body.offsetTop; // Force style recalc. |
| +i3.className = "c3"; |
| +if (window.internals) |
| + shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); |
| + |
| +document.body.offsetTop; // Force style recalc. |
| +i4.className = "c4"; |
| +if (window.internals) |
| + shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); |
| + |
| +shouldBe("getComputedStyle(i1, null).backgroundColor", "transparent"); |
| + |
| +document.body.offsetLeft; // force style recalc. |
| +i5.className = "c5"; |
| +if (window.internals) |
| + shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); |
| + |
| +shouldBe("getComputedStyle(i1, null).backgroundColor", "green"); |
| + |
| +</script> |