From 549cdb27d9ce5849c9e212a2b5c305d6f227c5be Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 28 Aug 2017 17:22:24 -0700 Subject: [PATCH] Report invalid at-rules (bug 1384216). --- ports/geckolib/error_reporter.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ports/geckolib/error_reporter.rs b/ports/geckolib/error_reporter.rs index 67afdb0dfba..09875015ed6 100644 --- a/ports/geckolib/error_reporter.rs +++ b/ports/geckolib/error_reporter.rs @@ -203,7 +203,9 @@ fn extract_error_param<'a>(err: ParseError<'a>) -> Option> { CssParseError::Basic(BasicParseError::UnexpectedToken(t)) => ErrorString::UnexpectedToken(t), - CssParseError::Basic(BasicParseError::AtRuleInvalid(i)) => + CssParseError::Basic(BasicParseError::AtRuleInvalid(i)) | + CssParseError::Custom(SelectorParseError::Custom( + StyleParseError::UnsupportedAtRule(i))) => ErrorString::Snippet(format!("@{}", escape_css_ident(&i)).into()), CssParseError::Custom(SelectorParseError::Custom( @@ -344,6 +346,12 @@ impl<'a> ErrorHelpers<'a> for ContextualParseError<'a> { _, CssParseError::Custom(SelectorParseError::Custom( StyleParseError::UnexpectedTokenWithinNamespace(_)))) => (b"PEAtNSUnexpected\0", Action::Nothing), + ContextualParseError::InvalidRule( + _, CssParseError::Basic(BasicParseError::AtRuleInvalid(_))) | + ContextualParseError::InvalidRule( + _, CssParseError::Custom(SelectorParseError::Custom( + StyleParseError::UnsupportedAtRule(_)))) => + (b"PEUnknownAtRule\0", Action::Nothing), ContextualParseError::InvalidRule(_, ref err) => { let prefix = match *err { CssParseError::Custom(SelectorParseError::UnexpectedTokenInAttributeSelector(_)) =>