mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +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> {
|
||||
/// We parse rules directly into the declarations object
|
||||
type Declaration = ParsedDeclaration;
|
||||
|
||||
fn parse_value(&mut self, name: &str, input: &mut Parser) -> Result<ParsedDeclaration, ()> {
|
||||
|
|
|
@ -823,7 +823,7 @@ pub enum ParsedDeclaration {
|
|||
impl ParsedDeclaration {
|
||||
/// Transform this ParsedDeclaration into a sequence of PropertyDeclaration
|
||||
/// 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 {
|
||||
% for shorthand in data.shorthands:
|
||||
ParsedDeclaration::${shorthand.camel_case}(
|
||||
|
@ -834,7 +834,7 @@ impl ParsedDeclaration {
|
|||
}
|
||||
) => {
|
||||
% for sub_property in shorthand.sub_properties:
|
||||
f(PropertyDeclaration::${sub_property.camel_case}(
|
||||
push(PropertyDeclaration::${sub_property.camel_case}(
|
||||
% if sub_property.boxed:
|
||||
DeclaredValue::Value(Box::new(${sub_property.ident}))
|
||||
% else:
|
||||
|
@ -845,7 +845,7 @@ impl ParsedDeclaration {
|
|||
}
|
||||
ParsedDeclaration::${shorthand.camel_case}CSSWideKeyword(keyword) => {
|
||||
% for sub_property in shorthand.sub_properties:
|
||||
f(PropertyDeclaration::${sub_property.camel_case}(
|
||||
push(PropertyDeclaration::${sub_property.camel_case}(
|
||||
DeclaredValue::CSSWideKeyword(keyword)
|
||||
));
|
||||
% endfor
|
||||
|
@ -856,13 +856,13 @@ impl ParsedDeclaration {
|
|||
Some(ShorthandId::${shorthand.camel_case})
|
||||
);
|
||||
% for sub_property in shorthand.sub_properties:
|
||||
f(PropertyDeclaration::${sub_property.camel_case}(
|
||||
push(PropertyDeclaration::${sub_property.camel_case}(
|
||||
DeclaredValue::WithVariables(value.clone())
|
||||
));
|
||||
% endfor
|
||||
}
|
||||
% endfor
|
||||
ParsedDeclaration::LonghandOrCustom(declaration) => f(declaration),
|
||||
ParsedDeclaration::LonghandOrCustom(declaration) => push(declaration),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue