mirror of
https://github.com/servo/servo.git
synced 2025-08-09 23:45:35 +01:00
stylo: Error reporting for unknown media features
This commit is contained in:
parent
54cd23adb8
commit
337a90329c
12 changed files with 206 additions and 109 deletions
|
@ -19,7 +19,7 @@ pub enum ContextualParseError<'a> {
|
|||
UnsupportedPropertyDeclaration(&'a str, ParseError<'a>),
|
||||
/// A font face descriptor was not recognized.
|
||||
UnsupportedFontFaceDescriptor(&'a str, ParseError<'a>),
|
||||
/// A font feature values descroptor was not recognized.
|
||||
/// A font feature values descriptor was not recognized.
|
||||
UnsupportedFontFeatureValuesDescriptor(&'a str, ParseError<'a>),
|
||||
/// A keyframe rule was not valid.
|
||||
InvalidKeyframeRule(&'a str, ParseError<'a>),
|
||||
|
@ -44,7 +44,9 @@ pub enum ContextualParseError<'a> {
|
|||
/// A counter style rule had extends with symbols.
|
||||
InvalidCounterStyleExtendsWithSymbols,
|
||||
/// A counter style rule had extends with additive-symbols.
|
||||
InvalidCounterStyleExtendsWithAdditiveSymbols
|
||||
InvalidCounterStyleExtendsWithAdditiveSymbols,
|
||||
/// A media rule was invalid for some reason.
|
||||
InvalidMediaRule(&'a str, ParseError<'a>),
|
||||
}
|
||||
|
||||
impl<'a> fmt::Display for ContextualParseError<'a> {
|
||||
|
@ -168,6 +170,10 @@ impl<'a> fmt::Display for ContextualParseError<'a> {
|
|||
ContextualParseError::InvalidCounterStyleExtendsWithAdditiveSymbols => {
|
||||
write!(f, "Invalid @counter-style rule: 'system: extends …' with 'additive-symbols'")
|
||||
}
|
||||
ContextualParseError::InvalidMediaRule(media_rule, ref err) => {
|
||||
write!(f, "Invalid media rule: {}, ", media_rule)?;
|
||||
parse_error_to_str(err, f)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue