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:
Emilio Cobos Álvarez 2017-09-04 14:50:13 +02:00
parent f5e23a3a90
commit 825f623b3c
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
6 changed files with 101 additions and 69 deletions

View file

@ -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)
}