From 1eab5927a555ebcf0971be8446005b8aaf21671c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 7 Apr 2018 12:57:32 +0200 Subject: [PATCH] selectors: Don't serialize :nth-child(-n) as -1n. --- components/selectors/parser.rs | 1 + .../anplusb-selector-parsing.html.ini | 25 ------------------- 2 files changed, 1 insertion(+), 25 deletions(-) delete mode 100644 tests/wpt/metadata/css/selectors/anplusb-selector-parsing.html.ini 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 -