PropertyDeclarationParseResult -> Result<(), PropertyDeclarationParseError>

This commit is contained in:
Simon Sapin 2017-03-07 16:19:06 +01:00
parent da6316fbe3
commit 7455ad5eb4
5 changed files with 30 additions and 45 deletions

View file

@ -205,7 +205,6 @@ impl Declaration {
///
/// https://drafts.csswg.org/css-conditional-3/#support-definition
pub fn eval(&self, cx: &ParserContext) -> bool {
use properties::PropertyDeclarationParseResult::*;
let id = if let Ok(id) = PropertyId::parse((&*self.prop).into()) {
id
} else {
@ -219,13 +218,6 @@ impl Declaration {
if !input.is_exhausted() {
return false;
}
match res {
UnknownProperty => false,
ExperimentalProperty => false, // only happens for experimental props
// that haven't been enabled
InvalidValue => false,
AnimationPropertyInKeyframeBlock => unreachable!(),
ValidOrIgnoredDeclaration => true,
}
res.is_ok()
}
}