mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
style: Add CSS Error for DisallowedImportRule.
- Add new CSS Error - Add new test case for error - Ensure that test cases use `replace()` and `replaceSync()` Differential Revision: https://phabricator.services.mozilla.com/D69423
This commit is contained in:
parent
c55cd22339
commit
87139a3ea2
2 changed files with 3 additions and 2 deletions
|
@ -193,7 +193,7 @@ impl<'a, 'i> AtRuleParser<'i> for TopLevelRuleParser<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
if let AllowImportRules::No = self.allow_import_rules {
|
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
|
// FIXME(emilio): We should always be able to have a loader
|
||||||
|
|
|
@ -137,6 +137,8 @@ pub enum StyleParseErrorKind<'i> {
|
||||||
UnexpectedNamespaceRule,
|
UnexpectedNamespaceRule,
|
||||||
/// @import must be before any rule but @charset
|
/// @import must be before any rule but @charset
|
||||||
UnexpectedImportRule,
|
UnexpectedImportRule,
|
||||||
|
/// @import rules are disallowed in the parser.
|
||||||
|
DisallowedImportRule,
|
||||||
/// Unexpected @charset rule encountered.
|
/// Unexpected @charset rule encountered.
|
||||||
UnexpectedCharsetRule,
|
UnexpectedCharsetRule,
|
||||||
/// Unsupported @ rule
|
/// Unsupported @ rule
|
||||||
|
@ -149,7 +151,6 @@ pub enum StyleParseErrorKind<'i> {
|
||||||
ValueError(ValueParseErrorKind<'i>),
|
ValueError(ValueParseErrorKind<'i>),
|
||||||
/// An error was encountered while parsing a selector
|
/// An error was encountered while parsing a selector
|
||||||
SelectorError(SelectorParseErrorKind<'i>),
|
SelectorError(SelectorParseErrorKind<'i>),
|
||||||
|
|
||||||
/// The property declaration was for an unknown property.
|
/// The property declaration was for an unknown property.
|
||||||
UnknownProperty(CowRcStr<'i>),
|
UnknownProperty(CowRcStr<'i>),
|
||||||
/// The property declaration was for a disabled experimental property.
|
/// The property declaration was for a disabled experimental property.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue