OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <script src="../../../resources/js-test.js"></script> | |
3 <style> | |
4 .a1 .a2:-webkit-any(.a3, .a4) { background-color: green } | |
5 .b1 .b2:not(.b3) { background-color: green } | |
6 .c1 .c2:-webkit-any(:not(.c3)) { background-color: green } | |
7 .d1:not(.d2) .d3 { background-color: green; } | |
8 .e1 :not(.e2) { background-color: green; } | |
9 </style> | |
10 <div class="a1"> | |
11 <div class="a2" id="t1">Background should be green</div> | |
12 </div> | |
13 <div class="b1"> | |
14 <div class="b2 b3" id="t2">Background should be green</div> | |
15 </div> | |
16 <div class="c1"> | |
17 <div class="c2 c3" id="t3">Background should be green</div> | |
18 </div> | |
19 <div id="outer-d" class="d1 d2"> | |
20 <div id="t4" class="d3">Background should be green</div> | |
21 </div> | |
22 <div id="outer-e"> | |
23 <div id="t5">Background should be green</div> | |
24 </div> | |
25 <script> | |
26 description("Change classes affecting :-webkit-any and :not.") | |
27 | |
28 document.body.offsetTop; // force style recalc. | |
29 | |
30 var t1 = document.getElementById("t1"); | |
31 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).
| |
32 t1.className = "a2 a3"; | |
33 shouldBe("getComputedStyle(t1, null).backgroundColor", "'rgb(0, 128, 0)'"); | |
34 | |
35 var t2 = document.getElementById("t2"); | |
36 shouldBe("getComputedStyle(t2, null).backgroundColor", "'rgba(0, 0, 0, 0)'"); | |
37 t2.className = "b2"; | |
38 shouldBe("getComputedStyle(t2, null).backgroundColor", "'rgb(0, 128, 0)'"); | |
39 | |
40 var t3 = document.getElementById("t3"); | |
41 shouldBe("getComputedStyle(t3, null).backgroundColor", "'rgba(0, 0, 0, 0)'"); | |
42 t3.className = "c2"; | |
43 shouldBe("getComputedStyle(t3, null).backgroundColor", "'rgb(0, 128, 0)'"); | |
44 | |
45 var t4 = document.getElementById("t4"); | |
46 shouldBe("getComputedStyle(t4, null).backgroundColor", "'rgba(0, 0, 0, 0)'"); | |
47 document.getElementById("outer-d").className = "d1"; | |
48 shouldBe("getComputedStyle(t4, null).backgroundColor", "'rgb(0, 128, 0)'"); | |
49 | |
50 var t5 = document.getElementById("t5"); | |
51 shouldBe("getComputedStyle(t5, null).backgroundColor", "'rgba(0, 0, 0, 0)'"); | |
52 document.getElementById("outer-e").className = "e1"; | |
53 shouldBe("getComputedStyle(t5, null).backgroundColor", "'rgb(0, 128, 0)'"); | |
54 </script> | |
OLD | NEW |