2 <script src=
"../../resources/js-test.js"></script>
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; }
25 <pre id=
"console"></pre>
28 if (window
.testRunner
)
29 testRunner
.dumpAsText();
31 function assertColor(selectorOrElement
, rbgColor
)
35 if (typeof selectorOrElement
== "string") {
36 debug(selectorOrElement
);
37 element
= document
.querySelector(selectorOrElement
);
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");