-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Expand file tree
/
Copy pathcss3-modsel-74.xml
More file actions
119 lines (119 loc) · 3.41 KB
/
Copy pathcss3-modsel-74.xml
File metadata and controls
119 lines (119 loc) · 3.41 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>NEGATED :nth-last-child() pseudo-class</title>
<style type="text/css"><![CDATA[.red { background-color : red }
ul > li:not(:nth-last-child(odd)) { background-color : lime }
ol > li:not(:nth-last-child(even)) { background-color : lime }
table.t1 tr:not(:nth-last-child(-n+4)) { background-color : lime }
table.t2 td:not(:nth-last-child(3n+1)) { background-color : lime }
table.t1 td, table.t2 td { border : thin black solid }
]]></style>
<link rel="author" title="Daniel Glazman" href="http://glazman.org/"/>
<link rel="help" href="https://www.w3.org/TR/css3-selectors/#selectors"/> <!-- bogus link to make sure it gets found -->
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="common.js"></script>
</head>
<body>
<ul>
<li class="red" id="u1">This first list item should have a green background</li>
<li>Second list item</li>
<li class="red" id="u2">This third list item should have a green background</li>
<li>Fourth list item</li>
<li class="red" id="u3">This fifth list item should have a green background</li>
<li>Sixth list item</li>
</ul>
<ol>
<li>First list item</li>
<li class="red" id="o1">This second list item should have a green background</li>
<li>Third list item</li>
<li class="red" id="o2">This fourth list item should have a green background</li>
<li>Fifth list item</li>
<li class="red" id="o3">This sixth list item should have a green background</li>
</ol>
<div>
<table border="1" class="t1">
<tr class="red" id="r1">
<td>Green row : 1.1</td>
<td>1.2</td>
<td>1.3</td>
</tr>
<tr class="red" id="r2">
<td>Green row : 2.1</td>
<td>2.2</td>
<td>2.3</td>
</tr>
<tr>
<td>3.1</td>
<td>3.2</td>
<td>3.3</td>
</tr>
<tr>
<td>4.1</td>
<td>4.2</td>
<td>4.3</td>
</tr>
<tr>
<td>5.1</td>
<td>5.2</td>
<td>5.3</td>
</tr>
<tr>
<td>6.1</td>
<td>6.2</td>
<td>6.3</td>
</tr>
</table>
<p></p>
<table class="t2" border="1">
<tr>
<td class="red" id="c1">green cell</td>
<td>1.2</td>
<td class="red" id="c2">green cell</td>
<td class="red" id="c3">green cell</td>
<td>1.5</td>
<td class="red" id="c4">green cell</td>
<td class="red" id="c5">green cell</td>
<td>1.8</td>
</tr>
<tr>
<td class="red" id="c6">green cell</td>
<td>2.2</td>
<td class="red" id="c7">green cell</td>
<td class="red" id="c8">green cell</td>
<td>2.5</td>
<td class="red" id="c9">green cell</td>
<td class="red" id="c10">green cell</td>
<td>2.8</td>
</tr>
<tr>
<td class="red" id="c11">green cell</td>
<td>3.2</td>
<td class="red" id="c12">green cell</td>
<td class="red" id="c13">green cell</td>
<td>3.5</td>
<td class="red" id="c14">green cell</td>
<td class="red" id="c15">green cell</td>
<td>3.8</td>
</tr>
</table>
</div>
<script><![CDATA[
test(() => {
for (let i = 1; i <= 3; ++i) {
assert_background_color(`u${i}`, LIME, `u${i} should be green`);
}
for (let i = 1; i <= 3; ++i) {
assert_background_color(`o${i}`, LIME, `o${i} should be green`);
}
for (let i = 1; i <= 2; ++i) {
assert_background_color(`r${i}`, LIME, `r${i} should be green`);
}
for (let i = 1; i <= 15; ++i) {
assert_background_color(`c${i}`, LIME, `c${i} should be green`);
}
}, 'NEGATED :nth-last-child() pseudo-class');
]]></script>
</body>
</html>