style: Cleanup ParserContext::new_with_rule_type.

This commit is contained in:
Emilio Cobos Álvarez 2017-08-18 15:24:39 +02:00
parent 4763d05cf0
commit a962c54928
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
8 changed files with 118 additions and 40 deletions

View file

@ -102,17 +102,18 @@ impl<'a> ParserContext<'a> {
/// Create a parser context based on a previous context, but with a modified rule type.
pub fn new_with_rule_type(
context: &'a ParserContext,
rule_type: Option<CssRuleType>
rule_type: CssRuleType,
namespaces: &'a Namespaces,
) -> ParserContext<'a> {
ParserContext {
stylesheet_origin: context.stylesheet_origin,
url_data: context.url_data,
error_reporter: context.error_reporter,
rule_type: rule_type,
rule_type: Some(rule_type),
line_number_offset: context.line_number_offset,
parsing_mode: context.parsing_mode,
quirks_mode: context.quirks_mode,
namespaces: context.namespaces,
namespaces: Some(namespaces),
}
}