mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
style: Add a CSS error to the console when using non-featureless :host selectors
(which would never match by definition). Differential Revision: https://phabricator.services.mozilla.com/D111610
This commit is contained in:
parent
7425f2d922
commit
90a2687545
3 changed files with 51 additions and 3 deletions
|
@ -54,6 +54,8 @@ pub enum ContextualParseError<'a> {
|
|||
InvalidMediaRule(&'a str, ParseError<'a>),
|
||||
/// A value was not recognized.
|
||||
UnsupportedValue(&'a str, ParseError<'a>),
|
||||
/// A never-matching `:host` selector was found.
|
||||
NeverMatchingHostSelector(String),
|
||||
}
|
||||
|
||||
impl<'a> fmt::Display for ContextualParseError<'a> {
|
||||
|
@ -210,6 +212,9 @@ impl<'a> fmt::Display for ContextualParseError<'a> {
|
|||
parse_error_to_str(err, f)
|
||||
},
|
||||
ContextualParseError::UnsupportedValue(_value, ref err) => parse_error_to_str(err, f),
|
||||
ContextualParseError::NeverMatchingHostSelector(ref selector) => {
|
||||
write!(f, ":host selector is not featureless: {}", selector)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue