mirror of
https://github.com/servo/servo.git
synced 2025-06-23 16:44:33 +01:00
- Update CSS tests to revision e05bfd5e30ed662c2f8a353577003f8eed230180. - Update web-platform-tests to revision a052787dd5c069a340031011196b73affbd68cd9.
51 lines
No EOL
1.2 KiB
HTML
51 lines
No EOL
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<html><head><meta charset="utf-8">
|
|
<title>CSS Test: child-indexed selectors should match without a parent element.</title>
|
|
<link href="mailto:ecoal95@gmail.com" rel="author" title="Emilio Cobos Álvarez">
|
|
<link href="https://drafts.csswg.org/selectors-4/#child-index" rel="help">
|
|
<link href="reference/child-index-no-parent-01-ref.htm" rel="match">
|
|
<style>
|
|
:root:first-child #a {
|
|
color: green;
|
|
}
|
|
:root:nth-child(n) #b {
|
|
color: green;
|
|
}
|
|
:root:first-of-type #c {
|
|
color: green;
|
|
}
|
|
:root:nth-of-type(1) #d {
|
|
color: green;
|
|
}
|
|
:root:last-of-type #e {
|
|
color: green;
|
|
}
|
|
:root:last-child #f {
|
|
color: green;
|
|
}
|
|
:root:nth-last-child(1) #g {
|
|
color: green;
|
|
}
|
|
:root:nth-last-of-type(n) #h {
|
|
color: green;
|
|
}
|
|
|
|
#i {
|
|
color: green;
|
|
}
|
|
|
|
/* NB: not matching intentionally */
|
|
:root:nth-last-child(2) #i {
|
|
color: red;
|
|
}
|
|
</style>
|
|
</head><body><p id="a">Should be green
|
|
</p><p id="b">Should be green
|
|
</p><p id="c">Should be green
|
|
</p><p id="d">Should be green
|
|
</p><p id="e">Should be green
|
|
</p><p id="f">Should be green
|
|
</p><p id="g">Should be green
|
|
</p><p id="h">Should be green
|
|
</p><p id="i">Should be green
|
|
</p></body></html> |