selectors: Don't serialize :nth-child(-n) as -1n.

This commit is contained in:
Emilio Cobos Álvarez 2018-04-07 12:57:32 +02:00
parent ecf71d77cd
commit 1eab5927a5
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 1 additions and 25 deletions

View file

@ -1021,6 +1021,7 @@ impl<Impl: SelectorImpl> ToCss for Component<Impl> {
(0, 0) => dest.write_char('0'), (0, 0) => dest.write_char('0'),
(1, 0) => dest.write_char('n'), (1, 0) => dest.write_char('n'),
(-1, 0) => dest.write_str("-n"),
(_, 0) => write!(dest, "{}n", a), (_, 0) => write!(dest, "{}n", a),
(0, _) => write!(dest, "{}", b), (0, _) => write!(dest, "{}", b),

View file

@ -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