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:
Oriol Brufau 2023-05-17 00:28:18 +02:00
parent 7425f2d922
commit 90a2687545
3 changed files with 51 additions and 3 deletions

View file

@ -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)
}
}
}
}