mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Format style component.
This commit is contained in:
parent
31fc6cd565
commit
8dab4d659a
120 changed files with 2207 additions and 1417 deletions
|
@ -208,11 +208,11 @@ pub trait DomTraversal<E: TElement>: Sync {
|
|||
// animation-only restyle hint or recascade.
|
||||
if traversal_flags.for_animation_only() {
|
||||
return data.map_or(false, |d| d.has_styles()) &&
|
||||
(el.has_animation_only_dirty_descendants() ||
|
||||
data.as_ref()
|
||||
.unwrap()
|
||||
.hint
|
||||
.has_animation_hint_or_recascade());
|
||||
(el.has_animation_only_dirty_descendants() || data
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.hint
|
||||
.has_animation_hint_or_recascade());
|
||||
}
|
||||
|
||||
// Non-incremental layout visits every node.
|
||||
|
@ -279,7 +279,8 @@ pub trait DomTraversal<E: TElement>: Sync {
|
|||
// likely to load valid bindings, we avoid wasted work here, which may
|
||||
// be a very big perf hit when elements with bindings are nested
|
||||
// heavily.
|
||||
if cfg!(feature = "gecko") && is_initial_style &&
|
||||
if cfg!(feature = "gecko") &&
|
||||
is_initial_style &&
|
||||
parent_data.styles.primary().has_moz_binding()
|
||||
{
|
||||
debug!("Parent {:?} has XBL binding, deferring traversal", parent);
|
||||
|
@ -384,8 +385,7 @@ where
|
|||
).resolve_style(
|
||||
style.as_ref().map(|s| &**s),
|
||||
layout_parent_style.as_ref().map(|s| &**s),
|
||||
)
|
||||
.into()
|
||||
).into()
|
||||
}
|
||||
|
||||
/// Calculates the style for a single node.
|
||||
|
@ -411,7 +411,8 @@ pub fn recalc_style_at<E, D, F>(
|
|||
|
||||
context.thread_local.statistics.elements_traversed += 1;
|
||||
debug_assert!(
|
||||
flags.intersects(TraversalFlags::AnimationOnly) || !element.has_snapshot() ||
|
||||
flags.intersects(TraversalFlags::AnimationOnly) ||
|
||||
!element.has_snapshot() ||
|
||||
element.handled_snapshot(),
|
||||
"Should've handled snapshots here already"
|
||||
);
|
||||
|
@ -512,8 +513,9 @@ pub fn recalc_style_at<E, D, F>(
|
|||
!child_cascade_requirement.can_skip_cascade() ||
|
||||
is_servo_nonincremental_layout();
|
||||
|
||||
traverse_children = traverse_children &&
|
||||
!traversal.should_cull_subtree(context, element, &data, is_initial_style);
|
||||
traverse_children =
|
||||
traverse_children &&
|
||||
!traversal.should_cull_subtree(context, element, &data, is_initial_style);
|
||||
|
||||
// Examine our children, and enqueue the appropriate ones for traversal.
|
||||
if traverse_children {
|
||||
|
@ -535,7 +537,8 @@ pub fn recalc_style_at<E, D, F>(
|
|||
}
|
||||
|
||||
debug_assert!(
|
||||
flags.for_animation_only() || !flags.contains(TraversalFlags::ClearDirtyBits) ||
|
||||
flags.for_animation_only() ||
|
||||
!flags.contains(TraversalFlags::ClearDirtyBits) ||
|
||||
!element.has_animation_only_dirty_descendants(),
|
||||
"Should have cleared animation bits already"
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue