mirror of
https://github.com/servo/servo.git
synced 2025-08-12 00:45:33 +01:00
style: Fix indentation of multiple CssParserContext construction.
This commit is contained in:
parent
92e9f12bd0
commit
7a5a35f5e0
6 changed files with 132 additions and 103 deletions
|
@ -1016,18 +1016,23 @@ pub fn append_serialization<'a, W, I, N>(dest: &mut W,
|
|||
|
||||
/// A helper to parse the style attribute of an element, in order for this to be
|
||||
/// shared between Servo and Gecko.
|
||||
pub fn parse_style_attribute<R>(input: &str,
|
||||
url_data: &UrlExtraData,
|
||||
error_reporter: &R,
|
||||
quirks_mode: QuirksMode)
|
||||
-> PropertyDeclarationBlock
|
||||
where R: ParseErrorReporter
|
||||
pub fn parse_style_attribute<R>(
|
||||
input: &str,
|
||||
url_data: &UrlExtraData,
|
||||
error_reporter: &R,
|
||||
quirks_mode: QuirksMode,
|
||||
) -> PropertyDeclarationBlock
|
||||
where
|
||||
R: ParseErrorReporter
|
||||
{
|
||||
let context = ParserContext::new(Origin::Author,
|
||||
url_data,
|
||||
Some(CssRuleType::Style),
|
||||
ParsingMode::DEFAULT,
|
||||
quirks_mode);
|
||||
let context = ParserContext::new(
|
||||
Origin::Author,
|
||||
url_data,
|
||||
Some(CssRuleType::Style),
|
||||
ParsingMode::DEFAULT,
|
||||
quirks_mode,
|
||||
);
|
||||
|
||||
let error_context = ParserErrorContext { error_reporter: error_reporter };
|
||||
let mut input = ParserInput::new(input);
|
||||
parse_property_declaration_list(&context, &error_context, &mut Parser::new(&mut input))
|
||||
|
@ -1049,11 +1054,14 @@ pub fn parse_one_declaration_into<R>(
|
|||
where
|
||||
R: ParseErrorReporter
|
||||
{
|
||||
let context = ParserContext::new(Origin::Author,
|
||||
url_data,
|
||||
Some(CssRuleType::Style),
|
||||
parsing_mode,
|
||||
quirks_mode);
|
||||
let context = ParserContext::new(
|
||||
Origin::Author,
|
||||
url_data,
|
||||
Some(CssRuleType::Style),
|
||||
parsing_mode,
|
||||
quirks_mode,
|
||||
);
|
||||
|
||||
let mut input = ParserInput::new(input);
|
||||
let mut parser = Parser::new(&mut input);
|
||||
let start_position = parser.position();
|
||||
|
|
|
@ -954,7 +954,8 @@ impl UnparsedValue {
|
|||
::custom_properties::substitute(&self.css, self.first_token_type, custom_properties)
|
||||
.ok()
|
||||
.and_then(|css| {
|
||||
// As of this writing, only the base URL is used for property values:
|
||||
// As of this writing, only the base URL is used for property
|
||||
// values.
|
||||
let context = ParserContext::new(
|
||||
Origin::Author,
|
||||
&self.url_data,
|
||||
|
@ -962,6 +963,7 @@ impl UnparsedValue {
|
|||
ParsingMode::DEFAULT,
|
||||
quirks_mode,
|
||||
);
|
||||
|
||||
let mut input = ParserInput::new(&css);
|
||||
Parser::new(&mut input).parse_entirely(|input| {
|
||||
match self.from_shorthand {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue