From 735e0bb3f993de2e6229b8797ec7b7a0097dd77d Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Thu, 31 Oct 2013 14:40:48 +0000 Subject: [PATCH] Disable incorrect serializer fixups. --- serializer.rs | 68 ++++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/serializer.rs b/serializer.rs index abca8d84..595d311e 100644 --- a/serializer.rs +++ b/serializer.rs @@ -165,39 +165,41 @@ impl<'self, I: Iterator<&'self ComponentValue>> ToCss for I { ) loop { match self.next() { None => break, Some(component_value) => { let (a, b) = (previous, component_value); - if ( - matches!(*a, Hash(*) | IDHash(*) | AtKeyword(*)) && - matches!(*b, Number(*) | Percentage(*) | Ident(*) | Dimension(*) | - UnicodeRange(*) | URL(*) | Function(*)) - ) || ( - matches!(*a, Number(*) | Ident(*) | Dimension(*)) && - matches!(*b, Number(*) | Ident(*) | Dimension(*)) - ) || ( - matches!(*a, Number(*) | Ident(*) | Dimension(*)) && - matches!(*b, Percentage(*) | UnicodeRange(*) | URL(*) | Function(*)) - ) || ( - matches!(*a, Ident(*)) && - matches!(*b, ParenthesisBlock(*)) - ) || ( - matches!(*a, Delim('#') | Delim('@')) && - !matches!(*b, WhiteSpace) - ) || ( - matches!(*a, Delim('-') | Delim('+') | Delim('.') | Delim('<') | - Delim('>') | Delim('!')) && - !matches!(*b, WhiteSpace) - ) || ( - !matches!(*a, WhiteSpace) && - matches!(*b, Delim('-') | Delim('+') | Delim('.') | Delim('<') | - Delim('>') | Delim('!')) - ) || ( - matches!(*a, Delim('/')) && - matches!(*b, Delim('*')) - ) || ( - matches!(*a, Delim('*')) && - matches!(*b, Delim('/')) - ) { - css.push_str("/**/") - } +// FIXME: this is incorrect. +// See https://github.com/mozilla-servo/rust-cssparser/issues/24 +// if ( +// matches!(*a, Hash(*) | IDHash(*) | AtKeyword(*)) && +// matches!(*b, Number(*) | Percentage(*) | Ident(*) | Dimension(*) | +// UnicodeRange(*) | URL(*) | Function(*)) +// ) || ( +// matches!(*a, Number(*) | Ident(*) | Dimension(*)) && +// matches!(*b, Number(*) | Ident(*) | Dimension(*)) +// ) || ( +// matches!(*a, Number(*) | Ident(*) | Dimension(*)) && +// matches!(*b, Percentage(*) | UnicodeRange(*) | URL(*) | Function(*)) +// ) || ( +// matches!(*a, Ident(*)) && +// matches!(*b, ParenthesisBlock(*)) +// ) || ( +// matches!(*a, Delim('#') | Delim('@')) && +// !matches!(*b, WhiteSpace) +// ) || ( +// matches!(*a, Delim('-') | Delim('+') | Delim('.') | Delim('<') | +// Delim('>') | Delim('!')) && +// !matches!(*b, WhiteSpace) +// ) || ( +// !matches!(*a, WhiteSpace) && +// matches!(*b, Delim('-') | Delim('+') | Delim('.') | Delim('<') | +// Delim('>') | Delim('!')) +// ) || ( +// matches!(*a, Delim('/')) && +// matches!(*b, Delim('*')) +// ) || ( +// matches!(*a, Delim('*')) && +// matches!(*b, Delim('/')) +// ) { +// css.push_str("/**/") +// } component_value.to_css_push(css); previous = component_value; }}}