Skip to content

Commit a95f8a9

Browse files
committed
Convert macros to functions
1 parent 9101e5a commit a95f8a9

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

style/properties/properties.mako.rs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2964,17 +2964,15 @@ const_assert!(std::mem::size_of::<longhands::${longhand.ident}::SpecifiedValue>(
29642964

29652965
% if engine == "servo":
29662966
% for effect_name in ["repaint", "recalculate_overflow", "rebuild_stacking_context", "rebuild_box"]:
2967-
macro_rules! restyle_damage_${effect_name} {
2968-
($old: ident, $new: ident) => ({
2969-
% for style_struct in data.active_style_structs():
2970-
% for longhand in style_struct.longhands:
2971-
% if effect_name in longhand.servo_restyle_damage.split() and not longhand.logical:
2972-
$old.get_${style_struct.name_lower}().${longhand.ident} != $new.get_${style_struct.name_lower}().${longhand.ident} ||
2973-
% endif
2974-
% endfor
2975-
% endfor
2976-
false
2977-
});
2978-
}
2967+
pub(crate) fn restyle_damage_${effect_name} (old: &ComputedValues, new: &ComputedValues) -> bool {
2968+
% for style_struct in data.active_style_structs():
2969+
% for longhand in style_struct.longhands:
2970+
% if effect_name in longhand.servo_restyle_damage.split() and not longhand.logical:
2971+
old.get_${style_struct.name_lower}().${longhand.ident} != new.get_${style_struct.name_lower}().${longhand.ident} ||
2972+
% endif
2973+
% endfor
2974+
% endfor
2975+
false
2976+
}
29792977
% endfor
29802978
% endif

0 commit comments

Comments
 (0)