aboutsummaryrefslogtreecommitdiffstats
path: root/components/selectors/parser.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2017-07-06 13:59:31 -0400
committerJosh Matthews <josh@joshmatthews.net>2017-07-10 20:46:12 -0400
commit0b43d0072ce8112b661daef2a9b52fc95143308c (patch)
tree8d06812456367650dc20efccd2fc3f1b8c2fbd5c /components/selectors/parser.rs
parenta08371e8eb343bd6372aa60d7658ff4b7bb5da15 (diff)
downloadservo-0b43d0072ce8112b661daef2a9b52fc95143308c.tar.gz
servo-0b43d0072ce8112b661daef2a9b52fc95143308c.zip
stylo: Update rust-cssparser; extract more specific error types when reporting (bug 1352669).
Diffstat (limited to 'components/selectors/parser.rs')
-rw-r--r--components/selectors/parser.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/components/selectors/parser.rs b/components/selectors/parser.rs
index f341911a33c..676c1946822 100644
--- a/components/selectors/parser.rs
+++ b/components/selectors/parser.rs
@@ -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))
},
_ => {