Make RestyleDamage an associated type and make embedder responsible for all damage computation#224
Draft
nicoburns wants to merge 9 commits intoservo:mainfrom
Draft
Make RestyleDamage an associated type and make embedder responsible for all damage computation#224nicoburns wants to merge 9 commits intoservo:mainfrom
RestyleDamage an associated type and make embedder responsible for all damage computation#224nicoburns wants to merge 9 commits intoservo:mainfrom
Conversation
Any ancestors of this commit are from upstream mozilla-central, with some filtering and renaming. Our patches and sync tooling start here. The sync tooling has all been squashed into this commit, based on: https://github.com/servo/stylo/commits/64731e10dc8ef87ef52aa2fb9f988c3b2530f3a7
This is a rebase of 22df130 Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
There is no point in setting this flag to true when it's no longer doing anything, `transition-behavior` is now enabled unconditionally. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
0b1623f to
4fe9a9a
Compare
…servo#222) * Simplify restyle damage macros Signed-off-by: Nico Burns <nico@nicoburns.com> * Don't diff custom properties if we've already set damage anyway Signed-off-by: Nico Burns <nico@nicoburns.com> --------- Signed-off-by: Nico Burns <nico@nicoburns.com>
Signed-off-by: Nico Burns <nico@nicoburns.com>
4fe9a9a to
ef96559
Compare
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.
Draft for design review: does the key idea here (pushing the top-level
compute_style_differenceup to the embedder) seem like a good idea?(includes the changes from #222 which is a much more surface-level change)
Servo PR: servo/servo#38479
Objective
restyle_damage_*functions) is exposed as public library functions that the embedded can call into).LayoutDamagetype.RestyleDamagetype more explicit (by making it a trait)Changes Made
TRestyleDamagetrait to represent restyle damageRestyleDamageassociated type toTElementtraitcompute_style_differencefunction from the (private)MatchMethodstrait to the (public)TElementtrait (so that the embedder can implement it).TElement::compute_layout_damagemethod (embedders should now usecompute_style_differenceinstead).ElementDatastruct generic overTElementRestyleDamage::reconstructto::set_rebuild_pseudos(because that is the scenario in which it's called, and pseudos having changed doesn't necessarily imply that the entire box needs to be reconstructed (although Servo will presumably continue to do that for now))
Notes
There are a few places where Servo does different things to Gecko around
RestyleDamage:A key one is that in Gecko
RestyleDamage::is_empty()will befalse(triggering aStyleChange::Changedto be returned to Stylo) if any style property has changed. Whereas in Servo this only happens if one of the properties we check for damage has changed.We should check what the correct semantics are here and whether Servo's implementation is correct/valid.