mirror of
https://github.com/servo/servo.git
synced 2025-07-24 07:40:27 +01:00
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:
parent
e627ac5cfd
commit
be164874e7
2 changed files with 0 additions and 31 deletions
|
@ -23,21 +23,16 @@ use script_layout_interface::{
|
||||||
use servo_arc::Arc;
|
use servo_arc::Arc;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use style;
|
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::dom::{NodeInfo, TElement, TNode, TShadowRoot};
|
||||||
use style::properties::ComputedValues;
|
use style::properties::ComputedValues;
|
||||||
use style::str::is_whitespace;
|
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
ServoLayoutDocument, ServoLayoutElement, ServoShadowRoot, ServoThreadSafeLayoutElement,
|
ServoLayoutDocument, ServoLayoutElement, ServoShadowRoot, ServoThreadSafeLayoutElement,
|
||||||
};
|
};
|
||||||
use crate::dom::bindings::inheritance::{CharacterDataTypeId, NodeTypeId, TextTypeId};
|
use crate::dom::bindings::inheritance::{CharacterDataTypeId, NodeTypeId, TextTypeId};
|
||||||
use crate::dom::bindings::root::LayoutDom;
|
use crate::dom::bindings::root::LayoutDom;
|
||||||
use crate::dom::characterdata::LayoutCharacterDataHelpers;
|
|
||||||
use crate::dom::element::{Element, LayoutElementHelpers};
|
use crate::dom::element::{Element, LayoutElementHelpers};
|
||||||
use crate::dom::node::{LayoutNodeHelpers, Node, NodeFlags, NodeTypeIdWrapper};
|
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
|
/// 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
|
/// 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()
|
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 {
|
fn unsafe_get(self) -> Self::ConcreteNode {
|
||||||
self.node
|
self.node
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
/// Returns true if this node contributes content. This is used in the implementation of
|
||||||
/// `empty_cells` per CSS 2.1 § 17.6.1.1.
|
/// `empty_cells` per CSS 2.1 § 17.6.1.1.
|
||||||
fn is_content(&self) -> bool {
|
fn is_content(&self) -> bool {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue