From 562744b21491aaecaea1ef09690ec9c587f68d19 Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Thu, 12 Mar 2026 10:00:04 +0100 Subject: [PATCH] Remove the Servo non-incremental layout feature This isn't really used. Nowadays we always test incremental layout as it's considered an essential feature of the functionining of Servo. Signed-off-by: Martin Robinson --- style/traversal.rs | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/style/traversal.rs b/style/traversal.rs index b80fd1dc73..d0ac0294b1 100644 --- a/style/traversal.rs +++ b/style/traversal.rs @@ -52,27 +52,6 @@ impl PreTraverseToken { } } -/// A global variable holding the state of -/// `is_servo_nonincremental_layout()`. -/// See [#22854](https://github.com/servo/servo/issues/22854). -#[cfg(feature = "servo")] -pub static IS_SERVO_NONINCREMENTAL_LAYOUT: std::sync::atomic::AtomicBool = - std::sync::atomic::AtomicBool::new(false); - -#[cfg(feature = "servo")] -#[inline] -fn is_servo_nonincremental_layout() -> bool { - use std::sync::atomic::Ordering; - - IS_SERVO_NONINCREMENTAL_LAYOUT.load(Ordering::Relaxed) -} - -#[cfg(not(feature = "servo"))] -#[inline] -fn is_servo_nonincremental_layout() -> bool { - false -} - /// A DOM Traversal trait, that is used to generically implement styling for /// Gecko and Servo. pub trait DomTraversal: Sync { @@ -219,11 +198,6 @@ pub trait DomTraversal: Sync { el, traversal_flags, data ); - // Non-incremental layout visits every node. - if is_servo_nonincremental_layout() { - return true; - } - // Unwrap the data. let data = match data { Some(d) if d.has_styles() => d, @@ -513,8 +487,7 @@ pub fn recalc_style_at( // We only do this if we're not a display: none root, since in that case // it's useless to style children. let mut traverse_children = has_dirty_descendants_for_this_restyle - || !propagated_hint.is_empty() - || is_servo_nonincremental_layout(); + || !propagated_hint.is_empty(); traverse_children = traverse_children && !data.styles.is_display_none(); @@ -759,9 +732,7 @@ fn note_children( let child = match child_node.as_element() { Some(el) => el, None => { - if is_servo_nonincremental_layout() - || D::text_node_needs_traversal(child_node, data) - { + if D::text_node_needs_traversal(child_node, data) { note_child(child_node); } continue;