Auto merge of #17788 - emilio:clean-cascade, r=heycam

style: Cleanup the cascade a good bit.

Was about the time.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17788)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-07-20 02:36:15 -07:00 committed by GitHub
commit f594ae58a6
20 changed files with 286 additions and 248 deletions

View file

@ -455,12 +455,7 @@ impl AnimatedProperty {
let value: longhands::${prop.ident}::computed_value::T =
ToAnimatedValue::from_animated_value(value);
% endif
<% method = "style.mutate_" + prop.style_struct.ident.strip("_") + "().set_" + prop.ident %>
% if prop.has_uncacheable_values is "True":
${method}(value, &mut false);
% else:
${method}(value);
% endif
style.mutate_${prop.style_struct.name_lower}().set_${prop.ident}(value);
}
% endif
% endfor
@ -562,9 +557,12 @@ impl AnimationValue {
}
}
/// Construct an AnimationValue from a property declaration
pub fn from_declaration(decl: &PropertyDeclaration, context: &mut Context,
initial: &ComputedValues) -> Option<Self> {
/// Construct an AnimationValue from a property declaration.
pub fn from_declaration(
decl: &PropertyDeclaration,
context: &mut Context,
initial: &ComputedValues
) -> Option<Self> {
use properties::LonghandId;
match *decl {
@ -606,7 +604,7 @@ impl AnimationValue {
CSSWideKeyword::Unset |
% endif
CSSWideKeyword::Inherit => {
let inherit_struct = context.inherited_style
let inherit_struct = context.inherited_style()
.get_${prop.style_struct.name_lower}();
inherit_struct.clone_${prop.ident}()
},