diff --git a/components/selectors/parser.rs b/components/selectors/parser.rs index 601b7e23986..9f33683b950 100644 --- a/components/selectors/parser.rs +++ b/components/selectors/parser.rs @@ -1021,6 +1021,7 @@ impl ToCss for Component { (0, 0) => dest.write_char('0'), (1, 0) => dest.write_char('n'), + (-1, 0) => dest.write_str("-n"), (_, 0) => write!(dest, "{}n", a), (0, _) => write!(dest, "{}", b), diff --git a/tests/wpt/metadata/css/selectors/anplusb-selector-parsing.html.ini b/tests/wpt/metadata/css/selectors/anplusb-selector-parsing.html.ini deleted file mode 100644 index d7923415b01..00000000000 --- a/tests/wpt/metadata/css/selectors/anplusb-selector-parsing.html.ini +++ /dev/null @@ -1,25 +0,0 @@ -[anplusb-selector-parsing.html] - [:nth-child(-n+0) should be parsed and serialized correctly] - expected: FAIL - - [:nth-child(-n) should be parsed and serialized correctly] - expected: FAIL - - [:nth-last-child(-n+0) should be parsed and serialized correctly] - expected: FAIL - - [:nth-last-child(-n) should be parsed and serialized correctly] - expected: FAIL - - [:nth-of-type(-n+0) should be parsed and serialized correctly] - expected: FAIL - - [:nth-of-type(-n) should be parsed and serialized correctly] - expected: FAIL - - [:nth-last-of-type(-n+0) should be parsed and serialized correctly] - expected: FAIL - - [:nth-last-of-type(-n) should be parsed and serialized correctly] - expected: FAIL -