mirror of
https://github.com/servo/servo.git
synced 2025-08-15 10:25:32 +01:00
style: Stop the cascade when only reset structs change.
Bug: 1395227 Reviewed-by: heycam MozReview-Commit-ID: JCZJl2fmtJ9 Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
parent
f5e23a3a90
commit
825f623b3c
6 changed files with 101 additions and 69 deletions
|
@ -65,7 +65,14 @@ impl ServoRestyleDamage {
|
|||
new: &ComputedValues,
|
||||
) -> StyleDifference {
|
||||
let damage = compute_damage(old, new);
|
||||
let change = if damage.is_empty() { StyleChange::Unchanged } else { StyleChange::Changed };
|
||||
let change = if damage.is_empty() {
|
||||
StyleChange::Unchanged
|
||||
} else {
|
||||
// FIXME(emilio): Differentiate between reset and inherited
|
||||
// properties here, and set `reset_only` appropriately so the
|
||||
// optimization to skip the cascade in those cases applies.
|
||||
StyleChange::Changed { reset_only: false }
|
||||
};
|
||||
StyleDifference::new(damage, change)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue