mirror of
https://github.com/servo/servo.git
synced 2025-06-23 08:34:42 +01:00
- Update CSS tests to revision e05bfd5e30ed662c2f8a353577003f8eed230180. - Update web-platform-tests to revision a052787dd5c069a340031011196b73affbd68cd9.
51 lines
No EOL
1.3 KiB
HTML
51 lines
No EOL
1.3 KiB
HTML
<!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><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.xht" 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> |