mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: A few minor formatting cleanups.
This commit is contained in:
parent
48ce204cb2
commit
4763d05cf0
2 changed files with 30 additions and 15 deletions
|
@ -61,13 +61,14 @@ pub struct ParserContext<'a> {
|
|||
|
||||
impl<'a> ParserContext<'a> {
|
||||
/// Create a parser context.
|
||||
pub fn new(stylesheet_origin: Origin,
|
||||
url_data: &'a UrlExtraData,
|
||||
error_reporter: &'a ParseErrorReporter,
|
||||
rule_type: Option<CssRuleType>,
|
||||
parsing_mode: ParsingMode,
|
||||
quirks_mode: QuirksMode)
|
||||
-> ParserContext<'a> {
|
||||
pub fn new(
|
||||
stylesheet_origin: Origin,
|
||||
url_data: &'a UrlExtraData,
|
||||
error_reporter: &'a ParseErrorReporter,
|
||||
rule_type: Option<CssRuleType>,
|
||||
parsing_mode: ParsingMode,
|
||||
quirks_mode: QuirksMode,
|
||||
) -> ParserContext<'a> {
|
||||
ParserContext {
|
||||
stylesheet_origin: stylesheet_origin,
|
||||
url_data: url_data,
|
||||
|
@ -88,7 +89,14 @@ impl<'a> ParserContext<'a> {
|
|||
parsing_mode: ParsingMode,
|
||||
quirks_mode: QuirksMode
|
||||
) -> ParserContext<'a> {
|
||||
Self::new(Origin::Author, url_data, error_reporter, rule_type, parsing_mode, quirks_mode)
|
||||
Self::new(
|
||||
Origin::Author,
|
||||
url_data,
|
||||
error_reporter,
|
||||
rule_type,
|
||||
parsing_mode,
|
||||
quirks_mode,
|
||||
)
|
||||
}
|
||||
|
||||
/// Create a parser context based on a previous context, but with a modified rule type.
|
||||
|
@ -115,7 +123,7 @@ impl<'a> ParserContext<'a> {
|
|||
error_reporter: &'a ParseErrorReporter,
|
||||
line_number_offset: u64,
|
||||
parsing_mode: ParsingMode,
|
||||
quirks_mode: QuirksMode
|
||||
quirks_mode: QuirksMode,
|
||||
) -> ParserContext<'a> {
|
||||
ParserContext {
|
||||
stylesheet_origin: stylesheet_origin,
|
||||
|
|
|
@ -158,8 +158,10 @@ impl<'a, 'i> AtRuleParser<'i> for TopLevelRuleParser<'a> {
|
|||
name: CowRcStr<'i>,
|
||||
input: &mut Parser<'i, 't>
|
||||
) -> Result<AtRuleType<AtRulePrelude, CssRule>, ParseError<'i>> {
|
||||
let location = get_location_with_offset(input.current_source_location(),
|
||||
self.context.line_number_offset);
|
||||
let location = get_location_with_offset(
|
||||
input.current_source_location(),
|
||||
self.context.line_number_offset,
|
||||
);
|
||||
match_ignore_ascii_case! { &*name,
|
||||
"import" => {
|
||||
if self.state > State::Imports {
|
||||
|
@ -241,8 +243,11 @@ impl<'a, 'i> AtRuleParser<'i> for TopLevelRuleParser<'a> {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
fn parse_block<'t>(&mut self, prelude: AtRulePrelude, input: &mut Parser<'i, 't>)
|
||||
-> Result<CssRule, ParseError<'i>> {
|
||||
fn parse_block<'t>(
|
||||
&mut self,
|
||||
prelude: AtRulePrelude,
|
||||
input: &mut Parser<'i, 't>
|
||||
) -> Result<CssRule, ParseError<'i>> {
|
||||
AtRuleParser::parse_block(&mut self.nested(), prelude, input)
|
||||
}
|
||||
}
|
||||
|
@ -258,8 +263,10 @@ impl<'a, 'i> QualifiedRuleParser<'i> for TopLevelRuleParser<'a> {
|
|||
type Error = SelectorParseError<'i, StyleParseError<'i>>;
|
||||
|
||||
#[inline]
|
||||
fn parse_prelude<'t>(&mut self, input: &mut Parser<'i, 't>)
|
||||
-> Result<QualifiedRuleParserPrelude, ParseError<'i>> {
|
||||
fn parse_prelude<'t>(
|
||||
&mut self,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<QualifiedRuleParserPrelude, ParseError<'i>> {
|
||||
self.state = State::Body;
|
||||
QualifiedRuleParser::parse_prelude(&mut self.nested(), input)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue