upload tizen1.0 source
[framework/web/webkit-efl.git] / LayoutTests / fast / css / sibling-selectors.html
1 <!DOCTYPE HTML>
2 <script src="../js/resources/js-test-pre.js"></script>
3
4 <style>
5 #test0 * { background-color: red; }
6 #test0 :first-of-type { background-color: blue; }
7 #test1 :-webkit-any(*) { background-color: red; }
8 #test1 :-webkit-any(:first-of-type) { background-color: blue; }
9 #test2 :not(i) { background-color: red; }
10 #test2 :not(:last-of-type) { background-color: blue; }
11 </style>
12
13 <div id="test0">
14     <p>test0 foo</p>
15     <p>test0 bar</p>
16 </div>
17 <div id="test1">
18     <p>test1 foo</p>
19     <p>test1 bar</p>
20 </div>
21 <div id="test2">
22     <p>test2 foo</p>
23     <p>test2 bar</p>
24 </div>
25 <pre id="console"></pre>
26
27 <script>
28 if (window.layoutTestController)
29     layoutTestController.dumpAsText();
30
31 function assertColor(selectorOrElement, rbgColor)
32 {
33     debug("");
34
35     if (typeof selectorOrElement == "string") {
36         debug(selectorOrElement);
37         element = document.querySelector(selectorOrElement);
38     } else {
39         debug("Element: " + element.nodeName);
40         element = selectorOrElement;
41     }
42
43     shouldBe("document.defaultView.getComputedStyle(element, null).getPropertyValue('background-color')", rbgColor);
44 }
45
46 function assertBlue(selectorOrElement)
47 {
48     assertColor(selectorOrElement, "'rgb(0, 0, 255)'")
49 }
50
51 function assertRed(selectorOrElement)
52 {
53     assertColor(selectorOrElement, "'rgb(255, 0, 0)'")
54 }
55
56 assertBlue("#test0 :first-of-type");
57 assertRed("#test0 :last-of-type");
58 assertBlue("#test1 :first-of-type");
59 assertRed("#test1 :last-of-type");
60 assertBlue("#test2 :first-of-type");
61 assertRed("#test2 :last-of-type");
62 </script>