Simply restyle damage macros (and convert them to be plain functions)#222
Merged
Loirooriol merged 2 commits intoservo:mainfrom Aug 7, 2025
Merged
Conversation
5737647 to
9101e5a
Compare
a95f8a9 to
8a31d6b
Compare
Loirooriol
requested changes
Aug 4, 2025
8a31d6b to
6cef25f
Compare
Loirooriol
reviewed
Aug 4, 2025
Signed-off-by: Nico Burns <nico@nicoburns.com>
6cef25f to
5079b1d
Compare
nicoburns
commented
Aug 5, 2025
Signed-off-by: Nico Burns <nico@nicoburns.com>
6ce5ee2 to
a58aed7
Compare
Loirooriol
approved these changes
Aug 7, 2025
github-merge-queue Bot
pushed a commit
to servo/servo
that referenced
this pull request
Aug 7, 2025
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>
emilio
reviewed
Aug 7, 2025
| }); | ||
| } | ||
| pub(crate) fn restyle_damage_${effect_name} (old: &ComputedValues, new: &ComputedValues) -> bool { | ||
| % for style_struct in data.active_style_structs(): |
Member
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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