Stringify the parent selector normally.

This commit is contained in:
Natalie Weizenbaum 2016-08-19 14:09:20 -07:00
parent 64e4954656
commit 55e81951b2
2 changed files with 4 additions and 4 deletions

View File

@ -15,6 +15,4 @@ class ParentSelector extends SimpleSelector {
List<SimpleSelector> unify(List<SimpleSelector> compound) =>
throw new UnsupportedError("& doesn't support unification.");
String toString() => "&${suffix ?? ''}";
}

View File

@ -315,8 +315,10 @@ class _SerializeCssVisitor extends CssVisitor {
(complex) => visitComplexSelector(complex));
}
void visitParentSelector(ParentSelector parent) =>
throw new UnsupportedError("$parent cannot be converted to CSS.");
void visitParentSelector(ParentSelector parent) {
_buffer.writeCharCode($and);
if (parent.suffix != null) _buffer.write(parent.suffix);
}
void visitPseudoSelector(PseudoSelector pseudo) {
_buffer.writeCharCode($colon);