- 
                Notifications
    
You must be signed in to change notification settings  - Fork 53
 
Simply restyle damage macros (and convert them to be plain functions) #222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simply restyle damage macros (and convert them to be plain functions) #222
Conversation
5737647    to
    9101e5a      
    Compare
  
    a95f8a9    to
    8a31d6b      
    Compare
  
    8a31d6b    to
    6cef25f      
    Compare
  
    Signed-off-by: Nico Burns <nico@nicoburns.com>
6cef25f    to
    5079b1d      
    Compare
  
    Signed-off-by: Nico Burns <nico@nicoburns.com>
6ce5ee2    to
    a58aed7      
    Compare
  
    Servo PR for servo/stylo#222 Fixes: #38506 Testing: adding new tests --------- Signed-off-by: Nico Burns <nico@nicoburns.com> Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
| }); | ||
| } | ||
| pub(crate) fn restyle_damage_${effect_name} (old: &ComputedValues, new: &ComputedValues) -> bool { | ||
| % for style_struct in data.active_style_structs(): | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW you really want to check arc::ptr_eq(old.get_${style_struct}(), new${style_struct}()) or so to avoid most of these comparisons. That's equivalent to what gecko does in CalcStyleDifference: https://searchfox.org/mozilla-central/rev/f6a806c38c459e0e0d797d264ca0e8ad46005105/layout/style/ComputedStyle.cpp#133
Changes made:
restyle_damage_*macros to plain functions.damageobject, aRestyleDamageflag to apply, and an optional extra condition, we make the return a boolean and handle the rest in regular code.if-elseinstead of||for short-circuiting.Servo PR servo/servo#38465