Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions style/properties/properties.mako.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3004,11 +3004,22 @@ const_assert!(std::mem::size_of::<longhands::${longhand.ident}::SpecifiedValue>(
% for effect_name in ["repaint", "recalculate_overflow", "rebuild_stacking_context", "rebuild_box"]:
pub(crate) fn restyle_damage_${effect_name} (old: &ComputedValues, new: &ComputedValues) -> bool {
% for style_struct in data.active_style_structs():
% for longhand in style_struct.longhands:
<% longhands_affected = [effect_name in longhand.servo_restyle_damage.split() for longhand in style_struct.longhands if not longhand.logical] %>
% if any(longhands_affected):
let old_${style_struct.name_lower} = old.get_${style_struct.name_lower}();
let new_${style_struct.name_lower} = new.get_${style_struct.name_lower}();
if !std::ptr::eq(old_${style_struct.name_lower}, new_${style_struct.name_lower}) {
if
% for longhand in style_struct.longhands:
% if effect_name in longhand.servo_restyle_damage.split() and not longhand.logical:
old.get_${style_struct.name_lower}().${longhand.ident} != new.get_${style_struct.name_lower}().${longhand.ident} ||
old_${style_struct.name_lower}.${longhand.ident} != new_${style_struct.name_lower}.${longhand.ident} ||
% endif
% endfor
% endfor
false {
return true;
}
}
% endif
% endfor
false
}
Expand Down
7 changes: 6 additions & 1 deletion style/servo/restyle_damage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ impl ServoRestyleDamage {
old: &ComputedValues,
new: &ComputedValues,
) -> StyleDifference {
let mut damage = compute_damage(old, new);
let mut damage = if std::ptr::eq(old, new) {
ServoRestyleDamage::empty()
} else {
compute_damage(old, new)
};

if damage.is_empty() {
return StyleDifference {
damage,
Expand Down