aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2025-03-13 14:10:48 +0100
committerGitHub <noreply@github.com>2025-03-13 13:10:48 +0000
commitbe164874e793e20740ef1a685a4e7e5364e02ba4 (patch)
treea997cc781191e3142ee9126122e471de201b33e9
parente627ac5cfda7ce9b0e79d66853341a759bd95735 (diff)
downloadservo-be164874e793e20740ef1a685a4e7e5364e02ba4.tar.gz
servo-be164874e793e20740ef1a685a4e7e5364e02ba4.zip
script: Remove ThreadSafeLayoutNode::is_ignorable_whitespace (#35959)
This is now unused with the removal of legacy layout. I didn't see any others methods in this trait that were unused. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
-rw-r--r--components/script/layout_dom/node.rs29
-rw-r--r--components/shared/script_layout/wrapper_traits.rs2
2 files changed, 0 insertions, 31 deletions
diff --git a/components/script/layout_dom/node.rs b/components/script/layout_dom/node.rs
index 9e04e861844..4a7b3a04b06 100644
--- a/components/script/layout_dom/node.rs
+++ b/components/script/layout_dom/node.rs
@@ -23,21 +23,16 @@ use script_layout_interface::{
use servo_arc::Arc;
use servo_url::ServoUrl;
use style;
-use style::computed_values::white_space_collapse::T as WhiteSpaceCollapse;
-use style::context::SharedStyleContext;
use style::dom::{NodeInfo, TElement, TNode, TShadowRoot};
use style::properties::ComputedValues;
-use style::str::is_whitespace;
use super::{
ServoLayoutDocument, ServoLayoutElement, ServoShadowRoot, ServoThreadSafeLayoutElement,
};
use crate::dom::bindings::inheritance::{CharacterDataTypeId, NodeTypeId, TextTypeId};
use crate::dom::bindings::root::LayoutDom;
-use crate::dom::characterdata::LayoutCharacterDataHelpers;
use crate::dom::element::{Element, LayoutElementHelpers};
use crate::dom::node::{LayoutNodeHelpers, Node, NodeFlags, NodeTypeIdWrapper};
-use crate::dom::text::Text;
/// A wrapper around a `LayoutDom<Node>` which provides a safe interface that
/// can be used during layout. This implements the `LayoutNode` trait as well as
@@ -343,30 +338,6 @@ impl<'dom> ThreadSafeLayoutNode<'dom> for ServoThreadSafeLayoutNode<'dom> {
self.node.layout_data()
}
- fn is_ignorable_whitespace(&self, context: &SharedStyleContext) -> bool {
- unsafe {
- let text: LayoutDom<Text> = match self.get_jsmanaged().downcast() {
- Some(text) => text,
- None => return false,
- };
-
- if !is_whitespace(text.upcast().data_for_layout()) {
- return false;
- }
-
- // NB: See the rules for `white-space` here:
- //
- // http://www.w3.org/TR/CSS21/text.html#propdef-white-space
- //
- // If you implement other values for this property, you will almost certainly
- // want to update this check.
- self.style(context)
- .get_inherited_text()
- .white_space_collapse ==
- WhiteSpaceCollapse::Collapse
- }
- }
-
fn unsafe_get(self) -> Self::ConcreteNode {
self.node
}
diff --git a/components/shared/script_layout/wrapper_traits.rs b/components/shared/script_layout/wrapper_traits.rs
index bc7939d8870..109dedfcaae 100644
--- a/components/shared/script_layout/wrapper_traits.rs
+++ b/components/shared/script_layout/wrapper_traits.rs
@@ -267,8 +267,6 @@ pub trait ThreadSafeLayoutNode<'dom>: Clone + Copy + Debug + NodeInfo + PartialE
}
}
- fn is_ignorable_whitespace(&self, context: &SharedStyleContext) -> bool;
-
/// Returns true if this node contributes content. This is used in the implementation of
/// `empty_cells` per CSS 2.1 § 17.6.1.1.
fn is_content(&self) -> bool {