Chromium Code Reviews| Index: LayoutTests/fast/css/invalidation/dynamic-selector-list-pseudo.html |
| diff --git a/LayoutTests/fast/css/invalidation/dynamic-selector-list-pseudo.html b/LayoutTests/fast/css/invalidation/dynamic-selector-list-pseudo.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9820b24c7420463a2e65883e8b23e094c7cb83ff |
| --- /dev/null |
| +++ b/LayoutTests/fast/css/invalidation/dynamic-selector-list-pseudo.html |
| @@ -0,0 +1,54 @@ |
| +<!DOCTYPE html> |
| +<script src="../../../resources/js-test.js"></script> |
| +<style> |
| +.a1 .a2:-webkit-any(.a3, .a4) { background-color: green } |
| +.b1 .b2:not(.b3) { background-color: green } |
| +.c1 .c2:-webkit-any(:not(.c3)) { background-color: green } |
| +.d1:not(.d2) .d3 { background-color: green; } |
| +.e1 :not(.e2) { background-color: green; } |
| +</style> |
| +<div class="a1"> |
| + <div class="a2" id="t1">Background should be green</div> |
| +</div> |
| +<div class="b1"> |
| + <div class="b2 b3" id="t2">Background should be green</div> |
| +</div> |
| +<div class="c1"> |
| + <div class="c2 c3" id="t3">Background should be green</div> |
| +</div> |
| +<div id="outer-d" class="d1 d2"> |
| + <div id="t4" class="d3">Background should be green</div> |
| +</div> |
| +<div id="outer-e"> |
| + <div id="t5">Background should be green</div> |
| +</div> |
| +<script> |
| +description("Change classes affecting :-webkit-any and :not.") |
| + |
| +document.body.offsetTop; // force style recalc. |
| + |
| +var t1 = document.getElementById("t1"); |
| +shouldBe("getComputedStyle(t1, null).backgroundColor", "'rgba(0, 0, 0, 0)'"); |
|
chrishtr
2014/02/20 23:03:19
More readable to have variables like
var black =
rune
2014/02/20 23:19:13
Done (transparent, not black).
|
| +t1.className = "a2 a3"; |
| +shouldBe("getComputedStyle(t1, null).backgroundColor", "'rgb(0, 128, 0)'"); |
| + |
| +var t2 = document.getElementById("t2"); |
| +shouldBe("getComputedStyle(t2, null).backgroundColor", "'rgba(0, 0, 0, 0)'"); |
| +t2.className = "b2"; |
| +shouldBe("getComputedStyle(t2, null).backgroundColor", "'rgb(0, 128, 0)'"); |
| + |
| +var t3 = document.getElementById("t3"); |
| +shouldBe("getComputedStyle(t3, null).backgroundColor", "'rgba(0, 0, 0, 0)'"); |
| +t3.className = "c2"; |
| +shouldBe("getComputedStyle(t3, null).backgroundColor", "'rgb(0, 128, 0)'"); |
| + |
| +var t4 = document.getElementById("t4"); |
| +shouldBe("getComputedStyle(t4, null).backgroundColor", "'rgba(0, 0, 0, 0)'"); |
| +document.getElementById("outer-d").className = "d1"; |
| +shouldBe("getComputedStyle(t4, null).backgroundColor", "'rgb(0, 128, 0)'"); |
| + |
| +var t5 = document.getElementById("t5"); |
| +shouldBe("getComputedStyle(t5, null).backgroundColor", "'rgba(0, 0, 0, 0)'"); |
| +document.getElementById("outer-e").className = "e1"; |
| +shouldBe("getComputedStyle(t5, null).backgroundColor", "'rgb(0, 128, 0)'"); |
| +</script> |