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>
This commit is contained in:
Martin Robinson 2025-03-13 14:10:48 +01:00 committed by GitHub
parent e627ac5cfd
commit be164874e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 0 additions and 31 deletions

View file

@ -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
}

View file

@ -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 {