Repository navigation
Expand file tree
/
Copy pathcss3-modsel-145b.xml
More file actions
55 lines (55 loc) · 2.47 KB
/
Copy pathcss3-modsel-145b.xml
File metadata and controls
55 lines (55 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>:nth-of-type() pseudo-class with hidden elements</title>
<style type="text/css"><![CDATA[
line { display: block; }
[type~=odd] { background: lime ! important; }
line:nth-of-type(odd) { background: red; }
[hidden] { display: none; }
]]></style>
<link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/>
<link rel="help" href="https://www.w3.org/TR/css3-selectors/#selectors"/> <!-- bogus link to make sure it gets found -->
<meta name="flags" content=" namespace" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="common.js"></script>
</head>
<body>
<test xmlns="http://www.example.org/">
<line id="t1" type="odd">This line should be green.</line>
<line id="t2" type="even">This line should be unstyled.</line>
<line id="t3" type="odd" hidden="hidden">This line should be green.</line>
<line id="t4" type="even">This line should be unstyled.</line>
<line id="t5" type="odd">This line should be green.</line>
<line id="t6" type="even">This line should be unstyled.</line>
<line id="t7" type="odd">This line should be green.</line>
<line id="t8" type="even" hidden="hidden">This line should be unstyled.</line>
<line id="t9" type="odd">This line should be green.</line>
<line id="t10" type="even">This line should be unstyled.</line>
<line id="t11" type="odd">This line should be green.</line>
<line id="t12" type="even" hidden="hidden">This line should be unstyled.</line>
<line id="t13" type="odd" hidden="hidden">This line should be green.</line>
<line id="t14" type="even">This line should be unstyled.</line>
<line id="t15" type="odd">This line should be green.</line>
</test>
<script><![CDATA[
test(function() {
assert_background_color('t1', LIME);
assert_not_background_color('t2', RED);
assert_background_color('t3', LIME);
assert_not_background_color('t4', RED);
assert_background_color('t5', LIME);
assert_not_background_color('t6', RED);
assert_background_color('t7', LIME);
assert_not_background_color('t8', RED);
assert_background_color('t9', LIME);
assert_not_background_color('t10', RED);
assert_background_color('t11', LIME);
assert_not_background_color('t12', RED);
assert_background_color('t13', LIME);
assert_not_background_color('t14', RED);
assert_background_color('t15', LIME);
}, 'nth-of-type() counting includes hidden elements');
]]></script>
</body>
</html>