mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Better variable name, remove obsolete comment
This commit is contained in:
parent
60f454d7c4
commit
446aaa5845
2 changed files with 5 additions and 6 deletions
|
@ -393,7 +393,6 @@ impl<'a, 'b> AtRuleParser for KeyframeDeclarationParser<'a, 'b> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, 'b> DeclarationParser for KeyframeDeclarationParser<'a, 'b> {
|
impl<'a, 'b> DeclarationParser for KeyframeDeclarationParser<'a, 'b> {
|
||||||
/// We parse rules directly into the declarations object
|
|
||||||
type Declaration = ParsedDeclaration;
|
type Declaration = ParsedDeclaration;
|
||||||
|
|
||||||
fn parse_value(&mut self, name: &str, input: &mut Parser) -> Result<ParsedDeclaration, ()> {
|
fn parse_value(&mut self, name: &str, input: &mut Parser) -> Result<ParsedDeclaration, ()> {
|
||||||
|
|
|
@ -823,7 +823,7 @@ pub enum ParsedDeclaration {
|
||||||
impl ParsedDeclaration {
|
impl ParsedDeclaration {
|
||||||
/// Transform this ParsedDeclaration into a sequence of PropertyDeclaration
|
/// Transform this ParsedDeclaration into a sequence of PropertyDeclaration
|
||||||
/// by expanding shorthand declarations into their corresponding longhands
|
/// by expanding shorthand declarations into their corresponding longhands
|
||||||
pub fn expand<F>(self, mut f: F) where F: FnMut(PropertyDeclaration) {
|
pub fn expand<F>(self, mut push: F) where F: FnMut(PropertyDeclaration) {
|
||||||
match self {
|
match self {
|
||||||
% for shorthand in data.shorthands:
|
% for shorthand in data.shorthands:
|
||||||
ParsedDeclaration::${shorthand.camel_case}(
|
ParsedDeclaration::${shorthand.camel_case}(
|
||||||
|
@ -834,7 +834,7 @@ impl ParsedDeclaration {
|
||||||
}
|
}
|
||||||
) => {
|
) => {
|
||||||
% for sub_property in shorthand.sub_properties:
|
% for sub_property in shorthand.sub_properties:
|
||||||
f(PropertyDeclaration::${sub_property.camel_case}(
|
push(PropertyDeclaration::${sub_property.camel_case}(
|
||||||
% if sub_property.boxed:
|
% if sub_property.boxed:
|
||||||
DeclaredValue::Value(Box::new(${sub_property.ident}))
|
DeclaredValue::Value(Box::new(${sub_property.ident}))
|
||||||
% else:
|
% else:
|
||||||
|
@ -845,7 +845,7 @@ impl ParsedDeclaration {
|
||||||
}
|
}
|
||||||
ParsedDeclaration::${shorthand.camel_case}CSSWideKeyword(keyword) => {
|
ParsedDeclaration::${shorthand.camel_case}CSSWideKeyword(keyword) => {
|
||||||
% for sub_property in shorthand.sub_properties:
|
% for sub_property in shorthand.sub_properties:
|
||||||
f(PropertyDeclaration::${sub_property.camel_case}(
|
push(PropertyDeclaration::${sub_property.camel_case}(
|
||||||
DeclaredValue::CSSWideKeyword(keyword)
|
DeclaredValue::CSSWideKeyword(keyword)
|
||||||
));
|
));
|
||||||
% endfor
|
% endfor
|
||||||
|
@ -856,13 +856,13 @@ impl ParsedDeclaration {
|
||||||
Some(ShorthandId::${shorthand.camel_case})
|
Some(ShorthandId::${shorthand.camel_case})
|
||||||
);
|
);
|
||||||
% for sub_property in shorthand.sub_properties:
|
% for sub_property in shorthand.sub_properties:
|
||||||
f(PropertyDeclaration::${sub_property.camel_case}(
|
push(PropertyDeclaration::${sub_property.camel_case}(
|
||||||
DeclaredValue::WithVariables(value.clone())
|
DeclaredValue::WithVariables(value.clone())
|
||||||
));
|
));
|
||||||
% endfor
|
% endfor
|
||||||
}
|
}
|
||||||
% endfor
|
% endfor
|
||||||
ParsedDeclaration::LonghandOrCustom(declaration) => f(declaration),
|
ParsedDeclaration::LonghandOrCustom(declaration) => push(declaration),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue