Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / sibling-selectors.html
blob3f5ed19323652b44498e6411e58bd89b02a66310
1 <!DOCTYPE HTML>
2 <script src="../../resources/js-test.js"></script>
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>
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>
27 <script>
28 if (window.testRunner)
29 testRunner.dumpAsText();
31 function assertColor(selectorOrElement, rbgColor)
33 debug("");
35 if (typeof selectorOrElement == "string") {
36 debug(selectorOrElement);
37 element = document.querySelector(selectorOrElement);
38 } else {
39 debug("Element: " + element.nodeName);
40 element = selectorOrElement;
43 shouldBe("document.defaultView.getComputedStyle(element, null).getPropertyValue('background-color')", rbgColor);
46 function assertBlue(selectorOrElement)
48 assertColor(selectorOrElement, "'rgb(0, 0, 255)'")
51 function assertRed(selectorOrElement)
53 assertColor(selectorOrElement, "'rgb(255, 0, 0)'")
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>