mirror of
https://github.com/servo/servo.git
synced 2025-08-11 16:35:33 +01:00
style: Stop inspecting children to recascade them just because we reframed.
We only need to do this when display changes from none to non-none, so handle it explicitly when computing the cascade requirement. This patch also removes a few conditions that are redundant because they're handled also by the cascade requirement check, like the initial styling.
This commit is contained in:
parent
5200ded17c
commit
3a5d70f106
2 changed files with 21 additions and 16 deletions
|
@ -508,23 +508,20 @@ where
|
|||
// Before examining each child individually, try to prove that our children
|
||||
// don't need style processing. They need processing if any of the following
|
||||
// conditions hold:
|
||||
// * We have the dirty descendants bit.
|
||||
// * We're propagating a hint.
|
||||
// * This is the initial style.
|
||||
// * We generated a reconstruct hint on self (which could mean that we
|
||||
// switched from display:none to something else, which means the children
|
||||
// need initial styling).
|
||||
// * This is a servo non-incremental traversal.
|
||||
//
|
||||
// * We have the dirty descendants bit.
|
||||
// * We're propagating a restyle hint.
|
||||
// * We can't skip the cascade.
|
||||
// * This is a servo non-incremental traversal.
|
||||
//
|
||||
// Additionally, there are a few scenarios where we avoid traversing the
|
||||
// subtree even if descendant styles are out of date. These cases are
|
||||
// enumerated in should_cull_subtree().
|
||||
let mut traverse_children = has_dirty_descendants_for_this_restyle ||
|
||||
!propagated_hint.is_empty() ||
|
||||
!child_cascade_requirement.can_skip_cascade() ||
|
||||
context.thread_local.is_initial_style() ||
|
||||
data.reconstructed_self() ||
|
||||
is_servo_nonincremental_layout();
|
||||
let mut traverse_children =
|
||||
has_dirty_descendants_for_this_restyle ||
|
||||
!propagated_hint.is_empty() ||
|
||||
!child_cascade_requirement.can_skip_cascade() ||
|
||||
is_servo_nonincremental_layout();
|
||||
|
||||
traverse_children =
|
||||
traverse_children &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue