OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
chrishtr
2014/02/20 22:34:49
Add to the targetedstylerecalc virtual test suite
rune
2014/02/20 22:59:33
Done.
| |
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="t4" class="d1 d2"> | |
20 <div id="t5" class="d3">Background should be green</div> | |
21 </div> | |
22 <div id="t6"> | |
23 <div id="t7">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"); | |
chrishtr
2014/02/20 22:34:49
Check that the color is black before you add the a
rune
2014/02/20 22:59:33
Done.
| |
31 t1.className = "a2 a3"; | |
32 shouldBe("getComputedStyle(t1, null).backgroundColor", "'rgb(0, 128, 0)'"); | |
33 | |
34 var t2 = document.getElementById("t2"); | |
35 t2.className = "b2"; | |
36 shouldBe("getComputedStyle(t2, null).backgroundColor", "'rgb(0, 128, 0)'"); | |
37 | |
38 var t3 = document.getElementById("t3"); | |
39 t3.className = "c2"; | |
40 shouldBe("getComputedStyle(t3, null).backgroundColor", "'rgb(0, 128, 0)'"); | |
41 | |
42 document.getElementById("t4").className = "d1"; | |
43 shouldBe("getComputedStyle(document.getElementById('t5'), null).backgroundColor" , "'rgb(0, 128, 0)'"); | |
44 | |
45 document.getElementById("t6").className = "e1"; | |
46 shouldBe("getComputedStyle(document.getElementById('t7'), null).backgroundColor" , "'rgb(0, 128, 0)'"); | |
47 </script> | |
OLD | NEW |