mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Only clear the descendants bit for which we're traversing.
Doing anything else is non-sensical, since we're not guaranteed to reach all of the bits from traversal Y when doing traversal X. MozReview-Commit-ID: FQliRxBan70
This commit is contained in:
parent
805beb3a40
commit
18ad382f00
1 changed files with 23 additions and 21 deletions
|
@ -606,27 +606,29 @@ where
|
||||||
data.clear_restyle_flags_and_damage();
|
data.clear_restyle_flags_and_damage();
|
||||||
}
|
}
|
||||||
|
|
||||||
// There are two cases when we want to clear the dity descendants bit here
|
// Optionally clear the descendants bit for the traversal type we're in.
|
||||||
// after styling this element. The first case is when we were explicitly
|
if flags.for_animation_only() {
|
||||||
// asked to clear the bit by the caller.
|
if flags.contains(traversal_flags::ClearAnimationOnlyDirtyDescendants) {
|
||||||
//
|
unsafe { element.unset_animation_only_dirty_descendants(); }
|
||||||
// The second case is when this element is the root of a display:none
|
}
|
||||||
// subtree, even if the style didn't change (since, if the style did change,
|
} else {
|
||||||
// we'd have already cleared it above).
|
// There are two cases when we want to clear the dity descendants bit here
|
||||||
//
|
// after styling this element. The first case is when we were explicitly
|
||||||
// This keeps the tree in a valid state without requiring the DOM to check
|
// asked to clear the bit by the caller.
|
||||||
// display:none on the parent when inserting new children (which can be
|
//
|
||||||
// moderately expensive). Instead, DOM implementations can unconditionally
|
// The second case is when this element is the root of a display:none
|
||||||
// set the dirty descendants bit on any styled parent, and let the traversal
|
// subtree, even if the style didn't change (since, if the style did change,
|
||||||
// sort it out.
|
// we'd have already cleared it above).
|
||||||
if flags.contains(traversal_flags::ClearDirtyDescendants) ||
|
//
|
||||||
data.styles.is_display_none() {
|
// This keeps the tree in a valid state without requiring the DOM to check
|
||||||
unsafe { element.unset_dirty_descendants(); }
|
// display:none on the parent when inserting new children (which can be
|
||||||
}
|
// moderately expensive). Instead, DOM implementations can unconditionally
|
||||||
|
// set the dirty descendants bit on any styled parent, and let the traversal
|
||||||
// Similarly, check if we're supposed to clear the animation bit.
|
// sort it out.
|
||||||
if flags.contains(traversal_flags::ClearAnimationOnlyDirtyDescendants) {
|
if flags.contains(traversal_flags::ClearDirtyDescendants) ||
|
||||||
unsafe { element.unset_animation_only_dirty_descendants(); }
|
data.styles.is_display_none() {
|
||||||
|
unsafe { element.unset_dirty_descendants(); }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
context.thread_local.end_element(element);
|
context.thread_local.end_element(element);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue