mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
stylo: Update rust-cssparser; extract more specific error types when reporting (bug 1352669).
This commit is contained in:
parent
a08371e8eb
commit
0b43d0072c
21 changed files with 318 additions and 80 deletions
|
@ -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))
|
||||
},
|
||||
_ => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue