diff --git a/components/style/stylesheets/rule_parser.rs b/components/style/stylesheets/rule_parser.rs index d380f179824..74425afafcd 100644 --- a/components/style/stylesheets/rule_parser.rs +++ b/components/style/stylesheets/rule_parser.rs @@ -193,7 +193,7 @@ impl<'a, 'i> AtRuleParser<'i> for TopLevelRuleParser<'a> { } if let AllowImportRules::No = self.allow_import_rules { - return Err(input.new_custom_error(StyleParseErrorKind::UnexpectedImportRule)) + return Err(input.new_custom_error(StyleParseErrorKind::DisallowedImportRule)) } // FIXME(emilio): We should always be able to have a loader diff --git a/components/style_traits/lib.rs b/components/style_traits/lib.rs index 516e7b6efba..be2d275b654 100644 --- a/components/style_traits/lib.rs +++ b/components/style_traits/lib.rs @@ -137,6 +137,8 @@ pub enum StyleParseErrorKind<'i> { UnexpectedNamespaceRule, /// @import must be before any rule but @charset UnexpectedImportRule, + /// @import rules are disallowed in the parser. + DisallowedImportRule, /// Unexpected @charset rule encountered. UnexpectedCharsetRule, /// Unsupported @ rule @@ -149,7 +151,6 @@ pub enum StyleParseErrorKind<'i> { ValueError(ValueParseErrorKind<'i>), /// An error was encountered while parsing a selector SelectorError(SelectorParseErrorKind<'i>), - /// The property declaration was for an unknown property. UnknownProperty(CowRcStr<'i>), /// The property declaration was for a disabled experimental property.