stylo: Update rust-cssparser; extract more specific error types when reporting (bug 1352669).

This commit is contained in:
Josh Matthews 2017-07-06 13:59:31 -04:00
parent a08371e8eb
commit 0b43d0072c
21 changed files with 318 additions and 80 deletions

View file

@ -59,7 +59,7 @@ pub enum SelectorParseError<'i, T> {
PseudoElementExpectedIdent,
UnsupportedPseudoClass,
UnexpectedIdent(CompactCowStr<'i>),
ExpectedNamespace,
ExpectedNamespace(CompactCowStr<'i>),
Custom(T),
}
@ -1105,9 +1105,10 @@ fn parse_qualified_name<'i, 't, P, E, Impl>
let position = input.position();
match input.next_including_whitespace() {
Ok(Token::Delim('|')) => {
let prefix = from_cow_str(value.into());
let prefix = from_cow_str(value.clone().into());
let result = parser.namespace_for_prefix(&prefix);
let url = result.ok_or(ParseError::Custom(SelectorParseError::ExpectedNamespace))?;
let url = result.ok_or(ParseError::Custom(
SelectorParseError::ExpectedNamespace(value.into())))?;
explicit_namespace(input, QNamePrefix::ExplicitNamespace(prefix, url))
},
_ => {