diff --git a/servo/components/selectors/parser.rs b/servo/components/selectors/parser.rs index 56f801d06133..865424120e84 100644 --- a/servo/components/selectors/parser.rs +++ b/servo/components/selectors/parser.rs @@ -1503,6 +1503,14 @@ impl ToCss for Component { AttributeOther(ref attr_selector) => attr_selector.to_css(dest), // Pseudo-classes + Negation(ref arg) => { + dest.write_str(":not(")?; + for component in arg.iter() { + component.to_css(dest)?; + } + dest.write_str(")") + }, + FirstChild => dest.write_str(":first-child"), LastChild => dest.write_str(":last-child"), OnlyChild => dest.write_str(":only-child"), @@ -1532,11 +1540,10 @@ impl ToCss for Component { write_affine(dest, a, b)?; dest.write_char(')') }, - Is(ref list) | Where(ref list) | Negation(ref list) => { + Is(ref list) | Where(ref list) => { match *self { Where(..) => dest.write_str(":where(")?, Is(..) => dest.write_str(":is(")?, - Negation(..) => dest.write_str(":not(")?, _ => unreachable!(), } serialize_selector_list(list.iter(), dest)?;