Ensure reflow damage is calculated when hypothetical box changes.

This commit is contained in:
Josh Matthews 2022-03-14 12:20:46 -04:00
parent 58920c7550
commit 3058bf9aeb
3 changed files with 7 additions and 5 deletions

View file

@ -4131,6 +4131,9 @@ macro_rules! longhand_properties_idents {
% for effect_name in ["repaint", "reflow_out_of_flow", "reflow", "rebuild_and_reflow_inline", "rebuild_and_reflow"]: % for effect_name in ["repaint", "reflow_out_of_flow", "reflow", "rebuild_and_reflow_inline", "rebuild_and_reflow"]:
macro_rules! restyle_damage_${effect_name} { macro_rules! restyle_damage_${effect_name} {
($old: ident, $new: ident, $damage: ident, [ $($effect:expr),* ]) => ({ ($old: ident, $new: ident, $damage: ident, [ $($effect:expr),* ]) => ({
restyle_damage_${effect_name}!($old, $new, $damage, [$($effect),*], false)
});
($old: ident, $new: ident, $damage: ident, [ $($effect:expr),* ], $extra:expr) => ({
if if
% for style_struct in data.active_style_structs(): % for style_struct in data.active_style_structs():
% for longhand in style_struct.longhands: % for longhand in style_struct.longhands:
@ -4141,13 +4144,13 @@ macro_rules! longhand_properties_idents {
% endfor % endfor
% endfor % endfor
false { $extra || false {
$damage.insert($($effect)|*); $damage.insert($($effect)|*);
true true
} else { } else {
false false
} }
}) });
} }
% endfor % endfor
% endif % endif

View file

@ -210,7 +210,8 @@ fn compute_damage(old: &ComputedValues, new: &ComputedValues) -> ServoRestyleDam
ServoRestyleDamage::REFLOW_OUT_OF_FLOW, ServoRestyleDamage::REFLOW_OUT_OF_FLOW,
ServoRestyleDamage::REFLOW, ServoRestyleDamage::REFLOW,
ServoRestyleDamage::RECONSTRUCT_FLOW ServoRestyleDamage::RECONSTRUCT_FLOW
] ],
old.get_box().original_display != new.get_box().original_display
) || (new.get_box().display == Display::Inline && ) || (new.get_box().display == Display::Inline &&
restyle_damage_rebuild_and_reflow_inline!( restyle_damage_rebuild_and_reflow_inline!(
old, old,

View file

@ -1,2 +0,0 @@
[hypothetical-box-dynamic.html]
expected: FAIL